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

Unified Diff: src/crankshaft/arm64/lithium-arm64.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/arm/lithium-arm.cc ('k') | src/crankshaft/arm64/lithium-codegen-arm64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/crankshaft/arm64/lithium-arm64.cc
diff --git a/src/crankshaft/arm64/lithium-arm64.cc b/src/crankshaft/arm64/lithium-arm64.cc
index c12fab833ae7e8f9a3cb640a35a128d74b9c479a..8a9ce4266dd3872cfe82f590ec4889f50c59818e 100644
--- a/src/crankshaft/arm64/lithium-arm64.cc
+++ b/src/crankshaft/arm64/lithium-arm64.cc
@@ -963,6 +963,9 @@ LInstruction* LChunkBuilder::DoBranch(HBranch* 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());
@@ -971,15 +974,30 @@ LInstruction* LChunkBuilder::DoCallWithDescriptor(
// Context
LOperand* op = UseFixed(instr->OperandAt(1), cp);
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.
+ if (i < descriptor.GetParameterCount()) {
+ int argc = descriptor.GetParameterCount() - i;
+ AddInstruction(new (zone()) LPreparePushArguments(argc), instr);
+ LPushArguments* push_args = new (zone()) LPushArguments(zone());
+ for (; i < descriptor.GetParameterCount(); i++) {
+ if (push_args->ShouldSplitPush()) {
+ AddInstruction(push_args, instr);
+ push_args = new (zone()) LPushArguments(zone());
+ }
+ op = UseRegisterAtStart(instr->OperandAt(
+ i + LCallWithDescriptor::kImplicitRegisterParameterCount));
+ push_args->AddArgument(op);
+ }
+ AddInstruction(push_args, instr);
+ }
LCallWithDescriptor* result = new(zone()) LCallWithDescriptor(descriptor,
ops,
« no previous file with comments | « src/crankshaft/arm/lithium-arm.cc ('k') | src/crankshaft/arm64/lithium-codegen-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698