Chromium Code Reviews| Index: runtime/vm/locations.h |
| diff --git a/runtime/vm/locations.h b/runtime/vm/locations.h |
| index 6e4393ca6a797b7fe8e340687aa270a6547c086c..cad43ea58b04f3b02298bd6f42ca9a3b95c5d945 100644 |
| --- a/runtime/vm/locations.h |
| +++ b/runtime/vm/locations.h |
| @@ -208,12 +208,34 @@ class Location : public ValueObject { |
| }; |
| +class RegisterSet : public ValueObject { |
| + public: |
| + RegisterSet() : registers_(0) { |
| + ASSERT(kNumberOfCpuRegisters < (kWordSize * kBitsPerByte)); |
| + } |
| + |
| + void Add(Register reg) { |
| + registers_ |= (1 << reg); |
| + } |
| + |
| + bool Contains(Register reg) { |
| + return (registers_ & (1 << reg)) != 0; |
| + } |
| + |
| + private: |
| + intptr_t registers_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(RegisterSet); |
| +}; |
| + |
| + |
| // Specification of locations for inputs and output. |
| class LocationSummary : public ZoneAllocated { |
| public: |
| enum ContainsCall { |
| kNoCall, |
| kCall, |
| + kCallOnSlowPath |
| }; |
| LocationSummary(intptr_t input_count, |
| @@ -262,7 +284,6 @@ class LocationSummary : public ZoneAllocated { |
| return &output_location_; |
| } |
| - |
| void set_out(Location loc) { |
| ASSERT(!is_call() || loc.IsRegister()); |
| output_location_ = loc; |
| @@ -271,14 +292,22 @@ class LocationSummary : public ZoneAllocated { |
| BitmapBuilder* stack_bitmap() const { return stack_bitmap_; } |
| bool is_call() const { |
| - return is_call_; |
| + return contains_call_ == kCall; |
| + } |
| + |
| + bool contains_call() const { |
|
srdjan
2012/08/15 00:12:03
I find is_call vs contains_call too similar/confus
Vyacheslav Egorov (Google)
2012/08/15 13:08:07
I rename contains_call() into can_call(), is_call
|
| + return contains_call_ != kNoCall; |
| } |
| void PrintTo(BufferFormatter* f) const; |
| static LocationSummary* Make(intptr_t input_count, |
| Location out, |
| - LocationSummary::ContainsCall contains_call); |
| + ContainsCall contains_call); |
| + |
| + RegisterSet* live_registers() { |
| + return &live_registers_; |
| + } |
| private: |
| // TODO(vegorov): replace with ZoneArray. |
| @@ -286,7 +315,9 @@ class LocationSummary : public ZoneAllocated { |
| GrowableArray<Location> temp_locations_; |
| Location output_location_; |
| BitmapBuilder* stack_bitmap_; |
| - const bool is_call_; |
| + |
| + const ContainsCall contains_call_; |
| + RegisterSet live_registers_; |
| }; |