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_X87 | 5 #if V8_TARGET_ARCH_X87 |
6 | 6 |
7 #include "src/code-factory.h" | 7 #include "src/code-factory.h" |
8 #include "src/codegen.h" | 8 #include "src/codegen.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 14 matching lines...) Expand all Loading... |
25 // -- edi : target | 25 // -- edi : target |
26 // -- edx : new.target | 26 // -- edx : new.target |
27 // -- esp[0] : return address | 27 // -- esp[0] : return address |
28 // -- esp[4] : last argument | 28 // -- esp[4] : last argument |
29 // -- ... | 29 // -- ... |
30 // -- esp[4 * argc] : first argument | 30 // -- esp[4 * argc] : first argument |
31 // -- esp[4 * (argc +1)] : receiver | 31 // -- esp[4 * (argc +1)] : receiver |
32 // ----------------------------------- | 32 // ----------------------------------- |
33 __ AssertFunction(edi); | 33 __ AssertFunction(edi); |
34 | 34 |
| 35 // Make sure we operate in the context of the called function (for example |
| 36 // ConstructStubs implemented in C++ will be run in the context of the caller |
| 37 // instead of the callee, due to the way that [[Construct]] is defined for |
| 38 // ordinary functions). |
| 39 __ mov(esi, FieldOperand(edi, JSFunction::kContextOffset)); |
| 40 |
35 // Insert extra arguments. | 41 // Insert extra arguments. |
36 int num_extra_args = 0; | 42 int num_extra_args = 0; |
37 if (extra_args != BuiltinExtraArguments::kNone) { | 43 if (extra_args != BuiltinExtraArguments::kNone) { |
38 __ PopReturnAddressTo(ecx); | 44 __ PopReturnAddressTo(ecx); |
39 if (extra_args & BuiltinExtraArguments::kTarget) { | 45 if (extra_args & BuiltinExtraArguments::kTarget) { |
40 ++num_extra_args; | 46 ++num_extra_args; |
41 __ Push(edi); | 47 __ Push(edi); |
42 } | 48 } |
43 if (extra_args & BuiltinExtraArguments::kNewTarget) { | 49 if (extra_args & BuiltinExtraArguments::kNewTarget) { |
44 ++num_extra_args; | 50 ++num_extra_args; |
(...skipping 2328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2373 | 2379 |
2374 __ bind(&ok); | 2380 __ bind(&ok); |
2375 __ ret(0); | 2381 __ ret(0); |
2376 } | 2382 } |
2377 | 2383 |
2378 #undef __ | 2384 #undef __ |
2379 } // namespace internal | 2385 } // namespace internal |
2380 } // namespace v8 | 2386 } // namespace v8 |
2381 | 2387 |
2382 #endif // V8_TARGET_ARCH_X87 | 2388 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |