Index: runtime/vm/intrinsifier_x64.cc |
diff --git a/runtime/vm/intrinsifier_x64.cc b/runtime/vm/intrinsifier_x64.cc |
index 58f096d3fdb95f1ed0b3250a61e6f3517936c496..5ac5d39bb4d64966a82505077b396e69639e1283 100644 |
--- a/runtime/vm/intrinsifier_x64.cc |
+++ b/runtime/vm/intrinsifier_x64.cc |
@@ -32,15 +32,26 @@ namespace dart { |
intptr_t Intrinsifier::ParameterSlotFromSp() { return 0; } |
+static bool IsABIPreservedRegister(Register reg) { |
+ return ((1 << reg) & CallingConventions::kCalleeSaveCpuRegisters) != 0; |
+} |
+ |
+ |
void Intrinsifier::IntrinsicCallPrologue(Assembler* assembler) { |
+ ASSERT(IsABIPreservedRegister(CODE_REG)); |
+ ASSERT(!IsABIPreservedRegister(ARGS_DESC_REG)); |
+ ASSERT(IsABIPreservedRegister(CALLEE_SAVED_TEMP)); |
+ ASSERT(CALLEE_SAVED_TEMP != CODE_REG); |
+ 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); |
} |