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 #if V8_TARGET_ARCH_ARM64 | 5 #if V8_TARGET_ARCH_ARM64 |
6 | 6 |
7 #include "src/arm64/frames-arm64.h" | 7 #include "src/arm64/frames-arm64.h" |
8 #include "src/codegen.h" | 8 #include "src/codegen.h" |
9 #include "src/debug/debug.h" | 9 #include "src/debug/debug.h" |
10 #include "src/deoptimizer.h" | 10 #include "src/deoptimizer.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 } | 25 } |
26 | 26 |
27 | 27 |
28 // Load the built-in InternalArray function from the current context. | 28 // Load the built-in InternalArray function from the current context. |
29 static void GenerateLoadInternalArrayFunction(MacroAssembler* masm, | 29 static void GenerateLoadInternalArrayFunction(MacroAssembler* masm, |
30 Register result) { | 30 Register result) { |
31 // Load the InternalArray function from the native context. | 31 // Load the InternalArray function from the native context. |
32 __ LoadNativeContextSlot(Context::INTERNAL_ARRAY_FUNCTION_INDEX, result); | 32 __ LoadNativeContextSlot(Context::INTERNAL_ARRAY_FUNCTION_INDEX, result); |
33 } | 33 } |
34 | 34 |
35 void Builtins::Generate_Adaptor(MacroAssembler* masm, CFunctionId id) { | 35 void Builtins::Generate_Adaptor(MacroAssembler* masm, CFunctionId id, |
| 36 ExitFrameType exit_frame_type) { |
36 // ----------- S t a t e ------------- | 37 // ----------- S t a t e ------------- |
37 // -- x0 : number of arguments excluding receiver | 38 // -- x0 : number of arguments excluding receiver |
38 // -- x1 : target | 39 // -- x1 : target |
39 // -- x3 : new target | 40 // -- x3 : new target |
40 // -- sp[0] : last argument | 41 // -- sp[0] : last argument |
41 // -- ... | 42 // -- ... |
42 // -- sp[4 * (argc - 1)] : first argument | 43 // -- sp[4 * (argc - 1)] : first argument |
43 // -- sp[4 * argc] : receiver | 44 // -- sp[4 * argc] : receiver |
44 // ----------------------------------- | 45 // ----------------------------------- |
45 __ AssertFunction(x1); | 46 __ AssertFunction(x1); |
46 | 47 |
47 // Make sure we operate in the context of the called function (for example | 48 // Make sure we operate in the context of the called function (for example |
48 // ConstructStubs implemented in C++ will be run in the context of the caller | 49 // ConstructStubs implemented in C++ will be run in the context of the caller |
49 // instead of the callee, due to the way that [[Construct]] is defined for | 50 // instead of the callee, due to the way that [[Construct]] is defined for |
50 // ordinary functions). | 51 // ordinary functions). |
51 __ Ldr(cp, FieldMemOperand(x1, JSFunction::kContextOffset)); | 52 __ Ldr(cp, FieldMemOperand(x1, JSFunction::kContextOffset)); |
52 | 53 |
53 // Insert extra arguments. | 54 // Insert extra arguments. |
54 const int num_extra_args = 2; | 55 const int num_extra_args = 2; |
55 __ Push(x1, x3); | 56 __ Push(x1, x3); |
56 | 57 |
57 // JumpToExternalReference expects x0 to contain the number of arguments | 58 // JumpToExternalReference expects x0 to contain the number of arguments |
58 // including the receiver and the extra arguments. | 59 // including the receiver and the extra arguments. |
59 __ Add(x0, x0, num_extra_args + 1); | 60 __ Add(x0, x0, num_extra_args + 1); |
60 | 61 |
61 __ JumpToExternalReference(ExternalReference(id, masm->isolate())); | 62 __ JumpToExternalReference(ExternalReference(id, masm->isolate()), |
| 63 exit_frame_type == BUILTIN_EXIT); |
62 } | 64 } |
63 | 65 |
64 | 66 |
65 void Builtins::Generate_InternalArrayCode(MacroAssembler* masm) { | 67 void Builtins::Generate_InternalArrayCode(MacroAssembler* masm) { |
66 // ----------- S t a t e ------------- | 68 // ----------- S t a t e ------------- |
67 // -- x0 : number of arguments | 69 // -- x0 : number of arguments |
68 // -- lr : return address | 70 // -- lr : return address |
69 // -- sp[...]: constructor arguments | 71 // -- sp[...]: constructor arguments |
70 // ----------------------------------- | 72 // ----------------------------------- |
71 ASM_LOCATION("Builtins::Generate_InternalArrayCode"); | 73 ASM_LOCATION("Builtins::Generate_InternalArrayCode"); |
(...skipping 2927 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2999 } | 3001 } |
3000 } | 3002 } |
3001 | 3003 |
3002 | 3004 |
3003 #undef __ | 3005 #undef __ |
3004 | 3006 |
3005 } // namespace internal | 3007 } // namespace internal |
3006 } // namespace v8 | 3008 } // namespace v8 |
3007 | 3009 |
3008 #endif // V8_TARGET_ARCH_ARM | 3010 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |