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

Side by Side Diff: src/x64/builtins-x64.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/ppc/builtins-ppc.cc ('k') | src/x87/builtins-x87.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_X64 5 #if V8_TARGET_ARCH_X64
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 13 matching lines...) Expand all
24 // -- rdi : target 24 // -- rdi : target
25 // -- rdx : new.target 25 // -- rdx : new.target
26 // -- rsp[0] : return address 26 // -- rsp[0] : return address
27 // -- rsp[8] : last argument 27 // -- rsp[8] : last argument
28 // -- ... 28 // -- ...
29 // -- rsp[8 * argc] : first argument 29 // -- rsp[8 * argc] : first argument
30 // -- rsp[8 * (argc + 1)] : receiver 30 // -- rsp[8 * (argc + 1)] : receiver
31 // ----------------------------------- 31 // -----------------------------------
32 __ AssertFunction(rdi); 32 __ AssertFunction(rdi);
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 __ movp(rsi, FieldOperand(rdi, JSFunction::kContextOffset));
39
34 // Insert extra arguments. 40 // Insert extra arguments.
35 int num_extra_args = 0; 41 int num_extra_args = 0;
36 if (extra_args != BuiltinExtraArguments::kNone) { 42 if (extra_args != BuiltinExtraArguments::kNone) {
37 __ PopReturnAddressTo(kScratchRegister); 43 __ PopReturnAddressTo(kScratchRegister);
38 if (extra_args & BuiltinExtraArguments::kTarget) { 44 if (extra_args & BuiltinExtraArguments::kTarget) {
39 ++num_extra_args; 45 ++num_extra_args;
40 __ Push(rdi); 46 __ Push(rdi);
41 } 47 }
42 if (extra_args & BuiltinExtraArguments::kNewTarget) { 48 if (extra_args & BuiltinExtraArguments::kNewTarget) {
43 ++num_extra_args; 49 ++num_extra_args;
(...skipping 2401 matching lines...) Expand 10 before | Expand all | Expand 10 after
2445 __ ret(0); 2451 __ ret(0);
2446 } 2452 }
2447 2453
2448 2454
2449 #undef __ 2455 #undef __
2450 2456
2451 } // namespace internal 2457 } // namespace internal
2452 } // namespace v8 2458 } // namespace v8
2453 2459
2454 #endif // V8_TARGET_ARCH_X64 2460 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/ppc/builtins-ppc.cc ('k') | src/x87/builtins-x87.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698