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

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

Issue 1811283003: [wasm] WIP fix arm64 frame alignment. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 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/compiler/arm64/code-generator-arm64.cc ('k') | src/compiler/c-linkage.cc » ('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 0f6128da9da739abb92b6af279d43ed2586b0f16..d5ec0d731a7835f70e49ed52fd8a077337ab348e 100644
--- a/src/compiler/arm64/instruction-selector-arm64.cc
+++ b/src/compiler/arm64/instruction-selector-arm64.cc
@@ -1631,20 +1631,20 @@ void InstructionSelector::EmitPrepareArguments(
Node* node) {
Arm64OperandGenerator g(this);
+ bool from_native_stack = linkage()->GetIncomingDescriptor()->UseNativeStack();
bool to_native_stack = descriptor->UseNativeStack();
+ bool always_claim = to_native_stack != from_native_stack;
+
int claim_count = static_cast<int>(arguments->size());
int slot = claim_count - 1;
- if (to_native_stack) {
- // Native stack must always be aligned to 16 (2 words).
- claim_count = RoundUp(claim_count, 2);
- }
- // TODO(titzer): claim and poke probably take small immediates.
// Bump the stack pointer(s).
- if (claim_count > 0 || to_native_stack) {
+ if (claim_count > 0 || always_claim) {
+ // TODO(titzer): claim and poke probably take small immediates.
// TODO(titzer): it would be better to bump the csp here only
// and emit paired stores with increment for non c frames.
ArchOpcode claim = to_native_stack ? kArm64ClaimCSP : kArm64ClaimJSSP;
+ // Claim(0) isn't a nop if there is a mismatch between CSP and JSSP.
Emit(claim, g.NoOutput(), g.TempImmediate(claim_count));
}
« no previous file with comments | « src/compiler/arm64/code-generator-arm64.cc ('k') | src/compiler/c-linkage.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698