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

Unified Diff: src/compiler/arm64/instruction-selector-arm64.cc

Issue 1494123002: [turbofan, arm64] Fix native stack parameters on arm64. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Minor changes according to comments. Created 5 years 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/compiler/arm64/code-generator-arm64.cc ('k') | src/compiler/linkage.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/arm64/instruction-selector-arm64.cc
diff --git a/src/compiler/arm64/instruction-selector-arm64.cc b/src/compiler/arm64/instruction-selector-arm64.cc
index 53899568ad045768accdbccc96139f90e66238bd..ce16050e1c3b210da19279aba93a6e80fb921753 100644
--- a/src/compiler/arm64/instruction-selector-arm64.cc
+++ b/src/compiler/arm64/instruction-selector-arm64.cc
@@ -1535,7 +1535,14 @@ void InstructionSelector::EmitPrepareArguments(NodeVector* arguments,
// Push the arguments to the stack.
int aligned_push_count = static_cast<int>(arguments->size());
+
bool pushed_count_uneven = aligned_push_count & 1;
+ int claim_count = aligned_push_count;
+ if (pushed_count_uneven && descriptor->UseNativeStack()) {
+ // We can only claim for an even number of call arguments when we use the
+ // native stack.
+ claim_count++;
+ }
// TODO(dcarney): claim and poke probably take small immediates,
// loop here or whatever.
// Bump the stack pointer(s).
@@ -1543,23 +1550,20 @@ void InstructionSelector::EmitPrepareArguments(NodeVector* arguments,
// TODO(dcarney): it would be better to bump the csp here only
// and emit paired stores with increment for non c frames.
Emit(kArm64ClaimForCallArguments, g.NoOutput(),
- g.TempImmediate(aligned_push_count));
+ g.TempImmediate(claim_count));
}
+
// Move arguments to the stack.
- {
- int slot = aligned_push_count - 1;
- // Emit the uneven pushes.
- if (pushed_count_uneven) {
- Node* input = (*arguments)[slot];
- Emit(kArm64Poke, g.NoOutput(), g.UseRegister(input),
- g.TempImmediate(slot));
- slot--;
- }
- // Now all pushes can be done in pairs.
- for (; slot >= 0; slot -= 2) {
- Emit(kArm64PokePair, g.NoOutput(), g.UseRegister((*arguments)[slot]),
- g.UseRegister((*arguments)[slot - 1]), g.TempImmediate(slot));
- }
+ int slot = aligned_push_count - 1;
+ while (slot >= 0) {
+ Emit(kArm64Poke, g.NoOutput(), g.UseRegister((*arguments)[slot]),
+ g.TempImmediate(slot));
+ slot--;
+ // TODO(ahaas): Poke arguments in pairs if two subsequent arguments have the
+ // same type.
+ // Emit(kArm64PokePair, g.NoOutput(), g.UseRegister((*arguments)[slot]),
+ // g.UseRegister((*arguments)[slot - 1]), g.TempImmediate(slot));
+ // slot -= 2;
}
}
« no previous file with comments | « src/compiler/arm64/code-generator-arm64.cc ('k') | src/compiler/linkage.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698