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

Unified Diff: src/rewriter.cc

Issue 42127: Reenable the duplicated test at the bottom of for and while loops. It... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years, 9 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
« src/ast.h ('K') | « src/jump-target.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/rewriter.cc
===================================================================
--- src/rewriter.cc (revision 1501)
+++ src/rewriter.cc (working copy)
@@ -42,6 +42,10 @@
void Optimize(ZoneList<Statement*>* statements);
private:
+ // Used for loop condition analysis. Cleared before visiting a loop
+ // condition, set when a function literal is visited.
+ bool has_function_literal_;
+
// Helpers
void OptimizeArguments(ZoneList<Expression*>* arguments);
@@ -89,14 +93,14 @@
}
-
-
void AstOptimizer::VisitLoopStatement(LoopStatement* node) {
if (node->init() != NULL) {
Visit(node->init());
}
if (node->cond() != NULL) {
+ has_function_literal_ = false;
Visit(node->cond());
+ node->has_function_literal_ = has_function_literal_;
}
if (node->body() != NULL) {
Visit(node->body());
@@ -182,6 +186,7 @@
void AstOptimizer::VisitFunctionLiteral(FunctionLiteral* node) {
USE(node);
+ has_function_literal_ = true;
}
« src/ast.h ('K') | « src/jump-target.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698