Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2461)

Unified Diff: runtime/vm/locations.h

Issue 252333002: Use GPRs for mints (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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,

Powered by Google App Engine
This is Rietveld 408576698