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

Unified Diff: src/hydrogen-instructions.h

Issue 7000021: Support symbol comparison in crankshaft. (Closed)
Patch Set: Review fixes Created 9 years, 7 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/ia32/lithium-codegen-ia32.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 85a06fcbb7b56a87a9fec6b574ea21e98273a8f2..667dc30bae5316ceabe6af8cdb77265f550ae32f 100644
--- a/src/hydrogen-instructions.h
+++ b/src/hydrogen-instructions.h
@@ -91,6 +91,7 @@ class LChunkBuilder;
V(Compare) \
V(CompareJSObjectEq) \
V(CompareMap) \
+ V(CompareSymbolEq) \
V(Constant) \
V(Context) \
V(DeleteProperty) \
@@ -2409,6 +2410,40 @@ class HCompareJSObjectEq: public HBinaryOperation {
};
+class HCompareSymbolEq: public HBinaryOperation {
+ public:
+ HCompareSymbolEq(HValue* left, HValue* right, Token::Value op)
+ : HBinaryOperation(left, right), op_(op) {
+ ASSERT(op == Token::EQ || op == Token::EQ_STRICT);
+ set_representation(Representation::Tagged());
+ SetFlag(kUseGVN);
+ SetFlag(kDependsOnMaps);
+ }
+
+ Token::Value op() const { return op_; }
+
+ virtual bool EmitAtUses() {
+ return !HasSideEffects() && !HasMultipleUses();
+ }
+
+ virtual Representation RequiredInputRepresentation(int index) const {
+ return Representation::Tagged();
+ }
+
+ virtual HType CalculateInferredType() { return HType::Boolean(); }
+
+ DECLARE_CONCRETE_INSTRUCTION(CompareSymbolEq);
+
+ protected:
+ virtual bool DataEquals(HValue* other) {
+ return op_ == HCompareSymbolEq::cast(other)->op_;
+ }
+
+ private:
+ const Token::Value op_;
+};
+
+
class HUnaryPredicate: public HUnaryOperation {
public:
explicit HUnaryPredicate(HValue* value) : HUnaryOperation(value) {
« no previous file with comments | « src/hydrogen.cc ('k') | src/ia32/lithium-codegen-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698