| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef VM_LOCATIONS_H_ | 5 #ifndef VM_LOCATIONS_H_ |
| 6 #define VM_LOCATIONS_H_ | 6 #define VM_LOCATIONS_H_ |
| 7 | 7 |
| 8 #include "vm/allocation.h" | 8 #include "vm/allocation.h" |
| 9 #include "vm/assembler.h" | 9 #include "vm/assembler.h" |
| 10 #include "vm/bitfield.h" | 10 #include "vm/bitfield.h" |
| (...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 465 void MarkUntagged(Location loc) { | 465 void MarkUntagged(Location loc) { |
| 466 ASSERT(loc.IsRegister()); | 466 ASSERT(loc.IsRegister()); |
| 467 untagged_cpu_registers_ |= (1 << loc.reg()); | 467 untagged_cpu_registers_ |= (1 << loc.reg()); |
| 468 } | 468 } |
| 469 | 469 |
| 470 bool IsTagged(Register reg) const { | 470 bool IsTagged(Register reg) const { |
| 471 return (untagged_cpu_registers_ & (1 << reg)) == 0; | 471 return (untagged_cpu_registers_ & (1 << reg)) == 0; |
| 472 } | 472 } |
| 473 | 473 |
| 474 bool ContainsRegister(Register reg) const { | 474 bool ContainsRegister(Register reg) const { |
| 475 return (cpu_registers_ & (1 << reg)) != 0; | 475 return Contains(cpu_registers_, reg); |
| 476 } | 476 } |
| 477 | 477 |
| 478 bool ContainsFpuRegister(FpuRegister fpu_reg) const { | 478 bool ContainsFpuRegister(FpuRegister fpu_reg) const { |
| 479 return (fpu_registers_ & (1 << fpu_reg)) != 0; | 479 return Contains(fpu_registers_, fpu_reg); |
| 480 } | 480 } |
| 481 | 481 |
| 482 intptr_t CpuRegisterCount() const { return RegisterCount(cpu_registers_); } | 482 intptr_t CpuRegisterCount() const { return RegisterCount(cpu_registers_); } |
| 483 intptr_t FpuRegisterCount() const { return RegisterCount(fpu_registers_); } | 483 intptr_t FpuRegisterCount() const { return RegisterCount(fpu_registers_); } |
| 484 | 484 |
| 485 static intptr_t RegisterCount(intptr_t registers); | 485 static intptr_t RegisterCount(intptr_t registers); |
| 486 static bool Contains(intptr_t register_set, intptr_t reg) { |
| 487 return (register_set & (1 << reg)) != 0; |
| 488 } |
| 486 | 489 |
| 487 intptr_t cpu_registers() const { return cpu_registers_; } | 490 intptr_t cpu_registers() const { return cpu_registers_; } |
| 488 intptr_t fpu_registers() const { return fpu_registers_; } | 491 intptr_t fpu_registers() const { return fpu_registers_; } |
| 489 | 492 |
| 490 private: | 493 private: |
| 491 intptr_t cpu_registers_; | 494 intptr_t cpu_registers_; |
| 492 intptr_t untagged_cpu_registers_; | 495 intptr_t untagged_cpu_registers_; |
| 493 intptr_t fpu_registers_; | 496 intptr_t fpu_registers_; |
| 494 | 497 |
| 495 DISALLOW_COPY_AND_ASSIGN(RegisterSet); | 498 DISALLOW_COPY_AND_ASSIGN(RegisterSet); |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 621 BitmapBuilder* stack_bitmap_; | 624 BitmapBuilder* stack_bitmap_; |
| 622 | 625 |
| 623 const ContainsCall contains_call_; | 626 const ContainsCall contains_call_; |
| 624 RegisterSet live_registers_; | 627 RegisterSet live_registers_; |
| 625 }; | 628 }; |
| 626 | 629 |
| 627 | 630 |
| 628 } // namespace dart | 631 } // namespace dart |
| 629 | 632 |
| 630 #endif // VM_LOCATIONS_H_ | 633 #endif // VM_LOCATIONS_H_ |
| OLD | NEW |