Index: runtime/vm/locations.h |
diff --git a/runtime/vm/locations.h b/runtime/vm/locations.h |
index cabb8dbda12a8b5c01da1d51aa4d9cbe84202408..0a99d9fcfa71bfe0fc7db59f09cdc22be50ea436 100644 |
--- a/runtime/vm/locations.h |
+++ b/runtime/vm/locations.h |
@@ -365,6 +365,8 @@ class Location : public ValueObject { |
return KindField::decode(value_); |
} |
+ Location Copy() const; |
+ |
private: |
explicit Location(uword value) : value_(value) { } |
@@ -428,15 +430,20 @@ class PairLocation : public ZoneAllocated { |
class RegisterSet : public ValueObject { |
public: |
- RegisterSet() : cpu_registers_(0), fpu_registers_(0) { |
+ RegisterSet() : cpu_registers_(0), untagged_cpu_registers_(0), |
+ fpu_registers_(0) { |
ASSERT(kNumberOfCpuRegisters <= (kWordSize * kBitsPerByte)); |
ASSERT(kNumberOfFpuRegisters <= (kWordSize * kBitsPerByte)); |
} |
- void Add(Location loc) { |
+ void Add(Location loc, Representation rep = kTagged) { |
if (loc.IsRegister()) { |
cpu_registers_ |= (1 << loc.reg()); |
+ if (rep != kTagged) { |
+ // CPU register contains an untagged value. |
+ MarkUntagged(loc); |
+ } |
} else if (loc.IsFpuRegister()) { |
fpu_registers_ |= (1 << loc.fpu_reg()); |
} |
@@ -450,6 +457,15 @@ class RegisterSet : public ValueObject { |
} |
} |
+ void MarkUntagged(Location loc) { |
+ ASSERT(loc.IsRegister()); |
+ untagged_cpu_registers_ |= (1 << loc.reg()); |
+ } |
+ |
+ bool IsTagged(Register reg) const { |
+ return (untagged_cpu_registers_ & (1 << reg)) == 0; |
+ } |
+ |
bool ContainsRegister(Register reg) const { |
return (cpu_registers_ & (1 << reg)) != 0; |
} |
@@ -468,6 +484,7 @@ class RegisterSet : public ValueObject { |
private: |
intptr_t cpu_registers_; |
+ intptr_t untagged_cpu_registers_; |
intptr_t fpu_registers_; |
DISALLOW_COPY_AND_ASSIGN(RegisterSet); |
@@ -561,6 +578,10 @@ class LocationSummary : public ZoneAllocated { |
return contains_call_ != kNoCall; |
} |
+ bool HasCallOnSlowPath() { |
+ return can_call() && !always_calls(); |
+ } |
+ |
void PrintTo(BufferFormatter* f) const; |
static LocationSummary* Make(intptr_t input_count, |