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

Unified Diff: runtime/vm/runtime_entry_arm64.cc

Issue 2003403003: ARM/ARM64: Fix smashed CODE_REG in intrinsics with InvokeMathCFunctionInstrs. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 7 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 | « runtime/vm/intrinsifier_x64.cc ('k') | tests/lib/math/call_cmath_box_failure_path_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/runtime_entry_arm64.cc
diff --git a/runtime/vm/runtime_entry_arm64.cc b/runtime/vm/runtime_entry_arm64.cc
index f9cd8c2d1fdf444e6753bd0ee6c75f3a2f4133ae..f3e98bc6d6a652e2ec0fed0020797477482ef6d5 100644
--- a/runtime/vm/runtime_entry_arm64.cc
+++ b/runtime/vm/runtime_entry_arm64.cc
@@ -52,14 +52,20 @@ void RuntimeEntry::Call(Assembler* assembler, intptr_t argument_count) const {
// We cache the Dart stack pointer and the stack limit in callee-saved
// registers, then align and call, restoring CSP and SP on return from the
// call.
- __ mov(R24, CSP);
+ // This sequence may occur in an intrinsic, so don't use registers an
+ // intrinsic must preserve.
+ COMPILE_ASSERT(R23 != CODE_REG);
+ COMPILE_ASSERT(R25 != CODE_REG);
+ COMPILE_ASSERT(R23 != ARGS_DESC_REG);
+ COMPILE_ASSERT(R25 != ARGS_DESC_REG);
+ __ mov(R23, CSP);
__ mov(R25, SP);
__ ReserveAlignedFrameSpace(0);
__ mov(CSP, SP);
__ ldr(TMP, Address(THR, Thread::OffsetFromThread(this)));
__ blr(TMP);
__ mov(SP, R25);
- __ mov(CSP, R24);
+ __ mov(CSP, R23);
} else {
// Argument count is not checked here, but in the runtime entry for a more
// informative error message.
« no previous file with comments | « runtime/vm/intrinsifier_x64.cc ('k') | tests/lib/math/call_cmath_box_failure_path_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698