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

Unified Diff: src/hydrogen-instructions.h

Issue 21014004: Add equality type parameter to HCompareObjectAndBranch (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Review feedback Created 7 years, 5 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
« no previous file with comments | « src/hydrogen.cc ('k') | src/hydrogen-instructions.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/hydrogen-instructions.h
diff --git a/src/hydrogen-instructions.h b/src/hydrogen-instructions.h
index dc312e08958c6406698cc2493b6469eee2f326ff..878fd437ae57bebb611417f13ab08f1e170061aa 100644
--- a/src/hydrogen-instructions.h
+++ b/src/hydrogen-instructions.h
@@ -45,6 +45,7 @@ namespace internal {
// Forward declarations.
class HBasicBlock;
+class HContext;
class HEnvironment;
class HInferRepresentationPhase;
class HInstruction;
@@ -99,7 +100,7 @@ class LChunkBuilder;
V(ClassOfTestAndBranch) \
V(CompareNumericAndBranch) \
V(CompareGeneric) \
- V(CompareObjectEqAndBranch) \
+ V(CompareObjectAndBranch) \
V(CompareMap) \
V(Constant) \
V(Context) \
@@ -4167,15 +4168,20 @@ class HCompareNumericAndBranch: public HTemplateControlInstruction<2, 2> {
};
-class HCompareObjectEqAndBranch: public HTemplateControlInstruction<2, 2> {
+class HCompareObjectAndBranch: public HTemplateControlInstruction<2, 2> {
public:
- HCompareObjectEqAndBranch(HValue* left, HValue* right) {
+ HCompareObjectAndBranch(HValue* left,
+ HValue* right,
+ Token::Value token = Token::EQ) {
SetOperandAt(0, left);
SetOperandAt(1, right);
+ ASSERT(token == Token::EQ || token == Token::NE);
+ token_ = token;
}
HValue* left() { return OperandAt(0); }
HValue* right() { return OperandAt(1); }
+ Token::Value token() const { return token_; }
virtual void PrintDataTo(StringStream* stream);
@@ -4187,7 +4193,12 @@ class HCompareObjectEqAndBranch: public HTemplateControlInstruction<2, 2> {
return Representation::Tagged();
}
- DECLARE_CONCRETE_INSTRUCTION(CompareObjectEqAndBranch)
+ bool is_equal() const { return token_ == Token::EQ; }
+
+ DECLARE_CONCRETE_INSTRUCTION(CompareObjectAndBranch)
+
+ private:
+ Token::Value token_;
};
« no previous file with comments | « src/hydrogen.cc ('k') | src/hydrogen-instructions.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698