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

Unified Diff: src/codegen-ia32.cc

Issue 42562: Make the "has function literal" default value for loops conservative.... (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
« no previous file with comments | « src/ast.h ('k') | src/rewriter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/codegen-ia32.cc
===================================================================
--- src/codegen-ia32.cc (revision 1599)
+++ src/codegen-ia32.cc (working copy)
@@ -2261,11 +2261,10 @@
}
case LoopStatement::WHILE_LOOP: {
- // Do not duplicate conditions with function literal
+ // Do not duplicate conditions that may have function literal
// subexpressions. This can cause us to compile the function
// literal twice.
- bool test_at_bottom =
- !scope_->is_global_scope() && !node->has_function_literal();
+ bool test_at_bottom = !node->may_have_function_literal();
IncrementLoopNesting();
@@ -2360,11 +2359,10 @@
}
case LoopStatement::FOR_LOOP: {
- // Do not duplicate conditions with function literal
+ // Do not duplicate conditions that may have function literal
// subexpressions. This can cause us to compile the function
// literal twice.
- bool test_at_bottom =
- !scope_->is_global_scope() && !node->has_function_literal();
+ bool test_at_bottom = !node->may_have_function_literal();
// Compile the init expression if present.
if (node->init() != NULL) {
« no previous file with comments | « src/ast.h ('k') | src/rewriter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698