Fix a test in the IA32 code generator for whether loop conditions

contain function literals.  The test was not conservative enough.

Review URL: http://codereview.chromium.org/42138

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1504 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
kmillikin@chromium.org 2009-03-12 19:49:19 +00:00
parent 03d7c6bd1d
commit 30af089bc5

View File

@ -2231,7 +2231,8 @@ void CodeGenerator::VisitLoopStatement(LoopStatement* node) {
// Do not duplicate conditions with function literal
// subexpressions. This can cause us to compile the function
// literal twice.
bool test_at_bottom = !node->has_function_literal();
bool test_at_bottom =
!scope_->is_global_scope() && !node->has_function_literal();
IncrementLoopNesting();
@ -2329,7 +2330,8 @@ void CodeGenerator::VisitLoopStatement(LoopStatement* node) {
// Do not duplicate conditions with function literal
// subexpressions. This can cause us to compile the function
// literal twice.
bool test_at_bottom = !node->has_function_literal();
bool test_at_bottom =
!scope_->is_global_scope() && !node->has_function_literal();
// Compile the init expression if present.
if (node->init() != NULL) {