Revision: 6496
Author: [email protected]
Date: Wed Jan 26 07:28:17 2011
Log: 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

Review URL: http://codereview.chromium.org/6339014
http://code.google.com/p/v8/source/detail?r=6496

Modified:
 /branches/bleeding_edge/src/arm/full-codegen-arm.cc
 /branches/bleeding_edge/src/ia32/full-codegen-ia32.cc
 /branches/bleeding_edge/src/x64/full-codegen-x64.cc

=======================================
--- /branches/bleeding_edge/src/arm/full-codegen-arm.cc Wed Jan 26 00:32:54 2011 +++ /branches/bleeding_edge/src/arm/full-codegen-arm.cc Wed Jan 26 07:28:17 2011
@@ -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;
=======================================
--- /branches/bleeding_edge/src/ia32/full-codegen-ia32.cc Tue Jan 25 05:01:45 2011 +++ /branches/bleeding_edge/src/ia32/full-codegen-ia32.cc Wed Jan 26 07:28:17 2011
@@ -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;
=======================================
--- /branches/bleeding_edge/src/x64/full-codegen-x64.cc Tue Jan 25 05:01:45 2011 +++ /branches/bleeding_edge/src/x64/full-codegen-x64.cc Wed Jan 26 07:28:17 2011
@@ -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

Reply via email to