Reviewers: danno,

Description:
Merge r10145 to 3.7 branch: Fix a bug with deoptimization from inside the
default-clause of a switch-statement.

Original CL: http://codereview.chromium.org/8776048/

Please review this at http://codereview.chromium.org/8803011/

SVN Base: http://v8.googlecode.com/svn/branches/3.7/

Affected files:
  M     src/hydrogen.cc
  M     src/version.cc


Index: src/hydrogen.cc
===================================================================
--- src/hydrogen.cc     (revision 10152)
+++ src/hydrogen.cc     (working copy)
@@ -2756,10 +2756,13 @@
   }

   // 2. Build all the tests, with dangling true branches
+  int default_id = AstNode::kNoNumber;
   for (int i = 0; i < clause_count; ++i) {
     CaseClause* clause = clauses->at(i);
-    if (clause->is_default()) continue;
-
+    if (clause->is_default()) {
+      default_id = clause->EntryId();
+      continue;
+    }
     if (switch_type == SMI_SWITCH) {
       clause->RecordTypeFeedback(oracle());
     }
@@ -2806,7 +2809,10 @@
   HBasicBlock* last_block = current_block();

   if (not_string_block != NULL) {
-    last_block = CreateJoin(last_block, not_string_block, stmt->ExitId());
+    int join_id = (default_id != AstNode::kNoNumber)
+        ? default_id
+        : stmt->ExitId();
+    last_block = CreateJoin(last_block, not_string_block, join_id);
   }

   // 3. Loop over the clauses and the linked list of tests in lockstep,
Index: src/version.cc
===================================================================
--- src/version.cc      (revision 10152)
+++ src/version.cc      (working copy)
@@ -35,7 +35,7 @@
 #define MAJOR_VERSION     3
 #define MINOR_VERSION     7
 #define BUILD_NUMBER      12
-#define PATCH_LEVEL       3
+#define PATCH_LEVEL       4
 // Use 1 for candidates and 0 otherwise.
 // (Boolean macro values are not supported by all preprocessors.)
 #define IS_CANDIDATE_VERSION 0


--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to