Index: src/arm64/assembler-arm64-inl.h |
diff --git a/src/arm64/assembler-arm64-inl.h b/src/arm64/assembler-arm64-inl.h |
index 3c17153f68eeb403f96197d2b85a3b7a603d2b26..70e30521691220891e90ce20210b964cf5c050cd 100644 |
--- a/src/arm64/assembler-arm64-inl.h |
+++ b/src/arm64/assembler-arm64-inl.h |
@@ -109,8 +109,13 @@ inline bool CPURegister::IsNone() const { |
inline bool CPURegister::Is(const CPURegister& other) const { |
ASSERT(IsValidOrNone() && other.IsValidOrNone()); |
- return (reg_code == other.reg_code) && (reg_size == other.reg_size) && |
- (reg_type == other.reg_type); |
+ return Aliases(other) && (reg_size == other.reg_size); |
+} |
+ |
+ |
+inline bool CPURegister::Aliases(const CPURegister& other) const { |
+ ASSERT(IsValidOrNone() && other.IsValidOrNone()); |
+ return (reg_code == other.reg_code) && (reg_type == other.reg_type); |
} |
@@ -195,16 +200,22 @@ inline void CPURegList::Remove(int code) { |
inline Register Register::XRegFromCode(unsigned code) { |
- // This function returns the zero register when code = 31. The stack pointer |
- // can not be returned. |
- ASSERT(code < kNumberOfRegisters); |
- return Register::Create(code, kXRegSizeInBits); |
+ if (code == kSPRegInternalCode) { |
+ return csp; |
+ } else { |
+ ASSERT(code < kNumberOfRegisters); |
+ return Register::Create(code, kXRegSizeInBits); |
+ } |
} |
inline Register Register::WRegFromCode(unsigned code) { |
- ASSERT(code < kNumberOfRegisters); |
- return Register::Create(code, kWRegSizeInBits); |
+ if (code == kSPRegInternalCode) { |
+ return wcsp; |
+ } else { |
+ ASSERT(code < kNumberOfRegisters); |
+ return Register::Create(code, kWRegSizeInBits); |
+ } |
} |