| 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 441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 452 SmallSet() : data_(0) { } | 452 SmallSet() : data_(0) { } |
| 453 | 453 |
| 454 explicit SmallSet(intptr_t data) : data_(data) { } | 454 explicit SmallSet(intptr_t data) : data_(data) { } |
| 455 | 455 |
| 456 bool Contains(T value) const { return (data_ & ToMask(value)) != 0; } | 456 bool Contains(T value) const { return (data_ & ToMask(value)) != 0; } |
| 457 | 457 |
| 458 void Add(T value) { data_ |= ToMask(value); } | 458 void Add(T value) { data_ |= ToMask(value); } |
| 459 | 459 |
| 460 void Remove(T value) { data_ &= ~ToMask(value); } | 460 void Remove(T value) { data_ &= ~ToMask(value); } |
| 461 | 461 |
| 462 bool IsEmpty() const { return data_ != 0; } |
| 463 |
| 462 intptr_t data() const { return data_; } | 464 intptr_t data() const { return data_; } |
| 463 | 465 |
| 464 private: | 466 private: |
| 465 static intptr_t ToMask(T value) { | 467 static intptr_t ToMask(T value) { |
| 466 ASSERT(static_cast<intptr_t>(value) < (kWordSize * kBitsPerByte)); | 468 ASSERT(static_cast<intptr_t>(value) < (kWordSize * kBitsPerByte)); |
| 467 return 1 << static_cast<intptr_t>(value); | 469 return 1 << static_cast<intptr_t>(value); |
| 468 } | 470 } |
| 469 | 471 |
| 470 intptr_t data_; | 472 intptr_t data_; |
| 471 }; | 473 }; |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 528 ISL_Print("%s\n", Assembler::FpuRegisterName(r)); | 530 ISL_Print("%s\n", Assembler::FpuRegisterName(r)); |
| 529 } | 531 } |
| 530 } | 532 } |
| 531 } | 533 } |
| 532 | 534 |
| 533 void MarkUntagged(Location loc) { | 535 void MarkUntagged(Location loc) { |
| 534 ASSERT(loc.IsRegister()); | 536 ASSERT(loc.IsRegister()); |
| 535 untagged_cpu_registers_.Add(loc.reg()); | 537 untagged_cpu_registers_.Add(loc.reg()); |
| 536 } | 538 } |
| 537 | 539 |
| 540 bool HasUntaggedValues() const { |
| 541 return !untagged_cpu_registers_.IsEmpty() || !fpu_registers_.IsEmpty(); |
| 542 } |
| 543 |
| 538 bool IsTagged(Register reg) const { | 544 bool IsTagged(Register reg) const { |
| 539 return !untagged_cpu_registers_.Contains(reg); | 545 return !untagged_cpu_registers_.Contains(reg); |
| 540 } | 546 } |
| 541 | 547 |
| 542 bool ContainsRegister(Register reg) const { | 548 bool ContainsRegister(Register reg) const { |
| 543 return cpu_registers_.Contains(reg); | 549 return cpu_registers_.Contains(reg); |
| 544 } | 550 } |
| 545 | 551 |
| 546 bool ContainsFpuRegister(FpuRegister fpu_reg) const { | 552 bool ContainsFpuRegister(FpuRegister fpu_reg) const { |
| 547 return fpu_registers_.Contains(fpu_reg); | 553 return fpu_registers_.Contains(fpu_reg); |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 703 | 709 |
| 704 #if defined(DEBUG) | 710 #if defined(DEBUG) |
| 705 intptr_t writable_inputs_; | 711 intptr_t writable_inputs_; |
| 706 #endif | 712 #endif |
| 707 }; | 713 }; |
| 708 | 714 |
| 709 | 715 |
| 710 } // namespace dart | 716 } // namespace dart |
| 711 | 717 |
| 712 #endif // VM_LOCATIONS_H_ | 718 #endif // VM_LOCATIONS_H_ |
| OLD | NEW |