| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef V8_ARM64_ASSEMBLER_ARM64_INL_H_ | 5 #ifndef V8_ARM64_ASSEMBLER_ARM64_INL_H_ |
| 6 #define V8_ARM64_ASSEMBLER_ARM64_INL_H_ | 6 #define V8_ARM64_ASSEMBLER_ARM64_INL_H_ |
| 7 | 7 |
| 8 #include "arm64/assembler-arm64.h" | 8 #include "arm64/assembler-arm64.h" |
| 9 #include "cpu.h" | 9 #include "cpu.h" |
| 10 #include "debug.h" | 10 #include "debug.h" |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 // kNoRegister types should always have size 0 and code 0. | 102 // kNoRegister types should always have size 0 and code 0. |
| 103 ASSERT((reg_type != kNoRegister) || (reg_code == 0)); | 103 ASSERT((reg_type != kNoRegister) || (reg_code == 0)); |
| 104 ASSERT((reg_type != kNoRegister) || (reg_size == 0)); | 104 ASSERT((reg_type != kNoRegister) || (reg_size == 0)); |
| 105 | 105 |
| 106 return reg_type == kNoRegister; | 106 return reg_type == kNoRegister; |
| 107 } | 107 } |
| 108 | 108 |
| 109 | 109 |
| 110 inline bool CPURegister::Is(const CPURegister& other) const { | 110 inline bool CPURegister::Is(const CPURegister& other) const { |
| 111 ASSERT(IsValidOrNone() && other.IsValidOrNone()); | 111 ASSERT(IsValidOrNone() && other.IsValidOrNone()); |
| 112 return (reg_code == other.reg_code) && (reg_size == other.reg_size) && | 112 return Aliases(other) && (reg_size == other.reg_size); |
| 113 (reg_type == other.reg_type); | |
| 114 } | 113 } |
| 115 | 114 |
| 116 | 115 |
| 116 inline bool CPURegister::Aliases(const CPURegister& other) const { |
| 117 ASSERT(IsValidOrNone() && other.IsValidOrNone()); |
| 118 return (reg_code == other.reg_code) && (reg_type == other.reg_type); |
| 119 } |
| 120 |
| 121 |
| 117 inline bool CPURegister::IsRegister() const { | 122 inline bool CPURegister::IsRegister() const { |
| 118 return reg_type == kRegister; | 123 return reg_type == kRegister; |
| 119 } | 124 } |
| 120 | 125 |
| 121 | 126 |
| 122 inline bool CPURegister::IsFPRegister() const { | 127 inline bool CPURegister::IsFPRegister() const { |
| 123 return reg_type == kFPRegister; | 128 return reg_type == kFPRegister; |
| 124 } | 129 } |
| 125 | 130 |
| 126 | 131 |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 | 193 |
| 189 | 194 |
| 190 inline void CPURegList::Remove(int code) { | 195 inline void CPURegList::Remove(int code) { |
| 191 ASSERT(IsValid()); | 196 ASSERT(IsValid()); |
| 192 ASSERT(CPURegister::Create(code, size_, type_).IsValid()); | 197 ASSERT(CPURegister::Create(code, size_, type_).IsValid()); |
| 193 list_ &= ~(1UL << code); | 198 list_ &= ~(1UL << code); |
| 194 } | 199 } |
| 195 | 200 |
| 196 | 201 |
| 197 inline Register Register::XRegFromCode(unsigned code) { | 202 inline Register Register::XRegFromCode(unsigned code) { |
| 198 // This function returns the zero register when code = 31. The stack pointer | 203 if (code == kSPRegInternalCode) { |
| 199 // can not be returned. | 204 return csp; |
| 200 ASSERT(code < kNumberOfRegisters); | 205 } else { |
| 201 return Register::Create(code, kXRegSizeInBits); | 206 ASSERT(code < kNumberOfRegisters); |
| 207 return Register::Create(code, kXRegSizeInBits); |
| 208 } |
| 202 } | 209 } |
| 203 | 210 |
| 204 | 211 |
| 205 inline Register Register::WRegFromCode(unsigned code) { | 212 inline Register Register::WRegFromCode(unsigned code) { |
| 206 ASSERT(code < kNumberOfRegisters); | 213 if (code == kSPRegInternalCode) { |
| 207 return Register::Create(code, kWRegSizeInBits); | 214 return wcsp; |
| 215 } else { |
| 216 ASSERT(code < kNumberOfRegisters); |
| 217 return Register::Create(code, kWRegSizeInBits); |
| 218 } |
| 208 } | 219 } |
| 209 | 220 |
| 210 | 221 |
| 211 inline FPRegister FPRegister::SRegFromCode(unsigned code) { | 222 inline FPRegister FPRegister::SRegFromCode(unsigned code) { |
| 212 ASSERT(code < kNumberOfFPRegisters); | 223 ASSERT(code < kNumberOfFPRegisters); |
| 213 return FPRegister::Create(code, kSRegSizeInBits); | 224 return FPRegister::Create(code, kSRegSizeInBits); |
| 214 } | 225 } |
| 215 | 226 |
| 216 | 227 |
| 217 inline FPRegister FPRegister::DRegFromCode(unsigned code) { | 228 inline FPRegister FPRegister::DRegFromCode(unsigned code) { |
| (...skipping 985 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1203 | 1214 |
| 1204 | 1215 |
| 1205 void Assembler::ClearRecordedAstId() { | 1216 void Assembler::ClearRecordedAstId() { |
| 1206 recorded_ast_id_ = TypeFeedbackId::None(); | 1217 recorded_ast_id_ = TypeFeedbackId::None(); |
| 1207 } | 1218 } |
| 1208 | 1219 |
| 1209 | 1220 |
| 1210 } } // namespace v8::internal | 1221 } } // namespace v8::internal |
| 1211 | 1222 |
| 1212 #endif // V8_ARM64_ASSEMBLER_ARM64_INL_H_ | 1223 #endif // V8_ARM64_ASSEMBLER_ARM64_INL_H_ |
| OLD | NEW |