Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1147)

Side by Side Diff: src/x87/builtins-x87.cc

Issue 1551473002: [builtins] Fix context for ConstructStub calls into C++. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: REBASE Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/x64/builtins-x64.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « src/x64/builtins-x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698