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 "src/arm64/assembler-arm64.h" | 8 #include "src/arm64/assembler-arm64.h" |
9 #include "src/assembler.h" | 9 #include "src/assembler.h" |
10 #include "src/debug/debug.h" | 10 #include "src/debug/debug.h" |
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
303 rmode_(ImmediateInitializer<T>::rmode_for(t)) {} | 303 rmode_(ImmediateInitializer<T>::rmode_for(t)) {} |
304 | 304 |
305 | 305 |
306 template<typename T> | 306 template<typename T> |
307 Immediate::Immediate(T t, RelocInfo::Mode rmode) | 307 Immediate::Immediate(T t, RelocInfo::Mode rmode) |
308 : value_(ImmediateInitializer<T>::immediate_for(t)), | 308 : value_(ImmediateInitializer<T>::immediate_for(t)), |
309 rmode_(rmode) { | 309 rmode_(rmode) { |
310 STATIC_ASSERT(ImmediateInitializer<T>::kIsIntType); | 310 STATIC_ASSERT(ImmediateInitializer<T>::kIsIntType); |
311 } | 311 } |
312 | 312 |
313 | |
314 // Operand. | 313 // Operand. |
315 template<typename T> | 314 template<typename T> |
316 Operand::Operand(Handle<T> value) : immediate_(value), reg_(NoReg) {} | 315 Operand::Operand(Handle<T> value) : immediate_(value), reg_(NoReg) {} |
317 | 316 |
318 | 317 |
319 template<typename T> | 318 template<typename T> |
320 Operand::Operand(T t) : immediate_(t), reg_(NoReg) {} | 319 Operand::Operand(T t) : immediate_(t), reg_(NoReg) {} |
321 | 320 |
322 | 321 |
323 template<typename T> | 322 template<typename T> |
324 Operand::Operand(T t, RelocInfo::Mode rmode) | 323 Operand::Operand(T t, RelocInfo::Mode rmode) |
325 : immediate_(t, rmode), | 324 : immediate_(t, rmode), |
326 reg_(NoReg) {} | 325 reg_(NoReg) {} |
327 | 326 |
328 | |
329 Operand::Operand(Register reg, Shift shift, unsigned shift_amount) | 327 Operand::Operand(Register reg, Shift shift, unsigned shift_amount) |
330 : immediate_(0), | 328 : immediate_(0), |
331 reg_(reg), | 329 reg_(reg), |
332 shift_(shift), | 330 shift_(shift), |
333 extend_(NO_EXTEND), | 331 extend_(NO_EXTEND), |
334 shift_amount_(shift_amount) { | 332 shift_amount_(shift_amount) { |
335 DCHECK(reg.Is64Bits() || (shift_amount < kWRegSizeInBits)); | 333 DCHECK(reg.Is64Bits() || (shift_amount < kWRegSizeInBits)); |
336 DCHECK(reg.Is32Bits() || (shift_amount < kXRegSizeInBits)); | 334 DCHECK(reg.Is32Bits() || (shift_amount < kXRegSizeInBits)); |
337 DCHECK(!reg.IsSP()); | 335 DCHECK(!reg.IsSP()); |
338 } | 336 } |
339 | 337 |
340 | 338 |
341 Operand::Operand(Register reg, Extend extend, unsigned shift_amount) | 339 Operand::Operand(Register reg, Extend extend, unsigned shift_amount) |
342 : immediate_(0), | 340 : immediate_(0), |
343 reg_(reg), | 341 reg_(reg), |
344 shift_(NO_SHIFT), | 342 shift_(NO_SHIFT), |
345 extend_(extend), | 343 extend_(extend), |
346 shift_amount_(shift_amount) { | 344 shift_amount_(shift_amount) { |
347 DCHECK(reg.IsValid()); | 345 DCHECK(reg.IsValid()); |
348 DCHECK(shift_amount <= 4); | 346 DCHECK(shift_amount <= 4); |
349 DCHECK(!reg.IsSP()); | 347 DCHECK(!reg.IsSP()); |
350 | 348 |
351 // Extend modes SXTX and UXTX require a 64-bit register. | 349 // Extend modes SXTX and UXTX require a 64-bit register. |
352 DCHECK(reg.Is64Bits() || ((extend != SXTX) && (extend != UXTX))); | 350 DCHECK(reg.Is64Bits() || ((extend != SXTX) && (extend != UXTX))); |
353 } | 351 } |
354 | 352 |
355 | 353 |
356 bool Operand::IsImmediate() const { | 354 bool Operand::IsImmediate() const { |
357 return reg_.Is(NoReg); | 355 return reg_.Is(NoReg) && !is_heap_number(); |
358 } | 356 } |
359 | 357 |
360 | 358 |
361 bool Operand::IsShiftedRegister() const { | 359 bool Operand::IsShiftedRegister() const { |
362 return reg_.IsValid() && (shift_ != NO_SHIFT); | 360 return reg_.IsValid() && (shift_ != NO_SHIFT); |
363 } | 361 } |
364 | 362 |
365 | 363 |
366 bool Operand::IsExtendedRegister() const { | 364 bool Operand::IsExtendedRegister() const { |
367 return reg_.IsValid() && (extend_ != NO_EXTEND); | 365 return reg_.IsValid() && (extend_ != NO_EXTEND); |
(...skipping 845 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1213 | 1211 |
1214 void Assembler::ClearRecordedAstId() { | 1212 void Assembler::ClearRecordedAstId() { |
1215 recorded_ast_id_ = TypeFeedbackId::None(); | 1213 recorded_ast_id_ = TypeFeedbackId::None(); |
1216 } | 1214 } |
1217 | 1215 |
1218 | 1216 |
1219 } // namespace internal | 1217 } // namespace internal |
1220 } // namespace v8 | 1218 } // namespace v8 |
1221 | 1219 |
1222 #endif // V8_ARM64_ASSEMBLER_ARM64_INL_H_ | 1220 #endif // V8_ARM64_ASSEMBLER_ARM64_INL_H_ |
OLD | NEW |