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 #if V8_TARGET_ARCH_MIPS64 | 5 #if V8_TARGET_ARCH_MIPS64 |
6 | 6 |
7 #include "src/codegen.h" | 7 #include "src/codegen.h" |
8 #include "src/debug/debug.h" | 8 #include "src/debug/debug.h" |
9 #include "src/deoptimizer.h" | 9 #include "src/deoptimizer.h" |
10 #include "src/full-codegen/full-codegen.h" | 10 #include "src/full-codegen/full-codegen.h" |
11 #include "src/runtime/runtime.h" | 11 #include "src/runtime/runtime.h" |
12 | 12 |
13 namespace v8 { | 13 namespace v8 { |
14 namespace internal { | 14 namespace internal { |
15 | 15 |
16 #define __ ACCESS_MASM(masm) | 16 #define __ ACCESS_MASM(masm) |
17 | 17 |
18 void Builtins::Generate_Adaptor(MacroAssembler* masm, CFunctionId id, | 18 void Builtins::Generate_Adaptor(MacroAssembler* masm, Address address, |
19 ExitFrameType exit_frame_type) { | 19 ExitFrameType exit_frame_type) { |
20 // ----------- S t a t e ------------- | 20 // ----------- S t a t e ------------- |
21 // -- a0 : number of arguments excluding receiver | 21 // -- a0 : number of arguments excluding receiver |
22 // -- a1 : target | 22 // -- a1 : target |
23 // -- a3 : new.target | 23 // -- a3 : new.target |
24 // -- sp[0] : last argument | 24 // -- sp[0] : last argument |
25 // -- ... | 25 // -- ... |
26 // -- sp[8 * (argc - 1)] : first argument | 26 // -- sp[8 * (argc - 1)] : first argument |
27 // -- sp[8 * agrc] : receiver | 27 // -- sp[8 * agrc] : receiver |
28 // ----------------------------------- | 28 // ----------------------------------- |
29 __ AssertFunction(a1); | 29 __ AssertFunction(a1); |
30 | 30 |
31 // Make sure we operate in the context of the called function (for example | 31 // Make sure we operate in the context of the called function (for example |
32 // ConstructStubs implemented in C++ will be run in the context of the caller | 32 // ConstructStubs implemented in C++ will be run in the context of the caller |
33 // instead of the callee, due to the way that [[Construct]] is defined for | 33 // instead of the callee, due to the way that [[Construct]] is defined for |
34 // ordinary functions). | 34 // ordinary functions). |
35 __ ld(cp, FieldMemOperand(a1, JSFunction::kContextOffset)); | 35 __ ld(cp, FieldMemOperand(a1, JSFunction::kContextOffset)); |
36 | 36 |
37 // JumpToExternalReference expects a0 to contain the number of arguments | 37 // JumpToExternalReference expects a0 to contain the number of arguments |
38 // including the receiver and the extra arguments. | 38 // including the receiver and the extra arguments. |
39 const int num_extra_args = 3; | 39 const int num_extra_args = 3; |
40 __ Daddu(a0, a0, num_extra_args + 1); | 40 __ Daddu(a0, a0, num_extra_args + 1); |
41 | 41 |
42 // Insert extra arguments. | 42 // Insert extra arguments. |
43 __ SmiTag(a0); | 43 __ SmiTag(a0); |
44 __ Push(a0, a1, a3); | 44 __ Push(a0, a1, a3); |
45 __ SmiUntag(a0); | 45 __ SmiUntag(a0); |
46 | 46 |
47 __ JumpToExternalReference(ExternalReference(id, masm->isolate()), PROTECT, | 47 __ JumpToExternalReference(ExternalReference(address, masm->isolate()), |
48 exit_frame_type == BUILTIN_EXIT); | 48 PROTECT, exit_frame_type == BUILTIN_EXIT); |
49 } | 49 } |
50 | 50 |
51 // Load the built-in InternalArray function from the current context. | 51 // Load the built-in InternalArray function from the current context. |
52 static void GenerateLoadInternalArrayFunction(MacroAssembler* masm, | 52 static void GenerateLoadInternalArrayFunction(MacroAssembler* masm, |
53 Register result) { | 53 Register result) { |
54 // Load the InternalArray function from the native context. | 54 // Load the InternalArray function from the native context. |
55 __ LoadNativeContextSlot(Context::INTERNAL_ARRAY_FUNCTION_INDEX, result); | 55 __ LoadNativeContextSlot(Context::INTERNAL_ARRAY_FUNCTION_INDEX, result); |
56 } | 56 } |
57 | 57 |
58 // Load the built-in Array function from the current context. | 58 // Load the built-in Array function from the current context. |
(...skipping 2906 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2965 __ break_(0xCC); | 2965 __ break_(0xCC); |
2966 } | 2966 } |
2967 } | 2967 } |
2968 | 2968 |
2969 #undef __ | 2969 #undef __ |
2970 | 2970 |
2971 } // namespace internal | 2971 } // namespace internal |
2972 } // namespace v8 | 2972 } // namespace v8 |
2973 | 2973 |
2974 #endif // V8_TARGET_ARCH_MIPS64 | 2974 #endif // V8_TARGET_ARCH_MIPS64 |
OLD | NEW |