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