Commit f1d49ca3 authored by danno's avatar danno Committed by Commit bot

[turbofan] Ensure that JS -> WASM calls align the csp on arm64

This is done by ensuring that the Arm64ClaimCSP instruction calls
AlignAndSetCSPForFrame when it's generated when the StackPointer() is set to
jssp.

LOG=N

Review URL: https://codereview.chromium.org/1746053002

Cr-Commit-Position: refs/heads/master@{#34365}
parent b00386f9
......@@ -933,8 +933,12 @@ void CodeGenerator::AssembleArchInstruction(Instruction* instr) {
case kArm64ClaimCSP: {
int count = i.InputInt32(0);
Register prev = __ StackPointer();
__ SetStackPointer(csp);
__ Claim(count);
if (prev.Is(jssp)) {
__ AlignAndSetCSPForFrame();
}
if (count > 0) {
__ Claim(count);
}
__ SetStackPointer(prev);
frame_access_state()->IncreaseSPDelta(count);
break;
......
......@@ -1643,7 +1643,7 @@ void InstructionSelector::EmitPrepareArguments(
}
// TODO(titzer): claim and poke probably take small immediates.
// Bump the stack pointer(s).
if (claim_count > 0) {
if (claim_count > 0 || to_native_stack) {
// 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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment