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

Side by Side Diff: src/ia32/builtins-ia32.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, 12 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/builtins.cc ('k') | src/mips/builtins-mips.cc » ('j') | 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_IA32 5 #if V8_TARGET_ARCH_IA32
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 2321 matching lines...) Expand 10 before | Expand all | Expand 10 after
2366 2372
2367 __ bind(&ok); 2373 __ bind(&ok);
2368 __ ret(0); 2374 __ ret(0);
2369 } 2375 }
2370 2376
2371 #undef __ 2377 #undef __
2372 } // namespace internal 2378 } // namespace internal
2373 } // namespace v8 2379 } // namespace v8
2374 2380
2375 #endif // V8_TARGET_ARCH_IA32 2381 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/builtins.cc ('k') | src/mips/builtins-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698