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

Unified Diff: src/ia32/lithium-ia32.h

Issue 8373029: [hydrogen] optimize switch with string clauses (Closed) Base URL: gh:v8/v8@master
Patch Set: use type feedback to bailout switches with known beforehand string(non-symbol) comparison Created 9 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
Index: src/ia32/lithium-ia32.h
diff --git a/src/ia32/lithium-ia32.h b/src/ia32/lithium-ia32.h
index 98487b463019b1606f304bdcda89a1fe31ff4f29..1b18696e2b0faaa46e7a1237ac185900627b2775 100644
--- a/src/ia32/lithium-ia32.h
+++ b/src/ia32/lithium-ia32.h
@@ -103,8 +103,10 @@ class LCodeGen;
V(IsConstructCallAndBranch) \
V(IsNilAndBranch) \
V(IsObjectAndBranch) \
+ V(IsStringAndBranch) \
V(IsSmiAndBranch) \
V(IsUndetectableAndBranch) \
+ V(CompareGenericAndBranch) \
V(JSArrayLength) \
V(Label) \
V(LazyBailout) \
@@ -643,6 +645,19 @@ class LIsObjectAndBranch: public LControlInstruction<1, 1> {
};
+class LIsStringAndBranch: public LControlInstruction<1, 1> {
+ public:
+ LIsStringAndBranch(LOperand* value, LOperand* temp) {
+ inputs_[0] = value;
+ temps_[0] = temp;
+ }
+
+ DECLARE_CONCRETE_INSTRUCTION(IsStringAndBranch, "is-string-and-branch")
+
+ virtual void PrintDataTo(StringStream* stream);
+};
+
+
class LIsSmiAndBranch: public LControlInstruction<1, 0> {
public:
explicit LIsSmiAndBranch(LOperand* value) {
@@ -670,6 +685,24 @@ class LIsUndetectableAndBranch: public LControlInstruction<1, 1> {
};
+class LCompareGenericAndBranch: public LControlInstruction<3, 0> {
+ public:
+ LCompareGenericAndBranch(LOperand* context, LOperand* left, LOperand* right) {
+ inputs_[0] = context;
+ inputs_[1] = left;
+ inputs_[2] = right;
+ }
+
+ DECLARE_CONCRETE_INSTRUCTION(CompareGenericAndBranch,
+ "compare-generic-and-branch")
+ DECLARE_HYDROGEN_ACCESSOR(CompareGenericAndBranch)
+
+ virtual void PrintDataTo(StringStream* stream);
+
+ Token::Value op() const { return hydrogen()->token(); }
+};
+
+
class LHasInstanceTypeAndBranch: public LControlInstruction<1, 1> {
public:
LHasInstanceTypeAndBranch(LOperand* value, LOperand* temp) {

Powered by Google App Engine
This is Rietveld 408576698