Index: src/compiler/instruction-selector.cc |
diff --git a/src/compiler/instruction-selector.cc b/src/compiler/instruction-selector.cc |
index 41c44eea750ed30e6bcb6a9ba07889a8723d51db..32ffc634e01efcb20cec6338e5ef9241bb8b400f 100644 |
--- a/src/compiler/instruction-selector.cc |
+++ b/src/compiler/instruction-selector.cc |
@@ -1416,6 +1416,13 @@ void InstructionSelector::VisitCall(Node* node, BasicBlock* handler) { |
buffer.instruction_args.push_back(g.Label(handler)); |
} |
+ // (arm64 only) caller uses JSSP but callee might destroy it. |
+ if (descriptor->UseNativeStack() && |
+ !linkage()->GetIncomingDescriptor()->UseNativeStack()) { |
+ flags |= CallDescriptor::kRestoreJSSP; |
+ } |
+ |
+ |
// Select the appropriate opcode based on the call type. |
InstructionCode opcode = kArchNop; |
switch (descriptor->kind()) { |