Chromium Code Reviews

Unified Diff: src/ast.h

Issue 8373029: [hydrogen] optimize switch with string clauses (Closed) Base URL: gh:v8/v8@master
Patch Set: remove fishy assigns Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Index: src/ast.h
diff --git a/src/ast.h b/src/ast.h
index 295257aaebdeb4a0b716af0f604930062d8c80d5..bae7d15c4cd3747c1e1c8455f39acf538a8c6d52 100644
--- a/src/ast.h
+++ b/src/ast.h
@@ -684,6 +684,8 @@ class CaseClause: public ZoneObject {
// Type feedback information.
void RecordTypeFeedback(TypeFeedbackOracle* oracle);
bool IsSmiCompare() { return compare_type_ == SMI_ONLY; }
+ bool IsSymbolCompare() { return compare_type_ == SYMBOL_ONLY; }
+ bool IsStringCompare() { return compare_type_ == STRING_ONLY; }
bool IsObjectCompare() { return compare_type_ == OBJECT_ONLY; }
private:
@@ -691,7 +693,13 @@ class CaseClause: public ZoneObject {
Label body_target_;
ZoneList<Statement*>* statements_;
int position_;
- enum CompareTypeFeedback { NONE, SMI_ONLY, OBJECT_ONLY };
+ enum CompareTypeFeedback {
+ NONE,
+ SMI_ONLY,
+ SYMBOL_ONLY,
+ STRING_ONLY,
+ OBJECT_ONLY
+ };
CompareTypeFeedback compare_type_;
int compare_id_;
int entry_id_;

Powered by Google App Engine