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

Unified Diff: runtime/vm/intermediate_language.cc

Issue 25898002: Skip AssertAssignable in code generator if optimizer could establish that (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 2 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 | tests/co19/co19-runtime.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intermediate_language.cc
===================================================================
--- runtime/vm/intermediate_language.cc (revision 28233)
+++ runtime/vm/intermediate_language.cc (working copy)
@@ -1429,7 +1429,16 @@
TypeArguments::Cast(constant_type_args->value());
const AbstractType& new_dst_type = AbstractType::Handle(
dst_type().InstantiateFrom(instantiator_type_args, NULL));
+ // If dst_type is instantiated to dynamic or Object, skip the test.
+ if (!new_dst_type.IsMalformed() && !new_dst_type.IsMalbounded() &&
+ (new_dst_type.IsDynamicType() || new_dst_type.IsObjectType())) {
+ return value()->definition();
+ }
set_dst_type(AbstractType::ZoneHandle(new_dst_type.Canonicalize()));
+ if (FLAG_eliminate_type_checks &&
+ value()->Type()->IsAssignableTo(dst_type())) {
+ return value()->definition();
+ }
ConstantInstr* null_constant = flow_graph->constant_null();
instantiator_type_arguments()->BindTo(null_constant);
}
« no previous file with comments | « no previous file | tests/co19/co19-runtime.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698