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

Unified Diff: runtime/vm/intrinsifier_x64.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
Index: runtime/vm/intrinsifier_x64.cc
diff --git a/runtime/vm/intrinsifier_x64.cc b/runtime/vm/intrinsifier_x64.cc
index 58f096d3fdb95f1ed0b3250a61e6f3517936c496..d859c5ab2fcae20358804dd039e1509cc22eaa52 100644
--- a/runtime/vm/intrinsifier_x64.cc
+++ b/runtime/vm/intrinsifier_x64.cc
@@ -33,14 +33,22 @@ intptr_t Intrinsifier::ParameterSlotFromSp() { return 0; }
void Intrinsifier::IntrinsicCallPrologue(Assembler* assembler) {
+ const intptr_t kAbiPreservedCpuRegs =
+ CallingConventions::kCalleeSaveCpuRegisters;
+ COMPILE_ASSERT((1 << CODE_REG) & kAbiPreservedCpuRegs);
+ COMPILE_ASSERT(((1 << ARGS_DESC_REG) & kAbiPreservedCpuRegs) == 0);
+ COMPILE_ASSERT((1 << CALLEE_SAVED_TEMP) & kAbiPreservedCpuRegs);
+ COMPILE_ASSERT(CALLEE_SAVED_TEMP != CODE_REG);
+ COMPILE_ASSERT(CALLEE_SAVED_TEMP != ARGS_DESC_REG);
+
assembler->Comment("IntrinsicCallPrologue");
- assembler->movq(CALLEE_SAVED_TEMP, R10);
+ assembler->movq(CALLEE_SAVED_TEMP, ARGS_DESC_REG);
}
void Intrinsifier::IntrinsicCallEpilogue(Assembler* assembler) {
assembler->Comment("IntrinsicCallEpilogue");
- assembler->movq(R10, CALLEE_SAVED_TEMP);
+ assembler->movq(ARGS_DESC_REG, CALLEE_SAVED_TEMP);
}

Powered by Google App Engine
This is Rietveld 408576698