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_ARM | 5 #if V8_TARGET_ARCH_ARM |
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 | 16 |
17 #define __ ACCESS_MASM(masm) | 17 #define __ ACCESS_MASM(masm) |
18 | 18 |
19 void Builtins::Generate_Adaptor(MacroAssembler* masm, CFunctionId id) { | 19 void Builtins::Generate_Adaptor(MacroAssembler* masm, CFunctionId id, |
| 20 ExitFrameType exit_frame_type) { |
20 // ----------- S t a t e ------------- | 21 // ----------- S t a t e ------------- |
21 // -- r0 : number of arguments excluding receiver | 22 // -- r0 : number of arguments excluding receiver |
22 // -- r1 : target | 23 // -- r1 : target |
23 // -- r3 : new.target | 24 // -- r3 : new.target |
24 // -- sp[0] : last argument | 25 // -- sp[0] : last argument |
25 // -- ... | 26 // -- ... |
26 // -- sp[4 * (argc - 1)] : first argument | 27 // -- sp[4 * (argc - 1)] : first argument |
27 // -- sp[4 * argc] : receiver | 28 // -- sp[4 * argc] : receiver |
28 // ----------------------------------- | 29 // ----------------------------------- |
29 __ AssertFunction(r1); | 30 __ AssertFunction(r1); |
30 | 31 |
31 // Make sure we operate in the context of the called function (for example | 32 // 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 | 33 // 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 | 34 // instead of the callee, due to the way that [[Construct]] is defined for |
34 // ordinary functions). | 35 // ordinary functions). |
35 __ ldr(cp, FieldMemOperand(r1, JSFunction::kContextOffset)); | 36 __ ldr(cp, FieldMemOperand(r1, JSFunction::kContextOffset)); |
36 | 37 |
37 // Insert extra arguments. | 38 // Insert extra arguments. |
38 const int num_extra_args = 2; | 39 const int num_extra_args = 2; |
39 __ Push(r1, r3); | 40 __ Push(r1, r3); |
40 | 41 |
41 // JumpToExternalReference expects r0 to contain the number of arguments | 42 // JumpToExternalReference expects r0 to contain the number of arguments |
42 // including the receiver and the extra arguments. | 43 // including the receiver and the extra arguments. |
43 __ add(r0, r0, Operand(num_extra_args + 1)); | 44 __ add(r0, r0, Operand(num_extra_args + 1)); |
44 | 45 |
45 __ JumpToExternalReference(ExternalReference(id, masm->isolate())); | 46 __ JumpToExternalReference(ExternalReference(id, masm->isolate()), |
| 47 exit_frame_type == BUILTIN_EXIT); |
46 } | 48 } |
47 | 49 |
48 | 50 |
49 // Load the built-in InternalArray function from the current context. | 51 // Load the built-in InternalArray function from the current context. |
50 static void GenerateLoadInternalArrayFunction(MacroAssembler* masm, | 52 static void GenerateLoadInternalArrayFunction(MacroAssembler* masm, |
51 Register result) { | 53 Register result) { |
52 // Load the InternalArray function from the current native context. | 54 // Load the InternalArray function from the current native context. |
53 __ LoadNativeContextSlot(Context::INTERNAL_ARRAY_FUNCTION_INDEX, result); | 55 __ LoadNativeContextSlot(Context::INTERNAL_ARRAY_FUNCTION_INDEX, result); |
54 } | 56 } |
55 | 57 |
(...skipping 2820 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2876 } | 2878 } |
2877 } | 2879 } |
2878 | 2880 |
2879 | 2881 |
2880 #undef __ | 2882 #undef __ |
2881 | 2883 |
2882 } // namespace internal | 2884 } // namespace internal |
2883 } // namespace v8 | 2885 } // namespace v8 |
2884 | 2886 |
2885 #endif // V8_TARGET_ARCH_ARM | 2887 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |