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:
parent
03d7c6bd1d
commit
30af089bc5
@ -2231,7 +2231,8 @@ void CodeGenerator::VisitLoopStatement(LoopStatement* node) {
|
|||||||
// Do not duplicate conditions with function literal
|
// Do not duplicate conditions with function literal
|
||||||
// subexpressions. This can cause us to compile the function
|
// subexpressions. This can cause us to compile the function
|
||||||
// literal twice.
|
// literal twice.
|
||||||
bool test_at_bottom = !node->has_function_literal();
|
bool test_at_bottom =
|
||||||
|
!scope_->is_global_scope() && !node->has_function_literal();
|
||||||
|
|
||||||
IncrementLoopNesting();
|
IncrementLoopNesting();
|
||||||
|
|
||||||
@ -2329,7 +2330,8 @@ void CodeGenerator::VisitLoopStatement(LoopStatement* node) {
|
|||||||
// Do not duplicate conditions with function literal
|
// Do not duplicate conditions with function literal
|
||||||
// subexpressions. This can cause us to compile the function
|
// subexpressions. This can cause us to compile the function
|
||||||
// literal twice.
|
// 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.
|
// Compile the init expression if present.
|
||||||
if (node->init() != NULL) {
|
if (node->init() != NULL) {
|
||||||
|
Loading…
Reference in New Issue
Block a user