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

Unified Diff: src/compiler/instruction.h

Issue 758073002: [turbofan] Use special constant type for RPO block number operands. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 6 years, 1 month 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
« no previous file with comments | « src/compiler/ia32/code-generator-ia32.cc ('k') | src/compiler/instruction.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_;
« no previous file with comments | « src/compiler/ia32/code-generator-ia32.cc ('k') | src/compiler/instruction.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698