Reviewers: Kevin Millikin, Description: Fix issue 1076 by resetting labels of switch-clauses before use.
If we compile a function literal twice with the full code generator, we must make sure that the labels embedded in the AST are reset. BUG=1076 Please review this at http://codereview.chromium.org/6339014/ SVN Base: http://v8.googlecode.com/svn/branches/bleeding_edge/ Affected files: M src/arm/full-codegen-arm.cc M src/ia32/full-codegen-ia32.cc M src/x64/full-codegen-x64.cc Index: src/arm/full-codegen-arm.cc =================================================================== --- src/arm/full-codegen-arm.cc (revision 6492) +++ src/arm/full-codegen-arm.cc (working copy) @@ -734,6 +734,8 @@ // Compile all the tests with branches to their bodies. for (int i = 0; i < clauses->length(); i++) { CaseClause* clause = clauses->at(i); + clause->body_target()->entry_label()->Unuse(); + // The default is not a test, but remember it as final fall through. if (clause->is_default()) { default_clause = clause; Index: src/ia32/full-codegen-ia32.cc =================================================================== --- src/ia32/full-codegen-ia32.cc (revision 6492) +++ src/ia32/full-codegen-ia32.cc (working copy) @@ -764,6 +764,8 @@ // Compile all the tests with branches to their bodies. for (int i = 0; i < clauses->length(); i++) { CaseClause* clause = clauses->at(i); + clause->body_target()->entry_label()->Unuse(); + // The default is not a test, but remember it as final fall through. if (clause->is_default()) { default_clause = clause; Index: src/x64/full-codegen-x64.cc =================================================================== --- src/x64/full-codegen-x64.cc (revision 6492) +++ src/x64/full-codegen-x64.cc (working copy) @@ -710,6 +710,8 @@ // Compile all the tests with branches to their bodies. for (int i = 0; i < clauses->length(); i++) { CaseClause* clause = clauses->at(i); + clause->body_target()->entry_label()->Unuse(); + // The default is not a test, but remember it as final fall through. if (clause->is_default()) { default_clause = clause; -- v8-dev mailing list [email protected] http://groups.google.com/group/v8-dev
