OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 2740 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2751 __ add(r4, r4, Operand(kPointerSize)); | 2751 __ add(r4, r4, Operand(kPointerSize)); |
2752 __ bind(&entry); | 2752 __ bind(&entry); |
2753 __ cmp(r4, Operand(r2)); | 2753 __ cmp(r4, Operand(r2)); |
2754 __ b(ne, &loop); | 2754 __ b(ne, &loop); |
2755 | 2755 |
2756 // If a valueOf property is not found on the object check that it's | 2756 // If a valueOf property is not found on the object check that it's |
2757 // prototype is the un-modified String prototype. If not result is false. | 2757 // prototype is the un-modified String prototype. If not result is false. |
2758 __ ldr(r2, FieldMemOperand(r1, Map::kPrototypeOffset)); | 2758 __ ldr(r2, FieldMemOperand(r1, Map::kPrototypeOffset)); |
2759 __ JumpIfSmi(r2, if_false); | 2759 __ JumpIfSmi(r2, if_false); |
2760 __ ldr(r2, FieldMemOperand(r2, HeapObject::kMapOffset)); | 2760 __ ldr(r2, FieldMemOperand(r2, HeapObject::kMapOffset)); |
2761 __ ldr(r3, ContextOperand(cp, Context::GLOBAL_INDEX)); | 2761 __ ldr(r3, ContextOperand(cp, Context::GLOBAL_OBJECT_INDEX)); |
2762 __ ldr(r3, FieldMemOperand(r3, GlobalObject::kNativeContextOffset)); | 2762 __ ldr(r3, FieldMemOperand(r3, GlobalObject::kNativeContextOffset)); |
2763 __ ldr(r3, ContextOperand(r3, Context::STRING_FUNCTION_PROTOTYPE_MAP_INDEX)); | 2763 __ ldr(r3, ContextOperand(r3, Context::STRING_FUNCTION_PROTOTYPE_MAP_INDEX)); |
2764 __ cmp(r2, r3); | 2764 __ cmp(r2, r3); |
2765 __ b(ne, if_false); | 2765 __ b(ne, if_false); |
2766 | 2766 |
2767 // Set the bit in the map to indicate that it has been checked safe for | 2767 // Set the bit in the map to indicate that it has been checked safe for |
2768 // default valueOf and set true result. | 2768 // default valueOf and set true result. |
2769 __ ldrb(r2, FieldMemOperand(r1, Map::kBitField2Offset)); | 2769 __ ldrb(r2, FieldMemOperand(r1, Map::kBitField2Offset)); |
2770 __ orr(r2, r2, Operand(1 << Map::kStringWrapperSafeForDefaultValueOf)); | 2770 __ orr(r2, r2, Operand(1 << Map::kStringWrapperSafeForDefaultValueOf)); |
2771 __ strb(r2, FieldMemOperand(r1, Map::kBitField2Offset)); | 2771 __ strb(r2, FieldMemOperand(r1, Map::kBitField2Offset)); |
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3031 __ CallRuntime(Runtime::kNumberAlloc, 0); | 3031 __ CallRuntime(Runtime::kNumberAlloc, 0); |
3032 __ mov(r4, Operand(r0)); | 3032 __ mov(r4, Operand(r0)); |
3033 | 3033 |
3034 __ bind(&heapnumber_allocated); | 3034 __ bind(&heapnumber_allocated); |
3035 | 3035 |
3036 // Convert 32 random bits in r0 to 0.(32 random bits) in a double | 3036 // Convert 32 random bits in r0 to 0.(32 random bits) in a double |
3037 // by computing: | 3037 // by computing: |
3038 // ( 1.(20 0s)(32 random bits) x 2^20 ) - (1.0 x 2^20)). | 3038 // ( 1.(20 0s)(32 random bits) x 2^20 ) - (1.0 x 2^20)). |
3039 if (CpuFeatures::IsSupported(VFP2)) { | 3039 if (CpuFeatures::IsSupported(VFP2)) { |
3040 __ PrepareCallCFunction(1, r0); | 3040 __ PrepareCallCFunction(1, r0); |
3041 __ ldr(r0, ContextOperand(context_register(), Context::GLOBAL_INDEX)); | 3041 __ ldr(r0, |
| 3042 ContextOperand(context_register(), Context::GLOBAL_OBJECT_INDEX)); |
3042 __ ldr(r0, FieldMemOperand(r0, GlobalObject::kNativeContextOffset)); | 3043 __ ldr(r0, FieldMemOperand(r0, GlobalObject::kNativeContextOffset)); |
3043 __ CallCFunction(ExternalReference::random_uint32_function(isolate()), 1); | 3044 __ CallCFunction(ExternalReference::random_uint32_function(isolate()), 1); |
3044 | 3045 |
3045 CpuFeatures::Scope scope(VFP2); | 3046 CpuFeatures::Scope scope(VFP2); |
3046 // 0x41300000 is the top half of 1.0 x 2^20 as a double. | 3047 // 0x41300000 is the top half of 1.0 x 2^20 as a double. |
3047 // Create this constant using mov/orr to avoid PC relative load. | 3048 // Create this constant using mov/orr to avoid PC relative load. |
3048 __ mov(r1, Operand(0x41000000)); | 3049 __ mov(r1, Operand(0x41000000)); |
3049 __ orr(r1, r1, Operand(0x300000)); | 3050 __ orr(r1, r1, Operand(0x300000)); |
3050 // Move 0x41300000xxxxxxxx (x = random bits) to VFP. | 3051 // Move 0x41300000xxxxxxxx (x = random bits) to VFP. |
3051 __ vmov(d7, r0, r1); | 3052 __ vmov(d7, r0, r1); |
3052 // Move 0x4130000000000000 to VFP. | 3053 // Move 0x4130000000000000 to VFP. |
3053 __ mov(r0, Operand(0, RelocInfo::NONE)); | 3054 __ mov(r0, Operand(0, RelocInfo::NONE)); |
3054 __ vmov(d8, r0, r1); | 3055 __ vmov(d8, r0, r1); |
3055 // Subtract and store the result in the heap number. | 3056 // Subtract and store the result in the heap number. |
3056 __ vsub(d7, d7, d8); | 3057 __ vsub(d7, d7, d8); |
3057 __ sub(r0, r4, Operand(kHeapObjectTag)); | 3058 __ sub(r0, r4, Operand(kHeapObjectTag)); |
3058 __ vstr(d7, r0, HeapNumber::kValueOffset); | 3059 __ vstr(d7, r0, HeapNumber::kValueOffset); |
3059 __ mov(r0, r4); | 3060 __ mov(r0, r4); |
3060 } else { | 3061 } else { |
3061 __ PrepareCallCFunction(2, r0); | 3062 __ PrepareCallCFunction(2, r0); |
3062 __ ldr(r1, ContextOperand(context_register(), Context::GLOBAL_INDEX)); | 3063 __ ldr(r1, |
| 3064 ContextOperand(context_register(), Context::GLOBAL_OBJECT_INDEX)); |
3063 __ mov(r0, Operand(r4)); | 3065 __ mov(r0, Operand(r4)); |
3064 __ ldr(r1, FieldMemOperand(r1, GlobalObject::kNativeContextOffset)); | 3066 __ ldr(r1, FieldMemOperand(r1, GlobalObject::kNativeContextOffset)); |
3065 __ CallCFunction( | 3067 __ CallCFunction( |
3066 ExternalReference::fill_heap_number_with_random_function(isolate()), 2); | 3068 ExternalReference::fill_heap_number_with_random_function(isolate()), 2); |
3067 } | 3069 } |
3068 | 3070 |
3069 context()->Plug(r0); | 3071 context()->Plug(r0); |
3070 } | 3072 } |
3071 | 3073 |
3072 | 3074 |
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3464 __ Abort("Attempt to use undefined cache."); | 3466 __ Abort("Attempt to use undefined cache."); |
3465 __ LoadRoot(r0, Heap::kUndefinedValueRootIndex); | 3467 __ LoadRoot(r0, Heap::kUndefinedValueRootIndex); |
3466 context()->Plug(r0); | 3468 context()->Plug(r0); |
3467 return; | 3469 return; |
3468 } | 3470 } |
3469 | 3471 |
3470 VisitForAccumulatorValue(args->at(1)); | 3472 VisitForAccumulatorValue(args->at(1)); |
3471 | 3473 |
3472 Register key = r0; | 3474 Register key = r0; |
3473 Register cache = r1; | 3475 Register cache = r1; |
3474 __ ldr(cache, ContextOperand(cp, Context::GLOBAL_INDEX)); | 3476 __ ldr(cache, ContextOperand(cp, Context::GLOBAL_OBJECT_INDEX)); |
3475 __ ldr(cache, FieldMemOperand(cache, GlobalObject::kNativeContextOffset)); | 3477 __ ldr(cache, FieldMemOperand(cache, GlobalObject::kNativeContextOffset)); |
3476 __ ldr(cache, ContextOperand(cache, Context::JSFUNCTION_RESULT_CACHES_INDEX)); | 3478 __ ldr(cache, ContextOperand(cache, Context::JSFUNCTION_RESULT_CACHES_INDEX)); |
3477 __ ldr(cache, | 3479 __ ldr(cache, |
3478 FieldMemOperand(cache, FixedArray::OffsetOfElementAt(cache_id))); | 3480 FieldMemOperand(cache, FixedArray::OffsetOfElementAt(cache_id))); |
3479 | 3481 |
3480 | 3482 |
3481 Label done, not_found; | 3483 Label done, not_found; |
3482 // tmp now holds finger offset as a smi. | 3484 // tmp now holds finger offset as a smi. |
3483 STATIC_ASSERT(kSmiTag == 0 && kSmiTagSize == 1); | 3485 STATIC_ASSERT(kSmiTag == 0 && kSmiTagSize == 1); |
3484 __ ldr(r2, FieldMemOperand(cache, JSFunctionResultCache::kFingerOffset)); | 3486 __ ldr(r2, FieldMemOperand(cache, JSFunctionResultCache::kFingerOffset)); |
(...skipping 1080 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4565 *context_length = 0; | 4567 *context_length = 0; |
4566 return previous_; | 4568 return previous_; |
4567 } | 4569 } |
4568 | 4570 |
4569 | 4571 |
4570 #undef __ | 4572 #undef __ |
4571 | 4573 |
4572 } } // namespace v8::internal | 4574 } } // namespace v8::internal |
4573 | 4575 |
4574 #endif // V8_TARGET_ARCH_ARM | 4576 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |