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

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

Issue 2353303002: [crankshaft] HCallWithDescriptor is now able to pass arguments on the stack. (Closed)
Patch Set: arm64 fix Created 4 years, 3 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/crankshaft/s390/lithium-s390.cc ('k') | src/crankshaft/x87/lithium-x87.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/crankshaft/x64/lithium-x64.cc
diff --git a/src/crankshaft/x64/lithium-x64.cc b/src/crankshaft/x64/lithium-x64.cc
index 06b5052a62965023390bf340532a39cad3574b01..18fb5d4d09b42e03663b627e247c1e2bb913ca1d 100644
--- a/src/crankshaft/x64/lithium-x64.cc
+++ b/src/crankshaft/x64/lithium-x64.cc
@@ -1024,6 +1024,9 @@ LInstruction* LChunkBuilder::DoDeclareGlobals(HDeclareGlobals* instr) {
LInstruction* LChunkBuilder::DoCallWithDescriptor(
HCallWithDescriptor* instr) {
CallInterfaceDescriptor descriptor = instr->descriptor();
+ DCHECK_EQ(descriptor.GetParameterCount() +
+ LCallWithDescriptor::kImplicitRegisterParameterCount,
+ instr->OperandCount());
LOperand* target = UseRegisterOrConstantAtStart(instr->target());
ZoneList<LOperand*> ops(instr->OperandCount(), zone());
@@ -1032,15 +1035,20 @@ LInstruction* LChunkBuilder::DoCallWithDescriptor(
// Context
LOperand* op = UseFixed(instr->OperandAt(1), rsi);
ops.Add(op, zone());
- // Other register parameters
- for (int i = LCallWithDescriptor::kImplicitRegisterParameterCount;
- i < instr->OperandCount(); i++) {
- op =
- UseFixed(instr->OperandAt(i),
- descriptor.GetRegisterParameter(
- i - LCallWithDescriptor::kImplicitRegisterParameterCount));
+ // Load register parameters.
+ int i = 0;
+ for (; i < descriptor.GetRegisterParameterCount(); i++) {
+ op = UseFixed(instr->OperandAt(
+ i + LCallWithDescriptor::kImplicitRegisterParameterCount),
+ descriptor.GetRegisterParameter(i));
ops.Add(op, zone());
}
+ // Push stack parameters.
+ for (; i < descriptor.GetParameterCount(); i++) {
+ op = UseAny(instr->OperandAt(
+ i + LCallWithDescriptor::kImplicitRegisterParameterCount));
+ AddInstruction(new (zone()) LPushArgument(op), instr);
+ }
LCallWithDescriptor* result = new(zone()) LCallWithDescriptor(
descriptor, ops, zone());
« no previous file with comments | « src/crankshaft/s390/lithium-s390.cc ('k') | src/crankshaft/x87/lithium-x87.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698