Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(260)

Unified Diff: src/hydrogen.cc

Issue 8776048: Fix a bug with deoptimization from inside the default-clause of a switch-statement. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/hydrogen.cc
===================================================================
--- src/hydrogen.cc (revision 10143)
+++ 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,
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698