Index: src/compiler/instruction.h |
diff --git a/src/compiler/instruction.h b/src/compiler/instruction.h |
index 1740dfbf25b970054417d75c533ba95e8ea65366..bcd25b2eb87fb2df4fbd8783bfc25107680fb6ac 100644 |
--- a/src/compiler/instruction.h |
+++ b/src/compiler/instruction.h |
@@ -692,7 +692,8 @@ class Constant FINAL { |
kFloat32, |
kFloat64, |
kExternalReference, |
- kHeapObject |
+ kHeapObject, |
+ kRpoNumber |
}; |
explicit Constant(int32_t v) : type_(kInt32), value_(v) {} |
@@ -703,6 +704,8 @@ class Constant FINAL { |
: type_(kExternalReference), value_(bit_cast<intptr_t>(ref)) {} |
explicit Constant(Handle<HeapObject> obj) |
: type_(kHeapObject), value_(bit_cast<intptr_t>(obj)) {} |
+ explicit Constant(BasicBlock::RpoNumber rpo) |
+ : type_(kRpoNumber), value_(rpo.ToInt()) {} |
Type type() const { return type_; } |
@@ -735,6 +738,11 @@ class Constant FINAL { |
return bit_cast<ExternalReference>(static_cast<intptr_t>(value_)); |
} |
+ BasicBlock::RpoNumber ToRpoNumber() const { |
+ DCHECK_EQ(kRpoNumber, type()); |
+ return BasicBlock::RpoNumber::FromInt(static_cast<int>(value_)); |
+ } |
+ |
Handle<HeapObject> ToHeapObject() const { |
DCHECK_EQ(kHeapObject, type()); |
return bit_cast<Handle<HeapObject> >(static_cast<intptr_t>(value_)); |
@@ -891,7 +899,6 @@ class InstructionBlock FINAL : public ZoneObject { |
PhiInstructions phis_; |
const BasicBlock::Id id_; |
const BasicBlock::RpoNumber ao_number_; // Assembly order number. |
- // TODO(dcarney): probably dont't need this. |
const BasicBlock::RpoNumber rpo_number_; |
const BasicBlock::RpoNumber loop_header_; |
const BasicBlock::RpoNumber loop_end_; |