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" |
(...skipping 13 matching lines...) Expand all Loading... |
24 // -- r0 : number of arguments excluding receiver | 24 // -- r0 : number of arguments excluding receiver |
25 // -- r1 : target | 25 // -- r1 : target |
26 // -- r3 : new.target | 26 // -- r3 : new.target |
27 // -- sp[0] : last argument | 27 // -- sp[0] : last argument |
28 // -- ... | 28 // -- ... |
29 // -- sp[4 * (argc - 1)] : first argument | 29 // -- sp[4 * (argc - 1)] : first argument |
30 // -- sp[4 * argc] : receiver | 30 // -- sp[4 * argc] : receiver |
31 // ----------------------------------- | 31 // ----------------------------------- |
32 __ AssertFunction(r1); | 32 __ AssertFunction(r1); |
33 | 33 |
| 34 // Make sure we operate in the context of the called function (for example |
| 35 // ConstructStubs implemented in C++ will be run in the context of the caller |
| 36 // instead of the callee, due to the way that [[Construct]] is defined for |
| 37 // ordinary functions). |
| 38 __ ldr(cp, FieldMemOperand(r1, JSFunction::kContextOffset)); |
| 39 |
34 // Insert extra arguments. | 40 // Insert extra arguments. |
35 int num_extra_args = 0; | 41 int num_extra_args = 0; |
36 switch (extra_args) { | 42 switch (extra_args) { |
37 case BuiltinExtraArguments::kTarget: | 43 case BuiltinExtraArguments::kTarget: |
38 __ Push(r1); | 44 __ Push(r1); |
39 ++num_extra_args; | 45 ++num_extra_args; |
40 break; | 46 break; |
41 case BuiltinExtraArguments::kNewTarget: | 47 case BuiltinExtraArguments::kNewTarget: |
42 __ Push(r3); | 48 __ Push(r3); |
43 ++num_extra_args; | 49 ++num_extra_args; |
(...skipping 2268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2312 } | 2318 } |
2313 } | 2319 } |
2314 | 2320 |
2315 | 2321 |
2316 #undef __ | 2322 #undef __ |
2317 | 2323 |
2318 } // namespace internal | 2324 } // namespace internal |
2319 } // namespace v8 | 2325 } // namespace v8 |
2320 | 2326 |
2321 #endif // V8_TARGET_ARCH_ARM | 2327 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |