Reviewers: iposva, Description: Fix a test in the IA32 code generator for whether loop conditions contain function literals. The test was not conservative enough.
Please review this at http://codereview.chromium.org/42138 SVN Base: http://v8.googlecode.com/svn/branches/bleeding_edge/ Affected files: M src/codegen-ia32.cc Index: src/codegen-ia32.cc =================================================================== --- src/codegen-ia32.cc (revision 1503) +++ src/codegen-ia32.cc (working copy) @@ -2231,7 +2231,8 @@ // 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 @@ // 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) { --~--~---------~--~----~------------~-------~--~----~ v8-dev mailing list [email protected] http://groups.google.com/group/v8-dev -~----------~----~----~----~------~----~------~--~---
