| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 bool is_valid() const { return IsValid(); } | 108 bool is_valid() const { return IsValid(); } |
| 109 | 109 |
| 110 unsigned reg_code; | 110 unsigned reg_code; |
| 111 unsigned reg_size; | 111 unsigned reg_size; |
| 112 RegisterType reg_type; | 112 RegisterType reg_type; |
| 113 }; | 113 }; |
| 114 | 114 |
| 115 | 115 |
| 116 struct Register : public CPURegister { | 116 struct Register : public CPURegister { |
| 117 static Register Create(unsigned code, unsigned size) { | 117 static Register Create(unsigned code, unsigned size) { |
| 118 return CPURegister::Create(code, size, CPURegister::kRegister); | 118 return Register(CPURegister::Create(code, size, CPURegister::kRegister)); |
| 119 } | 119 } |
| 120 | 120 |
| 121 Register() { | 121 Register() { |
| 122 reg_code = 0; | 122 reg_code = 0; |
| 123 reg_size = 0; | 123 reg_size = 0; |
| 124 reg_type = CPURegister::kNoRegister; | 124 reg_type = CPURegister::kNoRegister; |
| 125 } | 125 } |
| 126 | 126 |
| 127 Register(const CPURegister& r) { // NOLINT(runtime/explicit) | 127 explicit Register(const CPURegister& r) { |
| 128 reg_code = r.reg_code; | 128 reg_code = r.reg_code; |
| 129 reg_size = r.reg_size; | 129 reg_size = r.reg_size; |
| 130 reg_type = r.reg_type; | 130 reg_type = r.reg_type; |
| 131 ASSERT(IsValidOrNone()); |
| 132 } |
| 133 |
| 134 Register(const Register& r) { // NOLINT(runtime/explicit) |
| 135 reg_code = r.reg_code; |
| 136 reg_size = r.reg_size; |
| 137 reg_type = r.reg_type; |
| 131 ASSERT(IsValidOrNone()); | 138 ASSERT(IsValidOrNone()); |
| 132 } | 139 } |
| 133 | 140 |
| 134 bool IsValid() const { | 141 bool IsValid() const { |
| 135 ASSERT(IsRegister() || IsNone()); | 142 ASSERT(IsRegister() || IsNone()); |
| 136 return IsValidRegister(); | 143 return IsValidRegister(); |
| 137 } | 144 } |
| 138 | 145 |
| 139 static Register XRegFromCode(unsigned code); | 146 static Register XRegFromCode(unsigned code); |
| 140 static Register WRegFromCode(unsigned code); | 147 static Register WRegFromCode(unsigned code); |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 // Always return an X register. | 236 // Always return an X register. |
| 230 return Register::Create(code, kXRegSizeInBits); | 237 return Register::Create(code, kXRegSizeInBits); |
| 231 } | 238 } |
| 232 | 239 |
| 233 // End of V8 compatibility section ----------------------- | 240 // End of V8 compatibility section ----------------------- |
| 234 }; | 241 }; |
| 235 | 242 |
| 236 | 243 |
| 237 struct FPRegister : public CPURegister { | 244 struct FPRegister : public CPURegister { |
| 238 static FPRegister Create(unsigned code, unsigned size) { | 245 static FPRegister Create(unsigned code, unsigned size) { |
| 239 return CPURegister::Create(code, size, CPURegister::kFPRegister); | 246 return FPRegister( |
| 247 CPURegister::Create(code, size, CPURegister::kFPRegister)); |
| 240 } | 248 } |
| 241 | 249 |
| 242 FPRegister() { | 250 FPRegister() { |
| 243 reg_code = 0; | 251 reg_code = 0; |
| 244 reg_size = 0; | 252 reg_size = 0; |
| 245 reg_type = CPURegister::kNoRegister; | 253 reg_type = CPURegister::kNoRegister; |
| 246 } | 254 } |
| 247 | 255 |
| 248 FPRegister(const CPURegister& r) { // NOLINT(runtime/explicit) | 256 explicit FPRegister(const CPURegister& r) { |
| 249 reg_code = r.reg_code; | 257 reg_code = r.reg_code; |
| 250 reg_size = r.reg_size; | 258 reg_size = r.reg_size; |
| 251 reg_type = r.reg_type; | 259 reg_type = r.reg_type; |
| 260 ASSERT(IsValidOrNone()); |
| 261 } |
| 262 |
| 263 FPRegister(const FPRegister& r) { // NOLINT(runtime/explicit) |
| 264 reg_code = r.reg_code; |
| 265 reg_size = r.reg_size; |
| 266 reg_type = r.reg_type; |
| 252 ASSERT(IsValidOrNone()); | 267 ASSERT(IsValidOrNone()); |
| 253 } | 268 } |
| 254 | 269 |
| 255 bool IsValid() const { | 270 bool IsValid() const { |
| 256 ASSERT(IsFPRegister() || IsNone()); | 271 ASSERT(IsFPRegister() || IsNone()); |
| 257 return IsValidFPRegister(); | 272 return IsValidFPRegister(); |
| 258 } | 273 } |
| 259 | 274 |
| 260 static FPRegister SRegFromCode(unsigned code); | 275 static FPRegister SRegFromCode(unsigned code); |
| 261 static FPRegister DRegFromCode(unsigned code); | 276 static FPRegister DRegFromCode(unsigned code); |
| (...skipping 1952 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2214 class EnsureSpace BASE_EMBEDDED { | 2229 class EnsureSpace BASE_EMBEDDED { |
| 2215 public: | 2230 public: |
| 2216 explicit EnsureSpace(Assembler* assembler) { | 2231 explicit EnsureSpace(Assembler* assembler) { |
| 2217 assembler->CheckBuffer(); | 2232 assembler->CheckBuffer(); |
| 2218 } | 2233 } |
| 2219 }; | 2234 }; |
| 2220 | 2235 |
| 2221 } } // namespace v8::internal | 2236 } } // namespace v8::internal |
| 2222 | 2237 |
| 2223 #endif // V8_ARM64_ASSEMBLER_ARM64_H_ | 2238 #endif // V8_ARM64_ASSEMBLER_ARM64_H_ |
| OLD | NEW |