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

Unified Diff: src/x64/code-stubs-x64.cc

Issue 1237813002: Switch CallConstructStub to take new.target in register. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Addressed comments about ARM and MIPS. Created 5 years, 5 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/x64/builtins-x64.cc ('k') | src/x64/full-codegen-x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/x64/code-stubs-x64.cc
diff --git a/src/x64/code-stubs-x64.cc b/src/x64/code-stubs-x64.cc
index f467ea357f0bd554c7ba23578115ba050a959920..80ce630df14f46129e486d55b9be9d8d3e4d03ce 100644
--- a/src/x64/code-stubs-x64.cc
+++ b/src/x64/code-stubs-x64.cc
@@ -2029,19 +2029,25 @@ void CallFunctionStub::Generate(MacroAssembler* masm) {
void CallConstructStub::Generate(MacroAssembler* masm) {
// rax : number of arguments
// rbx : feedback vector
- // rdx : (only if rbx is not the megamorphic symbol) slot in feedback
- // vector (Smi)
+ // rcx : original constructor (for IsSuperConstructorCall)
+ // rdx : slot in feedback vector (Smi, for RecordCallTarget)
// rdi : constructor function
Label slow, non_function_call;
// Check that function is not a smi.
__ JumpIfSmi(rdi, &non_function_call);
// Check that function is a JSFunction.
- __ CmpObjectType(rdi, JS_FUNCTION_TYPE, rcx);
+ __ CmpObjectType(rdi, JS_FUNCTION_TYPE, r11);
__ j(not_equal, &slow);
if (RecordCallTarget()) {
+ if (IsSuperConstructorCall()) {
+ __ Push(rcx);
+ }
GenerateRecordCallTarget(masm);
+ if (IsSuperConstructorCall()) {
+ __ Pop(rcx);
+ }
__ SmiToInteger32(rdx, rdx);
if (FLAG_pretenuring_call_new) {
@@ -2066,7 +2072,7 @@ void CallConstructStub::Generate(MacroAssembler* masm) {
// Pass original constructor to construct stub.
if (IsSuperConstructorCall()) {
- __ movp(rdx, Operand(rsp, rax, times_pointer_size, 2 * kPointerSize));
+ __ movp(rdx, rcx);
} else {
__ movp(rdx, rdi);
}
@@ -2081,10 +2087,10 @@ void CallConstructStub::Generate(MacroAssembler* masm) {
// rdi: called object
// rax: number of arguments
- // rcx: object map
+ // r11: object map
Label do_call;
__ bind(&slow);
- __ CmpInstanceType(rcx, JS_FUNCTION_PROXY_TYPE);
+ __ CmpInstanceType(r11, JS_FUNCTION_PROXY_TYPE);
__ j(not_equal, &non_function_call);
__ GetBuiltinEntry(rdx, Builtins::CALL_FUNCTION_PROXY_AS_CONSTRUCTOR);
__ jmp(&do_call);
« no previous file with comments | « src/x64/builtins-x64.cc ('k') | src/x64/full-codegen-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698