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

Side by Side Diff: src/arm/builtins-arm.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 | « no previous file | src/arm64/builtins-arm64.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_ARM 5 #if V8_TARGET_ARCH_ARM
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 13 matching lines...) Expand all
24 // -- r0 : number of arguments excluding receiver 24 // -- r0 : number of arguments excluding receiver
25 // -- r1 : target 25 // -- r1 : target
26 // -- r3 : new.target 26 // -- r3 : new.target
27 // -- sp[0] : last argument 27 // -- sp[0] : last argument
28 // -- ... 28 // -- ...
29 // -- sp[4 * (argc - 1)] : first argument 29 // -- sp[4 * (argc - 1)] : first argument
30 // -- sp[4 * argc] : receiver 30 // -- sp[4 * argc] : receiver
31 // ----------------------------------- 31 // -----------------------------------
32 __ AssertFunction(r1); 32 __ AssertFunction(r1);
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 __ ldr(cp, FieldMemOperand(r1, JSFunction::kContextOffset));
39
34 // Insert extra arguments. 40 // Insert extra arguments.
35 int num_extra_args = 0; 41 int num_extra_args = 0;
36 switch (extra_args) { 42 switch (extra_args) {
37 case BuiltinExtraArguments::kTarget: 43 case BuiltinExtraArguments::kTarget:
38 __ Push(r1); 44 __ Push(r1);
39 ++num_extra_args; 45 ++num_extra_args;
40 break; 46 break;
41 case BuiltinExtraArguments::kNewTarget: 47 case BuiltinExtraArguments::kNewTarget:
42 __ Push(r3); 48 __ Push(r3);
43 ++num_extra_args; 49 ++num_extra_args;
(...skipping 2268 matching lines...) Expand 10 before | Expand all | Expand 10 after
2312 } 2318 }
2313 } 2319 }
2314 2320
2315 2321
2316 #undef __ 2322 #undef __
2317 2323
2318 } // namespace internal 2324 } // namespace internal
2319 } // namespace v8 2325 } // namespace v8
2320 2326
2321 #endif // V8_TARGET_ARCH_ARM 2327 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « no previous file | src/arm64/builtins-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698