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); |
} |