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

Unified Diff: sdk/lib/_internal/compiler/implementation/ssa/builder.dart

Issue 15735003: Use assertSubtype for lists. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add test. Created 7 years, 7 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
Index: sdk/lib/_internal/compiler/implementation/ssa/builder.dart
diff --git a/sdk/lib/_internal/compiler/implementation/ssa/builder.dart b/sdk/lib/_internal/compiler/implementation/ssa/builder.dart
index 66f93b0041e8fc959516172aeb503ff5eec2f4b4..e74a102396fdbb7eb435c18a1586799eee93d41e 100644
--- a/sdk/lib/_internal/compiler/implementation/ssa/builder.dart
+++ b/sdk/lib/_internal/compiler/implementation/ssa/builder.dart
@@ -2841,7 +2841,7 @@ class SsaBuilder extends ResolvedVisitor implements Visitor {
return new HIs(type, <HInstruction>[expression, call],
HIs.VARIABLE_CHECK);
} else if (RuntimeTypes.hasTypeArguments(type)) {
- Element element = type.element;
+ ClassElement element = type.element;
Element helper = backend.getCheckSubtype();
HInstruction representations =
buildTypeArgumentRepresentations(type);
@@ -2849,10 +2849,9 @@ class SsaBuilder extends ResolvedVisitor implements Visitor {
String operator =
backend.namer.operatorIs(backend.getImplementationClass(element));
HInstruction isFieldName = addConstantString(node, operator);
- // TODO(karlklose): use [:null:] for [asField] if [element] does not
- // have a subclass.
- HInstruction asFieldName =
- addConstantString(node, backend.namer.substitutionName(element));
+ HInstruction asFieldName = compiler.world.hasAnySubtype(element)
+ ? addConstantString(node, backend.namer.substitutionName(element))
+ : graph.addConstantNull(constantSystem);
List<HInstruction> inputs = <HInstruction>[expression,
isFieldName,
representations,
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/js_backend/backend.dart ('k') | tests/language/generic_list_checked_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698