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

Unified Diff: src/hydrogen.cc

Issue 98643010: Fix switch statements with non-Smi integer labels and no type feedback (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 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 | test/mjsunit/regress/regress-crbug-329709.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/hydrogen.cc
diff --git a/src/hydrogen.cc b/src/hydrogen.cc
index e8f7a44cac3ad7c1afcbfcd4828fc9d1cbc035e0..cccfa5b041ee7ee3cf12f747f69dea295f0fcd32 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -9170,15 +9170,6 @@ void HOptimizedGraphBuilder::VisitCompareOperation(CompareOperation* expr) {
return ast_context()->ReturnInstruction(result, expr->id());
}
- // Cases handled below depend on collected type feedback. They should
- // soft deoptimize when there is no type feedback.
- if (combined_type->Is(Type::None())) {
- Add<HDeoptimize>("Insufficient type feedback for combined type "
- "of binary operation",
- Deoptimizer::SOFT);
- combined_type = left_type = right_type = handle(Type::Any(), isolate());
- }
-
HControlInstruction* compare = BuildCompareInstruction(
op, left, right, left_type, right_type, combined_type,
expr->left()->position(), expr->right()->position(), expr->id());
@@ -9197,6 +9188,15 @@ HControlInstruction* HOptimizedGraphBuilder::BuildCompareInstruction(
int left_position,
int right_position,
BailoutId bailout_id) {
+ // Cases handled below depend on collected type feedback. They should
+ // soft deoptimize when there is no type feedback.
+ if (combined_type->Is(Type::None())) {
+ Add<HDeoptimize>("Insufficient type feedback for combined type "
+ "of binary operation",
+ Deoptimizer::SOFT);
+ combined_type = left_type = right_type = handle(Type::Any(), isolate());
+ }
+
Representation left_rep = Representation::FromType(left_type);
Representation right_rep = Representation::FromType(right_type);
Representation combined_rep = Representation::FromType(combined_type);
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-crbug-329709.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698