Index: src/compiler/arm64/code-generator-arm64.cc |
diff --git a/src/compiler/arm64/code-generator-arm64.cc b/src/compiler/arm64/code-generator-arm64.cc |
index e45c677619393662a606fe0ff31b5da7a75a793d..5eb57c129ea91172fda28d4ff3a4ce94025d1cb0 100644 |
--- a/src/compiler/arm64/code-generator-arm64.cc |
+++ b/src/compiler/arm64/code-generator-arm64.cc |
@@ -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; |