Revision: 10153
Author: [email protected]
Date: Mon Dec 5 02:51:51 2011
Log: 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
http://code.google.com/p/v8/source/detail?r=10153
Modified:
/branches/3.7/src/hydrogen.cc
/branches/3.7/src/version.cc
=======================================
--- /branches/3.7/src/hydrogen.cc Tue Nov 29 06:28:56 2011
+++ /branches/3.7/src/hydrogen.cc Mon Dec 5 02:51:51 2011
@@ -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,
=======================================
--- /branches/3.7/src/version.cc Mon Dec 5 01:55:08 2011
+++ /branches/3.7/src/version.cc Mon Dec 5 02:51:51 2011
@@ -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