Index: src/a64/assembler-a64.cc |
diff --git a/src/a64/assembler-a64.cc b/src/a64/assembler-a64.cc |
index c06fbe900bf19cd8b57cdfbdd68039d541d68aee..89b9af36deccd0d7d0321221104ba22941c2bcab 100644 |
--- a/src/a64/assembler-a64.cc |
+++ b/src/a64/assembler-a64.cc |
@@ -180,6 +180,19 @@ void RelocInfo::PatchCodeWithCall(Address target, int guard_bytes) { |
} |
+Register GetAllocatableRegisterThatIsNotOneOf(Register reg1, Register reg2, |
+ Register reg3, Register reg4) { |
+ CPURegList regs(reg1, reg2, reg3, reg4); |
+ for (int i = 0; i < Register::NumAllocatableRegisters(); i++) { |
+ Register candidate = Register::FromAllocationIndex(i); |
+ if (regs.IncludesAliasOf(candidate)) continue; |
+ return candidate; |
+ } |
+ UNREACHABLE(); |
+ return NoReg; |
+} |
+ |
+ |
bool AreAliased(const CPURegister& reg1, const CPURegister& reg2, |
const CPURegister& reg3, const CPURegister& reg4, |
const CPURegister& reg5, const CPURegister& reg6, |