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/
Review URL: http://codereview.chromium.org/8803011

git-svn-id: http://v8.googlecode.com/svn/branches/3.7@10153 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
diff --git a/src/hydrogen.cc b/src/hydrogen.cc
index 5c0703b..5cf6e3d 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -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,
diff --git a/src/version.cc b/src/version.cc
index 40a1d02..c15b210 100644
--- a/src/version.cc
+++ b/src/version.cc
@@ -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