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

Unified Diff: runtime/vm/intrinsifier_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_arm.cc ('k') | runtime/vm/intrinsifier_ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intrinsifier_arm64.cc
diff --git a/runtime/vm/intrinsifier_arm64.cc b/runtime/vm/intrinsifier_arm64.cc
index 0ca8c25fa63444e7ed7c22ef53c10ea12ec625b6..fbaa1677dc0c268fd8c7d4c89f60c0d8fd6e5c76 100644
--- a/runtime/vm/intrinsifier_arm64.cc
+++ b/runtime/vm/intrinsifier_arm64.cc
@@ -32,17 +32,31 @@ namespace dart {
intptr_t Intrinsifier::ParameterSlotFromSp() { return -1; }
+static bool IsABIPreservedRegister(Register reg) {
+ return ((1 << reg) & kAbiPreservedCpuRegs) != 0;
+}
+
+
void Intrinsifier::IntrinsicCallPrologue(Assembler* assembler) {
+ ASSERT(IsABIPreservedRegister(CODE_REG));
+ ASSERT(!IsABIPreservedRegister(ARGS_DESC_REG));
+ ASSERT(IsABIPreservedRegister(CALLEE_SAVED_TEMP));
+ ASSERT(IsABIPreservedRegister(CALLEE_SAVED_TEMP2));
+ ASSERT(CALLEE_SAVED_TEMP != CODE_REG);
+ ASSERT(CALLEE_SAVED_TEMP != ARGS_DESC_REG);
+ ASSERT(CALLEE_SAVED_TEMP2 != CODE_REG);
+ ASSERT(CALLEE_SAVED_TEMP2 != ARGS_DESC_REG);
+
assembler->Comment("IntrinsicCallPrologue");
assembler->mov(CALLEE_SAVED_TEMP, LR);
- assembler->mov(CALLEE_SAVED_TEMP2, R4);
+ assembler->mov(CALLEE_SAVED_TEMP2, ARGS_DESC_REG);
}
void Intrinsifier::IntrinsicCallEpilogue(Assembler* assembler) {
assembler->Comment("IntrinsicCallEpilogue");
assembler->mov(LR, CALLEE_SAVED_TEMP);
- assembler->mov(R4, CALLEE_SAVED_TEMP2);
+ assembler->mov(ARGS_DESC_REG, CALLEE_SAVED_TEMP2);
}
« no previous file with comments | « runtime/vm/intrinsifier_arm.cc ('k') | runtime/vm/intrinsifier_ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698