Chromium Code Reviews| Index: runtime/vm/assembler_arm64.cc |
| diff --git a/runtime/vm/assembler_arm64.cc b/runtime/vm/assembler_arm64.cc |
| index eeb831dd8626554376e47563eba28c48b646229d..918524c338efe994abcf57278a4dde050c7cfab2 100644 |
| --- a/runtime/vm/assembler_arm64.cc |
| +++ b/runtime/vm/assembler_arm64.cc |
| @@ -1126,7 +1126,30 @@ void Assembler::CheckCodePointer() { |
| } |
| +void Assembler::SetupDartSP() { |
| + mov(SP, CSP); |
| +} |
| + |
| + |
| +void Assembler::RestoreCSP() { |
| + mov(CSP, SP); |
| +} |
| + |
| + |
| void Assembler::EnterFrame(intptr_t frame_size) { |
| + // The ARM64 ABI requires at all times |
| + // - stack limit < CSP <= stack base |
| + // - CSP mod 16 = 0 |
| + // - we do not access stack memory below CSP |
| + // Pratically, this means we need to keep the C stack pointer ahead of the |
| + // Dart stack pointer and 16-byte aligned for signal handlers. If we knew the |
| + // real stack limit, we could just set CSP to a value near it during |
| + // SetupDartSP, but we do not know the real stack limit for the initial |
| + // thread or threads created by the embedder. |
| + const intptr_t kMaxDartFrameSize = 256; |
|
rmacnak
2016/05/27 04:44:51
Not sure where in the compiler to check this isn't
Vyacheslav Egorov (Google)
2016/05/27 15:34:52
It's not that easy.
FlowGraphCompiler::StackSize
|
| + sub(TMP, SP, Operand(kMaxDartFrameSize)); |
| + andi(CSP, TMP, Immediate(~15)); |
| + |
| PushPair(LR, FP); |
| mov(FP, SP); |