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

Side by Side Diff: src/mips/builtins-mips.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/ia32/builtins-ia32.cc ('k') | src/mips64/builtins-mips64.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_MIPS 5 #if V8_TARGET_ARCH_MIPS
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 14 matching lines...) Expand all
25 // -- a0 : number of arguments excluding receiver 25 // -- a0 : number of arguments excluding receiver
26 // -- a1 : target 26 // -- a1 : target
27 // -- a3 : new.target 27 // -- a3 : new.target
28 // -- sp[0] : last argument 28 // -- sp[0] : last argument
29 // -- ... 29 // -- ...
30 // -- sp[4 * (argc - 1)] : first argument 30 // -- sp[4 * (argc - 1)] : first argument
31 // -- sp[4 * agrc] : receiver 31 // -- sp[4 * agrc] : receiver
32 // ----------------------------------- 32 // -----------------------------------
33 __ AssertFunction(a1); 33 __ AssertFunction(a1);
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 __ lw(cp, FieldMemOperand(a1, JSFunction::kContextOffset));
40
35 // Insert extra arguments. 41 // Insert extra arguments.
36 int num_extra_args = 0; 42 int num_extra_args = 0;
37 switch (extra_args) { 43 switch (extra_args) {
38 case BuiltinExtraArguments::kTarget: 44 case BuiltinExtraArguments::kTarget:
39 __ Push(a1); 45 __ Push(a1);
40 ++num_extra_args; 46 ++num_extra_args;
41 break; 47 break;
42 case BuiltinExtraArguments::kNewTarget: 48 case BuiltinExtraArguments::kNewTarget:
43 __ Push(a3); 49 __ Push(a3);
44 ++num_extra_args; 50 ++num_extra_args;
(...skipping 2372 matching lines...) Expand 10 before | Expand all | Expand 10 after
2417 } 2423 }
2418 } 2424 }
2419 2425
2420 2426
2421 #undef __ 2427 #undef __
2422 2428
2423 } // namespace internal 2429 } // namespace internal
2424 } // namespace v8 2430 } // namespace v8
2425 2431
2426 #endif // V8_TARGET_ARCH_MIPS 2432 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/ia32/builtins-ia32.cc ('k') | src/mips64/builtins-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698