OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_ARM | 7 #if V8_TARGET_ARCH_ARM |
8 | 8 |
9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
(...skipping 2358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2369 __ LoadGlobalFunction(Context::ARRAY_FUNCTION_INDEX, r4); | 2369 __ LoadGlobalFunction(Context::ARRAY_FUNCTION_INDEX, r4); |
2370 __ cmp(r1, r4); | 2370 __ cmp(r1, r4); |
2371 __ b(ne, &megamorphic); | 2371 __ b(ne, &megamorphic); |
2372 __ jmp(&done); | 2372 __ jmp(&done); |
2373 } | 2373 } |
2374 | 2374 |
2375 __ bind(&miss); | 2375 __ bind(&miss); |
2376 | 2376 |
2377 // A monomorphic miss (i.e, here the cache is not uninitialized) goes | 2377 // A monomorphic miss (i.e, here the cache is not uninitialized) goes |
2378 // megamorphic. | 2378 // megamorphic. |
2379 __ CompareRoot(r4, Heap::kUninitializedSymbolRootIndex); | 2379 __ CompareRoot(r4, Heap::kuninitialized_symbolRootIndex); |
2380 __ b(eq, &initialize); | 2380 __ b(eq, &initialize); |
2381 // MegamorphicSentinel is an immortal immovable object (undefined) so no | 2381 // MegamorphicSentinel is an immortal immovable object (undefined) so no |
2382 // write-barrier is needed. | 2382 // write-barrier is needed. |
2383 __ bind(&megamorphic); | 2383 __ bind(&megamorphic); |
2384 __ add(r4, r2, Operand::PointerOffsetFromSmiKey(r3)); | 2384 __ add(r4, r2, Operand::PointerOffsetFromSmiKey(r3)); |
2385 __ LoadRoot(ip, Heap::kMegamorphicSymbolRootIndex); | 2385 __ LoadRoot(ip, Heap::kmegamorphic_symbolRootIndex); |
2386 __ str(ip, FieldMemOperand(r4, FixedArray::kHeaderSize)); | 2386 __ str(ip, FieldMemOperand(r4, FixedArray::kHeaderSize)); |
2387 __ jmp(&done); | 2387 __ jmp(&done); |
2388 | 2388 |
2389 // An uninitialized cache is patched with the function | 2389 // An uninitialized cache is patched with the function |
2390 __ bind(&initialize); | 2390 __ bind(&initialize); |
2391 | 2391 |
2392 if (!FLAG_pretenuring_call_new) { | 2392 if (!FLAG_pretenuring_call_new) { |
2393 // Make sure the function is the Array() function | 2393 // Make sure the function is the Array() function |
2394 __ LoadGlobalFunction(Context::ARRAY_FUNCTION_INDEX, r4); | 2394 __ LoadGlobalFunction(Context::ARRAY_FUNCTION_INDEX, r4); |
2395 __ cmp(r1, r4); | 2395 __ cmp(r1, r4); |
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2691 EmitSlowCase(masm, argc, &non_function); | 2691 EmitSlowCase(masm, argc, &non_function); |
2692 | 2692 |
2693 if (CallAsMethod()) { | 2693 if (CallAsMethod()) { |
2694 __ bind(&wrap); | 2694 __ bind(&wrap); |
2695 EmitWrapCase(masm, argc, &cont); | 2695 EmitWrapCase(masm, argc, &cont); |
2696 } | 2696 } |
2697 | 2697 |
2698 __ bind(&extra_checks_or_miss); | 2698 __ bind(&extra_checks_or_miss); |
2699 Label miss; | 2699 Label miss; |
2700 | 2700 |
2701 __ CompareRoot(r4, Heap::kMegamorphicSymbolRootIndex); | 2701 __ CompareRoot(r4, Heap::kmegamorphic_symbolRootIndex); |
2702 __ b(eq, &slow_start); | 2702 __ b(eq, &slow_start); |
2703 __ CompareRoot(r4, Heap::kUninitializedSymbolRootIndex); | 2703 __ CompareRoot(r4, Heap::kuninitialized_symbolRootIndex); |
2704 __ b(eq, &miss); | 2704 __ b(eq, &miss); |
2705 | 2705 |
2706 if (!FLAG_trace_ic) { | 2706 if (!FLAG_trace_ic) { |
2707 // We are going megamorphic. If the feedback is a JSFunction, it is fine | 2707 // We are going megamorphic. If the feedback is a JSFunction, it is fine |
2708 // to handle it here. More complex cases are dealt with in the runtime. | 2708 // to handle it here. More complex cases are dealt with in the runtime. |
2709 __ AssertNotSmi(r4); | 2709 __ AssertNotSmi(r4); |
2710 __ CompareObjectType(r4, r5, r5, JS_FUNCTION_TYPE); | 2710 __ CompareObjectType(r4, r5, r5, JS_FUNCTION_TYPE); |
2711 __ b(ne, &miss); | 2711 __ b(ne, &miss); |
2712 __ add(r4, r2, Operand::PointerOffsetFromSmiKey(r3)); | 2712 __ add(r4, r2, Operand::PointerOffsetFromSmiKey(r3)); |
2713 __ LoadRoot(ip, Heap::kMegamorphicSymbolRootIndex); | 2713 __ LoadRoot(ip, Heap::kmegamorphic_symbolRootIndex); |
2714 __ str(ip, FieldMemOperand(r4, FixedArray::kHeaderSize)); | 2714 __ str(ip, FieldMemOperand(r4, FixedArray::kHeaderSize)); |
2715 __ jmp(&slow_start); | 2715 __ jmp(&slow_start); |
2716 } | 2716 } |
2717 | 2717 |
2718 // We are here because tracing is on or we are going monomorphic. | 2718 // We are here because tracing is on or we are going monomorphic. |
2719 __ bind(&miss); | 2719 __ bind(&miss); |
2720 GenerateMiss(masm); | 2720 GenerateMiss(masm); |
2721 | 2721 |
2722 // the slow case | 2722 // the slow case |
2723 __ bind(&slow_start); | 2723 __ bind(&slow_start); |
(...skipping 1954 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4678 MemOperand(fp, 6 * kPointerSize), | 4678 MemOperand(fp, 6 * kPointerSize), |
4679 NULL); | 4679 NULL); |
4680 } | 4680 } |
4681 | 4681 |
4682 | 4682 |
4683 #undef __ | 4683 #undef __ |
4684 | 4684 |
4685 } } // namespace v8::internal | 4685 } } // namespace v8::internal |
4686 | 4686 |
4687 #endif // V8_TARGET_ARCH_ARM | 4687 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |