OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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_PPC | 5 #if V8_TARGET_ARCH_PPC |
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 12 matching lines...) Expand all Loading... |
23 // -- r3 : number of arguments excluding receiver | 23 // -- r3 : number of arguments excluding receiver |
24 // -- r4 : target | 24 // -- r4 : target |
25 // -- r6 : new.target | 25 // -- r6 : new.target |
26 // -- sp[0] : last argument | 26 // -- sp[0] : last argument |
27 // -- ... | 27 // -- ... |
28 // -- sp[4 * (argc - 1)] : first argument | 28 // -- sp[4 * (argc - 1)] : first argument |
29 // -- sp[4 * argc] : receiver | 29 // -- sp[4 * argc] : receiver |
30 // ----------------------------------- | 30 // ----------------------------------- |
31 __ AssertFunction(r4); | 31 __ AssertFunction(r4); |
32 | 32 |
| 33 // Make sure we operate in the context of the called function (for example |
| 34 // ConstructStubs implemented in C++ will be run in the context of the caller |
| 35 // instead of the callee, due to the way that [[Construct]] is defined for |
| 36 // ordinary functions). |
| 37 __ LoadP(cp, FieldMemOperand(r4, JSFunction::kContextOffset)); |
| 38 |
33 // Insert extra arguments. | 39 // Insert extra arguments. |
34 int num_extra_args = 0; | 40 int num_extra_args = 0; |
35 switch (extra_args) { | 41 switch (extra_args) { |
36 case BuiltinExtraArguments::kTarget: | 42 case BuiltinExtraArguments::kTarget: |
37 __ Push(r4); | 43 __ Push(r4); |
38 ++num_extra_args; | 44 ++num_extra_args; |
39 break; | 45 break; |
40 case BuiltinExtraArguments::kNewTarget: | 46 case BuiltinExtraArguments::kNewTarget: |
41 __ Push(r6); | 47 __ Push(r6); |
42 ++num_extra_args; | 48 ++num_extra_args; |
(...skipping 2180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2223 __ bkpt(0); | 2229 __ bkpt(0); |
2224 } | 2230 } |
2225 } | 2231 } |
2226 | 2232 |
2227 | 2233 |
2228 #undef __ | 2234 #undef __ |
2229 } // namespace internal | 2235 } // namespace internal |
2230 } // namespace v8 | 2236 } // namespace v8 |
2231 | 2237 |
2232 #endif // V8_TARGET_ARCH_PPC | 2238 #endif // V8_TARGET_ARCH_PPC |
OLD | NEW |