Commit aa5eb1e0 authored by paul.lind's avatar paul.lind Committed by Commit bot

MIPS: Fix [runtime] [proxy] implement [[Construct]].

Avoid overwrite of instance type while checking IsCallable() (t2->t3).
Also slightly optimize push of register pair.

TEST=mjsunit/harmony/proxies-construct
BUG=

Review URL: https://codereview.chromium.org/1510493011

Cr-Commit-Position: refs/heads/master@{#32736}
parent 66f934ef
......@@ -1762,8 +1762,7 @@ void Builtins::Generate_ConstructProxy(MacroAssembler* masm) {
// -----------------------------------
// Call into the Runtime for Proxy [[Construct]].
__ Push(a1);
__ Push(a3);
__ Push(a1, a3);
// Include the pushed new_target, constructor and the receiver.
__ Addu(a0, a0, Operand(3));
// Tail-call to the runtime.
......@@ -1792,9 +1791,9 @@ void Builtins::Generate_Construct(MacroAssembler* masm) {
RelocInfo::CODE_TARGET, eq, t2, Operand(JS_FUNCTION_TYPE));
// Check if target has a [[Construct]] internal method.
__ lbu(t2, FieldMemOperand(t1, Map::kBitFieldOffset));
__ And(t2, t2, Operand(1 << Map::kIsCallable));
__ Branch(&non_constructor, eq, t2, Operand(zero_reg));
__ lbu(t3, FieldMemOperand(t1, Map::kBitFieldOffset));
__ And(t3, t3, Operand(1 << Map::kIsCallable));
__ Branch(&non_constructor, eq, t3, Operand(zero_reg));
// Only dispatch to proxies after checking whether they are constructors.
__ Jump(masm->isolate()->builtins()->ConstructProxy(), RelocInfo::CODE_TARGET,
......
......@@ -1753,8 +1753,7 @@ void Builtins::Generate_ConstructProxy(MacroAssembler* masm) {
// -----------------------------------
// Call into the Runtime for Proxy [[Construct]].
__ Push(a1);
__ Push(a3);
__ Push(a1, a3);
// Include the pushed new_target, constructor and the receiver.
__ Daddu(a0, a0, Operand(3));
// Tail-call to the runtime.
......@@ -1783,9 +1782,9 @@ void Builtins::Generate_Construct(MacroAssembler* masm) {
RelocInfo::CODE_TARGET, eq, t2, Operand(JS_FUNCTION_TYPE));
// Check if target has a [[Construct]] internal method.
__ lbu(t2, FieldMemOperand(t1, Map::kBitFieldOffset));
__ And(t2, t2, Operand(1 << Map::kIsCallable));
__ Branch(&non_constructor, eq, t2, Operand(zero_reg));
__ lbu(t3, FieldMemOperand(t1, Map::kBitFieldOffset));
__ And(t3, t3, Operand(1 << Map::kIsCallable));
__ Branch(&non_constructor, eq, t3, Operand(zero_reg));
// Only dispatch to proxies after checking whether they are constructors.
__ Jump(masm->isolate()->builtins()->ConstructProxy(), RelocInfo::CODE_TARGET,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment