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