Chromium Code Reviews

Unified Diff: src/mips64/code-stubs-mips64.cc

Issue 1237813002: Switch CallConstructStub to take new.target in register. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Ported to all architectures. Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Index: src/mips64/code-stubs-mips64.cc
diff --git a/src/mips64/code-stubs-mips64.cc b/src/mips64/code-stubs-mips64.cc
index 90a72ada64bb785e5f433e0ce9a82d608ceef496..c9eb0fbf2a36a89ea6b4985b89a7b22ee8770a7e 100644
--- a/src/mips64/code-stubs-mips64.cc
+++ b/src/mips64/code-stubs-mips64.cc
@@ -2780,7 +2780,8 @@ void CallConstructStub::Generate(MacroAssembler* masm) {
// a0 : number of arguments
// a1 : the function to call
// a2 : feedback vector
- // a3 : (only if a2 is not undefined) slot in feedback vector (Smi)
+ // a3 : slot in feedback vector (Smi, for RecordCallTarget)
+ // t0 : original constructor (for IsSuperConstructorCall)
paul.l... 2015/07/14 16:58:17 Please change t0 -> a4
Michael Starzinger 2015/07/15 07:36:36 Done.
Label slow, non_function_call;
// Check that the function is not a smi.
__ JumpIfSmi(a1, &non_function_call);
@@ -2789,7 +2790,13 @@ void CallConstructStub::Generate(MacroAssembler* masm) {
__ Branch(&slow, ne, a4, Operand(JS_FUNCTION_TYPE));
paul.l... 2015/07/14 16:58:18 Please change these 3 uses of a4 -> a5
Michael Starzinger 2015/07/15 07:36:36 Done.
if (RecordCallTarget()) {
+ if (IsSuperConstructorCall()) {
+ __ push(t0);
paul.l... 2015/07/14 16:58:17 Please use a4 here and in pop() below.
Michael Starzinger 2015/07/15 07:36:36 Done.
+ }
GenerateRecordCallTarget(masm);
+ if (IsSuperConstructorCall()) {
+ __ pop(t0);
+ }
__ dsrl(at, a3, 32 - kPointerSizeLog2);
__ Daddu(a5, a2, at);
@@ -2814,11 +2821,7 @@ void CallConstructStub::Generate(MacroAssembler* masm) {
// Pass function as original constructor.
if (IsSuperConstructorCall()) {
- __ li(a4, Operand(1 * kPointerSize));
- __ dsll(at, a0, kPointerSizeLog2);
- __ daddu(a4, a4, at);
- __ daddu(at, sp, a4);
- __ ld(a3, MemOperand(at, 0));
+ __ mov(a3, t0);
paul.l... 2015/07/14 16:58:18 t0 -> a4
Michael Starzinger 2015/07/15 07:36:36 Done.
} else {
__ mov(a3, a1);
}

Powered by Google App Engine