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

Unified Diff: src/hydrogen.cc

Issue 18465003: Fix default type feedback returned from the oracle (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: added comments Created 7 years, 6 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/type-info.cc » ('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 432a6bc5fcd63fe08b81bb60ea30c91747a2218e..e8ff53ff1f8df9336bce91edb917495251ee0521 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -9244,12 +9244,6 @@ void HOptimizedGraphBuilder::VisitCompareOperation(CompareOperation* expr) {
Representation combined_rep = ToRepresentation(combined_type);
Representation left_rep = ToRepresentation(left_type);
Representation right_rep = ToRepresentation(right_type);
- // Check if this expression was ever executed according to type feedback.
- // Note that for the special typeof/null/undefined cases we get unknown here.
- if (combined_type->Is(Type::None())) {
- AddSoftDeoptimize();
- combined_type = left_type = right_type = handle(Type::Any(), isolate());
- }
CHECK_ALIVE(VisitForValue(expr->left()));
CHECK_ALIVE(VisitForValue(expr->right()));
@@ -9316,11 +9310,23 @@ void HOptimizedGraphBuilder::VisitCompareOperation(CompareOperation* expr) {
result->set_position(expr->position());
return ast_context()->ReturnInstruction(result, expr->id());
}
+
+ // Code below assumes that we don't fall through.
+ UNREACHABLE();
} else if (op == Token::IN) {
HIn* result = new(zone()) HIn(context, left, right);
result->set_position(expr->position());
return ast_context()->ReturnInstruction(result, expr->id());
- } else if (combined_type->Is(Type::Receiver())) {
+ }
+
+ // Cases handled below depend on collected type feedback. They should
+ // soft deoptimize when there is no type feedback.
+ if (combined_type->Is(Type::None())) {
+ AddSoftDeoptimize();
+ combined_type = left_type = right_type = handle(Type::Any(), isolate());
+ }
+
+ if (combined_type->Is(Type::Receiver())) {
switch (op) {
case Token::EQ:
case Token::EQ_STRICT: {
« no previous file with comments | « no previous file | src/type-info.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698