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

Unified Diff: src/ast.h

Issue 507040: -Inlined double variant of compare iff one of the sides is a constant smi and... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 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
« no previous file with comments | « no previous file | src/compiler.cc » ('j') | src/ia32/codegen-ia32.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ast.h
===================================================================
--- src/ast.h (revision 3485)
+++ src/ast.h (working copy)
@@ -139,6 +139,7 @@
virtual MaterializedLiteral* AsMaterializedLiteral() { return NULL; }
virtual ObjectLiteral* AsObjectLiteral() { return NULL; }
virtual ArrayLiteral* AsArrayLiteral() { return NULL; }
+ virtual CompareOperation* AsCompareOperation() { return NULL; }
};
@@ -1185,7 +1186,7 @@
class CompareOperation: public Expression {
public:
CompareOperation(Token::Value op, Expression* left, Expression* right)
- : op_(op), left_(left), right_(right) {
+ : op_(op), left_(left), right_(right), is_for_loop_condition_(false) {
ASSERT(Token::IsCompareOp(op));
}
@@ -1195,10 +1196,18 @@
Expression* left() const { return left_; }
Expression* right() const { return right_; }
+ // Accessors for flag whether this compare operation is hanging of a for loop.
+ bool is_for_loop_condition() const { return is_for_loop_condition_; }
+ void set_is_for_loop_condition() { is_for_loop_condition_ = true; }
+
+ // Type testing & conversion
+ virtual CompareOperation* AsCompareOperation() { return this; }
+
private:
Token::Value op_;
Expression* left_;
Expression* right_;
+ bool is_for_loop_condition_;
};
« no previous file with comments | « no previous file | src/compiler.cc » ('j') | src/ia32/codegen-ia32.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698