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_MIPS64 | 7 #if V8_TARGET_ARCH_MIPS64 |
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 2521 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2532 // Make sure the function is the Array() function | 2532 // Make sure the function is the Array() function |
2533 __ LoadGlobalFunction(Context::ARRAY_FUNCTION_INDEX, a4); | 2533 __ LoadGlobalFunction(Context::ARRAY_FUNCTION_INDEX, a4); |
2534 __ Branch(&megamorphic, ne, a1, Operand(a4)); | 2534 __ Branch(&megamorphic, ne, a1, Operand(a4)); |
2535 __ jmp(&done); | 2535 __ jmp(&done); |
2536 } | 2536 } |
2537 | 2537 |
2538 __ bind(&miss); | 2538 __ bind(&miss); |
2539 | 2539 |
2540 // A monomorphic miss (i.e, here the cache is not uninitialized) goes | 2540 // A monomorphic miss (i.e, here the cache is not uninitialized) goes |
2541 // megamorphic. | 2541 // megamorphic. |
2542 __ LoadRoot(at, Heap::kUninitializedSymbolRootIndex); | 2542 __ LoadRoot(at, Heap::kuninitialized_symbolRootIndex); |
2543 __ Branch(&initialize, eq, a4, Operand(at)); | 2543 __ Branch(&initialize, eq, a4, Operand(at)); |
2544 // MegamorphicSentinel is an immortal immovable object (undefined) so no | 2544 // MegamorphicSentinel is an immortal immovable object (undefined) so no |
2545 // write-barrier is needed. | 2545 // write-barrier is needed. |
2546 __ bind(&megamorphic); | 2546 __ bind(&megamorphic); |
2547 __ dsrl(a4, a3, 32- kPointerSizeLog2); | 2547 __ dsrl(a4, a3, 32- kPointerSizeLog2); |
2548 __ Daddu(a4, a2, Operand(a4)); | 2548 __ Daddu(a4, a2, Operand(a4)); |
2549 __ LoadRoot(at, Heap::kMegamorphicSymbolRootIndex); | 2549 __ LoadRoot(at, Heap::kmegamorphic_symbolRootIndex); |
2550 __ sd(at, FieldMemOperand(a4, FixedArray::kHeaderSize)); | 2550 __ sd(at, FieldMemOperand(a4, FixedArray::kHeaderSize)); |
2551 __ jmp(&done); | 2551 __ jmp(&done); |
2552 | 2552 |
2553 // An uninitialized cache is patched with the function. | 2553 // An uninitialized cache is patched with the function. |
2554 __ bind(&initialize); | 2554 __ bind(&initialize); |
2555 if (!FLAG_pretenuring_call_new) { | 2555 if (!FLAG_pretenuring_call_new) { |
2556 // Make sure the function is the Array() function. | 2556 // Make sure the function is the Array() function. |
2557 __ LoadGlobalFunction(Context::ARRAY_FUNCTION_INDEX, a4); | 2557 __ LoadGlobalFunction(Context::ARRAY_FUNCTION_INDEX, a4); |
2558 __ Branch(¬_array_function, ne, a1, Operand(a4)); | 2558 __ Branch(¬_array_function, ne, a1, Operand(a4)); |
2559 | 2559 |
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2897 EmitSlowCase(masm, argc, &non_function); | 2897 EmitSlowCase(masm, argc, &non_function); |
2898 | 2898 |
2899 if (CallAsMethod()) { | 2899 if (CallAsMethod()) { |
2900 __ bind(&wrap); | 2900 __ bind(&wrap); |
2901 EmitWrapCase(masm, argc, &cont); | 2901 EmitWrapCase(masm, argc, &cont); |
2902 } | 2902 } |
2903 | 2903 |
2904 __ bind(&extra_checks_or_miss); | 2904 __ bind(&extra_checks_or_miss); |
2905 Label miss; | 2905 Label miss; |
2906 | 2906 |
2907 __ LoadRoot(at, Heap::kMegamorphicSymbolRootIndex); | 2907 __ LoadRoot(at, Heap::kmegamorphic_symbolRootIndex); |
2908 __ Branch(&slow_start, eq, a4, Operand(at)); | 2908 __ Branch(&slow_start, eq, a4, Operand(at)); |
2909 __ LoadRoot(at, Heap::kUninitializedSymbolRootIndex); | 2909 __ LoadRoot(at, Heap::kuninitialized_symbolRootIndex); |
2910 __ Branch(&miss, eq, a4, Operand(at)); | 2910 __ Branch(&miss, eq, a4, Operand(at)); |
2911 | 2911 |
2912 if (!FLAG_trace_ic) { | 2912 if (!FLAG_trace_ic) { |
2913 // We are going megamorphic. If the feedback is a JSFunction, it is fine | 2913 // We are going megamorphic. If the feedback is a JSFunction, it is fine |
2914 // to handle it here. More complex cases are dealt with in the runtime. | 2914 // to handle it here. More complex cases are dealt with in the runtime. |
2915 __ AssertNotSmi(a4); | 2915 __ AssertNotSmi(a4); |
2916 __ GetObjectType(a4, a5, a5); | 2916 __ GetObjectType(a4, a5, a5); |
2917 __ Branch(&miss, ne, a5, Operand(JS_FUNCTION_TYPE)); | 2917 __ Branch(&miss, ne, a5, Operand(JS_FUNCTION_TYPE)); |
2918 __ dsrl(a4, a3, 32 - kPointerSizeLog2); | 2918 __ dsrl(a4, a3, 32 - kPointerSizeLog2); |
2919 __ Daddu(a4, a2, Operand(a4)); | 2919 __ Daddu(a4, a2, Operand(a4)); |
2920 __ LoadRoot(at, Heap::kMegamorphicSymbolRootIndex); | 2920 __ LoadRoot(at, Heap::kmegamorphic_symbolRootIndex); |
2921 __ sd(at, FieldMemOperand(a4, FixedArray::kHeaderSize)); | 2921 __ sd(at, FieldMemOperand(a4, FixedArray::kHeaderSize)); |
2922 __ Branch(&slow_start); | 2922 __ Branch(&slow_start); |
2923 } | 2923 } |
2924 | 2924 |
2925 // We are here because tracing is on or we are going monomorphic. | 2925 // We are here because tracing is on or we are going monomorphic. |
2926 __ bind(&miss); | 2926 __ bind(&miss); |
2927 GenerateMiss(masm); | 2927 GenerateMiss(masm); |
2928 | 2928 |
2929 // the slow case | 2929 // the slow case |
2930 __ bind(&slow_start); | 2930 __ bind(&slow_start); |
(...skipping 1992 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4923 MemOperand(fp, 6 * kPointerSize), | 4923 MemOperand(fp, 6 * kPointerSize), |
4924 NULL); | 4924 NULL); |
4925 } | 4925 } |
4926 | 4926 |
4927 | 4927 |
4928 #undef __ | 4928 #undef __ |
4929 | 4929 |
4930 } } // namespace v8::internal | 4930 } } // namespace v8::internal |
4931 | 4931 |
4932 #endif // V8_TARGET_ARCH_MIPS64 | 4932 #endif // V8_TARGET_ARCH_MIPS64 |
OLD | NEW |