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

Unified Diff: src/hydrogen-instructions.h

Issue 11678007: SSI implementation. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years 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: src/hydrogen-instructions.h
diff --git a/src/hydrogen-instructions.h b/src/hydrogen-instructions.h
index d8f5dec0f7d90b4bc93c9da0da0e604dd0e65050..d1f3fb99344eeec8ccf94d5ee355a89acf6c3bd8 100644
--- a/src/hydrogen-instructions.h
+++ b/src/hydrogen-instructions.h
@@ -64,6 +64,7 @@ class LChunkBuilder;
V(AbnormalExit) \
V(AccessArgumentsAt) \
V(Add) \
+ V(SsiDefinition) \
V(AllocateObject) \
V(ApplyArguments) \
V(ArgumentsElements) \
@@ -578,7 +579,11 @@ class HValue: public ZoneObject {
// HGraph::ComputeSafeUint32Operations is responsible for setting this
// flag.
kUint32,
- kLastFlag = kUint32
+ // SSI construction sets this flag while processing instructions.
+ // This means that a new SSI definition is known to dominate every
+ // instruction in the same basic block that has this flag still unset.
+ kProcessedBySsi,
+ kLastFlag = kProcessedBySsi
};
STATIC_ASSERT(kLastFlag < kBitsPerInt);
@@ -619,6 +624,8 @@ class HValue: public ZoneObject {
HYDROGEN_ABSTRACT_INSTRUCTION_LIST(DECLARE_PREDICATE)
#undef DECLARE_PREDICATE
+ virtual void BuildSsi() { }
+
HValue() : block_(NULL),
id_(kNoNumber),
type_(HType::Tagged()),
@@ -657,6 +664,8 @@ class HValue: public ZoneObject {
type_ = new_type;
}
+ virtual HValue* ValueBeforeSsi() { return this; }
+
// An operation needs to override this function iff:
// 1) it can produce an int32 output.
// 2) the true value of its output can potentially be minus zero.
@@ -2835,6 +2844,74 @@ class HWrapReceiver: public HTemplateInstruction<2> {
};
+class HSsiDefinition : public HUnaryOperation {
+ public:
+ enum ValueInfoRelation { NONE, NE, GT, GE, EQ, LE, LT, IF_TAGGED_IS_SMI};
+ static const char* RelationName(ValueInfoRelation r) {
+ switch (r) {
+ case NE:
+ return "NE";
+ case GT:
+ return "GT";
+ case GE:
+ return "GE";
+ case EQ:
+ return "EQ";
+ case LE:
+ return "LE";
+ case LT:
+ return "LT";
+ case IF_TAGGED_IS_SMI:
+ return "IF_TAGGED_IS_SMI";
+ case NONE:
+ return "NONE";
+ default:
+ UNREACHABLE();
+ return "UNREACHABLE";
+ }
+ }
+
+ static HSsiDefinition* New(HValue* previous_definition,
+ HInstruction* insertion_point,
+ ValueInfoRelation relation,
+ HValue* constraint,
+ int delta = 0);
+
+ HValue* previous_definition() { return OperandAt(0); }
+
+ virtual HValue* ValueBeforeSsi() { return value_before_ssi_; }
+
+ virtual Representation RequiredInputRepresentation(int index) {
+ return ValueBeforeSsi()->RequiredInputRepresentation(index);
+ }
+
+ virtual void PrintDataTo(StringStream* stream);
+
+ HValue* constraint() { return constraint_; }
+ ValueInfoRelation relation() { return relation_; }
+ int delta() { return delta_; }
+
+ DECLARE_CONCRETE_INSTRUCTION(SsiDefinition)
+
+ protected:
+ virtual bool DataEquals(HValue* other) {
+ return DataEquals(ValueBeforeSsi());
+ }
+
+ private:
+ explicit HSsiDefinition(HValue* previous_definition,
+ HInstruction* insertion_point,
+ ValueInfoRelation relation,
+ HValue* constraint,
+ int delta);
+
+ HValue* value_before_ssi_;
+ ValueInfoRelation relation_;
+ HValue* constraint_;
+ int delta_;
+};
+
+
class HApplyArguments: public HTemplateInstruction<4> {
public:
HApplyArguments(HValue* function,
@@ -2986,6 +3063,8 @@ class HBoundsCheck: public HTemplateInstruction<2> {
virtual void PrintDataTo(StringStream* stream);
+ virtual void BuildSsi();
+
HValue* index() { return OperandAt(0); }
HValue* length() { return OperandAt(1); }
« no previous file with comments | « src/hydrogen.cc ('k') | src/hydrogen-instructions.cc » ('j') | src/hydrogen-instructions.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698