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

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

Issue 1416943005: Revert of [es6] Better support for built-ins subclassing. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/runtime/runtime-typedarray.cc ('k') | test/mjsunit/es6/classes-subclass-builtins.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/x64/builtins-x64.cc
diff --git a/src/x64/builtins-x64.cc b/src/x64/builtins-x64.cc
index ec45c3a0c6717a23cf580e29ae45ffd73e5e1f25..4e26be9c90844f873dd39c7af3574e4b593c5537 100644
--- a/src/x64/builtins-x64.cc
+++ b/src/x64/builtins-x64.cc
@@ -277,8 +277,8 @@
// Must restore rsi (context) and rdi (constructor) before calling runtime.
__ movp(rsi, Operand(rbp, StandardFrameConstants::kContextOffset));
__ movp(rdi, Operand(rsp, offset));
- __ Push(rdi); // constructor function
- __ Push(rdx); // original constructor
+ __ Push(rdi); // argument 2/1: constructor function
+ __ Push(rdx); // argument 3/2: original constructor
__ CallRuntime(Runtime::kNewObject, 2);
__ movp(rbx, rax); // store result in rbx
@@ -1421,7 +1421,6 @@
// ----------- S t a t e -------------
// -- rax : number of arguments
// -- rdi : constructor function
- // -- rdx : original constructor
// -- rsp[0] : return address
// -- rsp[(argc - n) * 8] : arg[n] (zero-based)
// -- rsp[(argc + 1) * 8] : receiver
@@ -1448,19 +1447,17 @@
{
Label convert, done_convert;
__ JumpIfSmi(rbx, &convert, Label::kNear);
- __ CmpObjectType(rbx, FIRST_NONSTRING_TYPE, rcx);
+ __ CmpObjectType(rbx, FIRST_NONSTRING_TYPE, rdx);
__ j(below, &done_convert);
__ bind(&convert);
{
FrameScope scope(masm, StackFrame::INTERNAL);
ToStringStub stub(masm->isolate());
- __ Push(rdx);
__ Push(rdi);
__ Move(rax, rbx);
__ CallStub(&stub);
__ Move(rbx, rax);
__ Pop(rdi);
- __ Pop(rdx);
}
__ bind(&done_convert);
}
@@ -1470,14 +1467,9 @@
// ----------- S t a t e -------------
// -- rbx : the first argument
// -- rdi : constructor function
- // -- rdx : original constructor
// -----------------------------------
- Label allocate, done_allocate, rt_call;
-
- // Fall back to runtime if the original constructor and constructor differ.
- __ cmpp(rdx, rdi);
- __ j(not_equal, &rt_call);
-
+
+ Label allocate, done_allocate;
__ Allocate(JSValue::kSize, rax, rcx, no_reg, &allocate, TAG_OBJECT);
__ bind(&done_allocate);
@@ -1503,21 +1495,6 @@
__ Pop(rbx);
}
__ jmp(&done_allocate);
-
- // Fallback to the runtime to create new object.
- __ bind(&rt_call);
- {
- FrameScope scope(masm, StackFrame::INTERNAL);
- __ Push(rbx);
- __ Push(rdi);
- __ Push(rdi); // constructor function
- __ Push(rdx); // original constructor
- __ CallRuntime(Runtime::kNewObject, 2);
- __ Pop(rdi);
- __ Pop(rbx);
- }
- __ movp(FieldOperand(rax, JSValue::kValueOffset), rbx);
- __ Ret();
}
}
« no previous file with comments | « src/runtime/runtime-typedarray.cc ('k') | test/mjsunit/es6/classes-subclass-builtins.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698