Index: src/mips/code-stubs-mips.cc |
diff --git a/src/mips/code-stubs-mips.cc b/src/mips/code-stubs-mips.cc |
index bdb382369cde18798ce8f5317cf80701c70378a7..40d77dc199a3f989c5492d82e76be9378621b25a 100644 |
--- a/src/mips/code-stubs-mips.cc |
+++ b/src/mips/code-stubs-mips.cc |
@@ -2599,13 +2599,13 @@ void CallConstructStub::Generate(MacroAssembler* masm) { |
// a2 : feedback vector |
// a3 : slot in feedback vector (Smi, for RecordCallTarget) |
// t0 : original constructor (for IsSuperConstructorCall) |
- Label slow, non_function_call; |
+ Label non_function; |
// Check that the function is not a smi. |
- __ JumpIfSmi(a1, &non_function_call); |
+ __ JumpIfSmi(a1, &non_function); |
// Check that the function is a JSFunction. |
__ GetObjectType(a1, t1, t1); |
- __ Branch(&slow, ne, t1, Operand(JS_FUNCTION_TYPE)); |
+ __ Branch(&non_function, ne, t1, Operand(JS_FUNCTION_TYPE)); |
if (RecordCallTarget()) { |
GenerateRecordCallTarget(masm, IsSuperConstructorCall()); |
@@ -2631,40 +2631,16 @@ void CallConstructStub::Generate(MacroAssembler* masm) { |
__ mov(a3, a1); |
} |
- // Jump to the function-specific construct stub. |
- Register jmp_reg = t0; |
- __ lw(jmp_reg, FieldMemOperand(a1, JSFunction::kSharedFunctionInfoOffset)); |
- __ lw(jmp_reg, FieldMemOperand(jmp_reg, |
- SharedFunctionInfo::kConstructStubOffset)); |
- __ Addu(at, jmp_reg, Operand(Code::kHeaderSize - kHeapObjectTag)); |
+ // Tail call to the function-specific construct stub (still in the caller |
+ // context at this point). |
+ __ lw(t0, FieldMemOperand(a1, JSFunction::kSharedFunctionInfoOffset)); |
+ __ lw(t0, FieldMemOperand(t0, SharedFunctionInfo::kConstructStubOffset)); |
+ __ Addu(at, t0, Operand(Code::kHeaderSize - kHeapObjectTag)); |
__ Jump(at); |
- // a0: number of arguments |
- // a1: called object |
- // t1: object type |
- __ bind(&slow); |
- { |
- __ Branch(&non_function_call, ne, t1, Operand(JS_FUNCTION_PROXY_TYPE)); |
- // TODO(neis): This doesn't match the ES6 spec for [[Construct]] on proxies. |
- __ lw(a1, FieldMemOperand(a1, JSFunctionProxy::kConstructTrapOffset)); |
- __ Jump(isolate()->builtins()->Call(), RelocInfo::CODE_TARGET); |
- |
- __ bind(&non_function_call); |
- { |
- // Determine the delegate for the target (if any). |
- FrameScope scope(masm, StackFrame::INTERNAL); |
- __ SmiTag(a0); |
- __ Push(a0, a1); |
- __ CallRuntime(Runtime::kGetConstructorDelegate, 1); |
- __ mov(a1, v0); |
- __ Pop(a0); |
- __ SmiUntag(a0); |
- } |
- // The delegate is always a regular function. |
- __ AssertFunction(a1); |
- __ Jump(masm->isolate()->builtins()->CallFunction(), |
- RelocInfo::CODE_TARGET); |
- } |
+ __ bind(&non_function); |
+ __ mov(a3, a1); |
+ __ Jump(isolate()->builtins()->Construct(), RelocInfo::CODE_TARGET); |
} |