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

Unified Diff: src/mips64/builtins-mips64.cc

Issue 1509603005: [runtime] [proxy] implement [[Construct]] (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@2015-12-03_JSProxy_Call_1499593003
Patch Set: use add instruction on ia32 + x87 Created 5 years 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 side-by-side diff with in-line comments
Download patch
Index: src/mips64/builtins-mips64.cc
diff --git a/src/mips64/builtins-mips64.cc b/src/mips64/builtins-mips64.cc
index 59b5e228d65c3475b31cfddc1065c5d32c24e250..98e9db1761691ac180b8769cf72bf8b3bcecebbf 100644
--- a/src/mips64/builtins-mips64.cc
+++ b/src/mips64/builtins-mips64.cc
@@ -1752,8 +1752,14 @@ void Builtins::Generate_ConstructProxy(MacroAssembler* masm) {
// the JSFunction on which new was invoked initially)
// -----------------------------------
- // TODO(neis): This doesn't match the ES6 spec for [[Construct]] on proxies.
- __ Jump(masm->isolate()->builtins()->Call(), RelocInfo::CODE_TARGET);
+ // Call into the Runtime for Proxy [[Construct]].
+ __ Push(a1);
+ __ Push(a3);
+ // Include the pushed new_target + constructor and the receiver on the stack.
+ __ Daddu(a0, a0, Operand(3));
+ // Tail-call to the runtime.
+ __ JumpToExternalReference(
+ ExternalReference(Runtime::kJSProxyConstruct, masm->isolate()));
}
@@ -1775,14 +1781,16 @@ void Builtins::Generate_Construct(MacroAssembler* masm) {
__ lbu(t2, FieldMemOperand(t1, Map::kInstanceTypeOffset));
__ Jump(masm->isolate()->builtins()->ConstructFunction(),
RelocInfo::CODE_TARGET, eq, t2, Operand(JS_FUNCTION_TYPE));
- __ Jump(masm->isolate()->builtins()->ConstructProxy(), RelocInfo::CODE_TARGET,
- eq, t2, Operand(JS_PROXY_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));
+ // Only dispatch to proxies after checking whether they are constructors.
+ __ Jump(masm->isolate()->builtins()->ConstructProxy(), RelocInfo::CODE_TARGET,
+ eq, t2, Operand(JS_PROXY_TYPE));
+
// Called Construct on an exotic Object with a [[Construct]] internal method.
{
// Overwrite the original receiver with the (original) target.

Powered by Google App Engine
This is Rietveld 408576698