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

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

Issue 803933008: new classes: change semantics of super(...) call and add new.target to construct stub. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Comment Created 5 years, 11 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
Index: src/x64/builtins-x64.cc
diff --git a/src/x64/builtins-x64.cc b/src/x64/builtins-x64.cc
index ef3df659eb7a94d9801d4687f311000a02f9af40..1cb7cbf3f491215128554f8601cd40adbff1c668 100644
--- a/src/x64/builtins-x64.cc
+++ b/src/x64/builtins-x64.cc
@@ -106,6 +106,7 @@ static void Generate_JSConstructStubHelper(MacroAssembler* masm,
// -- rax: number of arguments
// -- rdi: constructor function
// -- rbx: allocation site or undefined
+ // -- r11: original constructor
// -----------------------------------
// Should never create mementos for api functions.
@@ -127,9 +128,13 @@ static void Generate_JSConstructStubHelper(MacroAssembler* masm,
// Push the function to invoke on the stack.
__ Push(rdi);
+ Label rt_call;
+ __ cmpp(r11, rdi);
+ __ j(not_equal, &rt_call);
+
// Try to allocate the object without transitioning into C code. If any of
// the preconditions is not met, the code bails out to the runtime call.
- Label rt_call, allocated;
+ Label allocated;
if (FLAG_inline_new) {
Label undo_allocation;
@@ -357,10 +362,11 @@ static void Generate_JSConstructStubHelper(MacroAssembler* masm,
__ movp(rsi, Operand(rbp, StandardFrameConstants::kContextOffset));
__ movp(rdi, Operand(rsp, offset));
__ Push(rdi);
+ __ Push(r11);
if (create_memento) {
- __ CallRuntime(Runtime::kNewObjectWithAllocationSite, 2);
+ __ CallRuntime(Runtime::kNewObjectWithAllocationSite, 3);
} else {
- __ CallRuntime(Runtime::kNewObject, 1);
+ __ CallRuntime(Runtime::kNewObject, 2);
}
__ movp(rbx, rax); // store result in rbx

Powered by Google App Engine
This is Rietveld 408576698