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

Unified Diff: src/x64/lithium-codegen-x64.cc

Issue 12613004: To fully support hydrogen code stubs which accept a variable number of arguments, (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: The start environment for a hydrogen stub is initialized twice (fixed). Created 7 years, 9 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/lithium-codegen-x64.h ('k') | src/x64/lithium-x64.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/x64/lithium-codegen-x64.cc
diff --git a/src/x64/lithium-codegen-x64.cc b/src/x64/lithium-codegen-x64.cc
index 5eb15b725bfd9a15ba11afa60e1c7a018317851f..5d06c60bebf10999bfd304b70b8d495c8b239aa9 100644
--- a/src/x64/lithium-codegen-x64.cc
+++ b/src/x64/lithium-codegen-x64.cc
@@ -2558,10 +2558,16 @@ void LCodeGen::DoReturn(LReturn* instr) {
__ movq(rsp, rbp);
__ pop(rbp);
}
- if (info()->IsStub()) {
- __ Ret(0, r10);
+ if (instr->has_constant_parameter_count()) {
+ __ Ret((ToInteger32(instr->constant_parameter_count()) + 1) * kPointerSize,
+ rcx);
} else {
- __ Ret((GetParameterCount() + 1) * kPointerSize, rcx);
+ Register reg = ToRegister(instr->parameter_count());
+ Register return_addr_reg = reg.is(rcx) ? rbx : rcx;
+ __ pop(return_addr_reg);
+ __ shl(reg, Immediate(kPointerSizeLog2));
+ __ addq(rsp, reg);
+ __ jmp(return_addr_reg);
}
}
« no previous file with comments | « src/x64/lithium-codegen-x64.h ('k') | src/x64/lithium-x64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698