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

Unified Diff: runtime/vm/flow_graph_builder.cc

Issue 10942006: Fix bad optimization of instance-of with uninstantiated types (issue 5216). (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 3 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 | runtime/vm/flow_graph_optimizer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_builder.cc
===================================================================
--- runtime/vm/flow_graph_builder.cc (revision 12501)
+++ runtime/vm/flow_graph_builder.cc (working copy)
@@ -568,9 +568,10 @@
// Propagated types are not set yet.
// More checks will possibly be eliminated during type propagation.
- const bool eliminated = value->CompileTypeIsMoreSpecificThan(dst_type);
- // Note: 'eliminated' is true for a null constant value, since its type,
- // i.e. bottom type, is more specific than any type.
+ bool is_null, is_instance;
+ const bool eliminated =
+ (value->CanComputeIsNull(&is_null) && is_null) ||
+ (value->CanComputeIsInstanceOf(dst_type, &is_instance) && is_instance);
if (FLAG_trace_type_check_elimination) {
FlowGraphPrinter::PrintTypeCheck(owner()->parsed_function(),
token_pos,
« no previous file with comments | « no previous file | runtime/vm/flow_graph_optimizer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698