| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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_ARM64 | 7 #if V8_TARGET_ARCH_ARM64 |
| 8 | 8 |
| 9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
| 10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
| (...skipping 2665 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2676 __ LoadGlobalFunction(Context::ARRAY_FUNCTION_INDEX, scratch1); | 2676 __ LoadGlobalFunction(Context::ARRAY_FUNCTION_INDEX, scratch1); |
| 2677 __ Cmp(function, scratch1); | 2677 __ Cmp(function, scratch1); |
| 2678 __ B(ne, &megamorphic); | 2678 __ B(ne, &megamorphic); |
| 2679 __ B(&done); | 2679 __ B(&done); |
| 2680 } | 2680 } |
| 2681 | 2681 |
| 2682 __ Bind(&miss); | 2682 __ Bind(&miss); |
| 2683 | 2683 |
| 2684 // A monomorphic miss (i.e, here the cache is not uninitialized) goes | 2684 // A monomorphic miss (i.e, here the cache is not uninitialized) goes |
| 2685 // megamorphic. | 2685 // megamorphic. |
| 2686 __ JumpIfRoot(scratch1, Heap::kUninitializedSymbolRootIndex, &initialize); | 2686 __ JumpIfRoot(scratch1, Heap::kuninitialized_symbolRootIndex, &initialize); |
| 2687 // MegamorphicSentinel is an immortal immovable object (undefined) so no | 2687 // MegamorphicSentinel is an immortal immovable object (undefined) so no |
| 2688 // write-barrier is needed. | 2688 // write-barrier is needed. |
| 2689 __ Bind(&megamorphic); | 2689 __ Bind(&megamorphic); |
| 2690 __ Add(scratch1, feedback_vector, | 2690 __ Add(scratch1, feedback_vector, |
| 2691 Operand::UntagSmiAndScale(index, kPointerSizeLog2)); | 2691 Operand::UntagSmiAndScale(index, kPointerSizeLog2)); |
| 2692 __ LoadRoot(scratch2, Heap::kMegamorphicSymbolRootIndex); | 2692 __ LoadRoot(scratch2, Heap::kmegamorphic_symbolRootIndex); |
| 2693 __ Str(scratch2, FieldMemOperand(scratch1, FixedArray::kHeaderSize)); | 2693 __ Str(scratch2, FieldMemOperand(scratch1, FixedArray::kHeaderSize)); |
| 2694 __ B(&done); | 2694 __ B(&done); |
| 2695 | 2695 |
| 2696 // An uninitialized cache is patched with the function or sentinel to | 2696 // An uninitialized cache is patched with the function or sentinel to |
| 2697 // indicate the ElementsKind if function is the Array constructor. | 2697 // indicate the ElementsKind if function is the Array constructor. |
| 2698 __ Bind(&initialize); | 2698 __ Bind(&initialize); |
| 2699 | 2699 |
| 2700 if (!FLAG_pretenuring_call_new) { | 2700 if (!FLAG_pretenuring_call_new) { |
| 2701 // Make sure the function is the Array() function | 2701 // Make sure the function is the Array() function |
| 2702 __ LoadGlobalFunction(Context::ARRAY_FUNCTION_INDEX, scratch1); | 2702 __ LoadGlobalFunction(Context::ARRAY_FUNCTION_INDEX, scratch1); |
| (...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3031 EmitSlowCase(masm, argc, function, type, &non_function); | 3031 EmitSlowCase(masm, argc, function, type, &non_function); |
| 3032 | 3032 |
| 3033 if (CallAsMethod()) { | 3033 if (CallAsMethod()) { |
| 3034 __ bind(&wrap); | 3034 __ bind(&wrap); |
| 3035 EmitWrapCase(masm, argc, &cont); | 3035 EmitWrapCase(masm, argc, &cont); |
| 3036 } | 3036 } |
| 3037 | 3037 |
| 3038 __ bind(&extra_checks_or_miss); | 3038 __ bind(&extra_checks_or_miss); |
| 3039 Label miss; | 3039 Label miss; |
| 3040 | 3040 |
| 3041 __ JumpIfRoot(x4, Heap::kMegamorphicSymbolRootIndex, &slow_start); | 3041 __ JumpIfRoot(x4, Heap::kmegamorphic_symbolRootIndex, &slow_start); |
| 3042 __ JumpIfRoot(x4, Heap::kUninitializedSymbolRootIndex, &miss); | 3042 __ JumpIfRoot(x4, Heap::kuninitialized_symbolRootIndex, &miss); |
| 3043 | 3043 |
| 3044 if (!FLAG_trace_ic) { | 3044 if (!FLAG_trace_ic) { |
| 3045 // We are going megamorphic. If the feedback is a JSFunction, it is fine | 3045 // We are going megamorphic. If the feedback is a JSFunction, it is fine |
| 3046 // to handle it here. More complex cases are dealt with in the runtime. | 3046 // to handle it here. More complex cases are dealt with in the runtime. |
| 3047 __ AssertNotSmi(x4); | 3047 __ AssertNotSmi(x4); |
| 3048 __ JumpIfNotObjectType(x4, x5, x5, JS_FUNCTION_TYPE, &miss); | 3048 __ JumpIfNotObjectType(x4, x5, x5, JS_FUNCTION_TYPE, &miss); |
| 3049 __ Add(x4, feedback_vector, | 3049 __ Add(x4, feedback_vector, |
| 3050 Operand::UntagSmiAndScale(index, kPointerSizeLog2)); | 3050 Operand::UntagSmiAndScale(index, kPointerSizeLog2)); |
| 3051 __ LoadRoot(x5, Heap::kMegamorphicSymbolRootIndex); | 3051 __ LoadRoot(x5, Heap::kmegamorphic_symbolRootIndex); |
| 3052 __ Str(x5, FieldMemOperand(x4, FixedArray::kHeaderSize)); | 3052 __ Str(x5, FieldMemOperand(x4, FixedArray::kHeaderSize)); |
| 3053 __ B(&slow_start); | 3053 __ B(&slow_start); |
| 3054 } | 3054 } |
| 3055 | 3055 |
| 3056 // We are here because tracing is on or we are going monomorphic. | 3056 // We are here because tracing is on or we are going monomorphic. |
| 3057 __ bind(&miss); | 3057 __ bind(&miss); |
| 3058 GenerateMiss(masm); | 3058 GenerateMiss(masm); |
| 3059 | 3059 |
| 3060 // the slow case | 3060 // the slow case |
| 3061 __ bind(&slow_start); | 3061 __ bind(&slow_start); |
| (...skipping 1998 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5060 MemOperand(fp, 6 * kPointerSize), | 5060 MemOperand(fp, 6 * kPointerSize), |
| 5061 NULL); | 5061 NULL); |
| 5062 } | 5062 } |
| 5063 | 5063 |
| 5064 | 5064 |
| 5065 #undef __ | 5065 #undef __ |
| 5066 | 5066 |
| 5067 } } // namespace v8::internal | 5067 } } // namespace v8::internal |
| 5068 | 5068 |
| 5069 #endif // V8_TARGET_ARCH_ARM64 | 5069 #endif // V8_TARGET_ARCH_ARM64 |
| OLD | NEW |