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

Unified Diff: src/codegen.cc

Issue 16513: Experimental: begin using the register allocator for switch statements... (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/toiger/
Patch Set: '' Created 11 years, 11 months 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 | src/codegen-ia32.cc » ('j') | src/codegen-ia32.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/codegen.cc
===================================================================
--- src/codegen.cc (revision 1027)
+++ src/codegen.cc (working copy)
@@ -442,9 +442,10 @@
CaseClause* clause = cases->at(i);
if (clause->is_default()) {
if (default_index >= 0) {
- return false; // More than one default label:
- // Defer to normal case for error.
- }
+ // There is more than one default label. Defer to the normal case
+ // for error.
+ return false;
+ }
default_index = i;
} else {
Expression* label = clause->label();
@@ -456,9 +457,9 @@
if (!value->IsSmi()) {
return false;
}
- int smi = Smi::cast(value)->value();
- if (smi < min_index) { min_index = smi; }
- if (smi > max_index) { max_index = smi; }
+ int int_value = Smi::cast(value)->value();
+ min_index = Min(int_value, min_index);
+ max_index = Max(int_value, max_index);
}
}
« no previous file with comments | « no previous file | src/codegen-ia32.cc » ('j') | src/codegen-ia32.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698