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

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

Issue 1603533002: [wasm] Add more thorough tests for WASM->JS and JS->WASM parameters. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: signedness Created 4 years, 11 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/instruction-scheduler-arm64.cc ('k') | src/compiler/instruction-selector.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 cb63cfae2a6891ec6030cb52b62cd5d5e49634ad..1db8a6b65d07e1c51e81993f1854542d2ebc294d 100644
--- a/src/compiler/arm64/instruction-selector-arm64.cc
+++ b/src/compiler/arm64/instruction-selector-arm64.cc
@@ -1593,30 +1593,27 @@ void InstructionSelector::EmitPrepareArguments(
Node* node) {
Arm64OperandGenerator g(this);
- // 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.
+ bool to_native_stack = descriptor->UseNativeStack();
+
+ 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 (aligned_push_count > 0) {
- // TODO(dcarney): it would be better to bump the csp here only
+ if (claim_count > 0) {
+ // TODO(titzer): 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(claim_count));
+ ArchOpcode claim = to_native_stack ? kArm64ClaimCSP : kArm64ClaimJSSP;
+ Emit(claim, g.NoOutput(), g.TempImmediate(claim_count));
}
- // Move arguments to the stack.
- int slot = aligned_push_count - 1;
+ // Poke the arguments into the stack.
+ ArchOpcode poke = to_native_stack ? kArm64PokeCSP : kArm64PokeJSSP;
while (slot >= 0) {
- Emit(kArm64Poke, g.NoOutput(), g.UseRegister((*arguments)[slot].node()),
+ Emit(poke, g.NoOutput(), g.UseRegister((*arguments)[slot].node()),
g.TempImmediate(slot));
slot--;
// TODO(ahaas): Poke arguments in pairs if two subsequent arguments have the
« no previous file with comments | « src/compiler/arm64/instruction-scheduler-arm64.cc ('k') | src/compiler/instruction-selector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698