Index: sdk/lib/_internal/compiler/implementation/enqueue.dart |
=================================================================== |
--- sdk/lib/_internal/compiler/implementation/enqueue.dart (revision 18614) |
+++ sdk/lib/_internal/compiler/implementation/enqueue.dart (working copy) |
@@ -67,6 +67,7 @@ |
// runtime type. |
if (element.isGetter() && element.name == Compiler.RUNTIME_TYPE) { |
compiler.enabledRuntimeType = true; |
+ compiler.backend.registerRuntimeType(); |
} else if (element == compiler.functionApplyMethod) { |
compiler.enabledFunctionApply = true; |
} else if (element == compiler.invokeOnMethod) { |
@@ -205,22 +206,6 @@ |
if (isResolutionQueue) { |
compiler.resolver.checkClass(cls); |
} |
- |
- if (compiler.enableTypeAssertions) { |
- // We need to register is checks and helpers for checking |
- // assignments to fields. |
- // TODO(ngeoffray): This should really move to the backend. |
- cls.forEachLocalMember((Element member) { |
- if (!member.isInstanceMember() || !member.isField()) return; |
- DartType type = member.computeType(compiler); |
- registerIsCheck(type); |
- SourceString helper = compiler.backend.getCheckedModeHelper(type); |
- if (helper != null) { |
- Element helperElement = compiler.findHelper(helper); |
- registerStaticUse(helperElement); |
- } |
- }); |
- } |
} |
processClass(cls); |
for (Link<DartType> supertypes = cls.allSupertypes; |
@@ -364,8 +349,14 @@ |
void registerIsCheck(DartType type) { |
universe.isChecks.add(type); |
+ compiler.backend.registerIsCheck(type, this); |
} |
+ void registerAsCheck(DartType type) { |
+ registerIsCheck(type); |
+ compiler.backend.registerAsCheck(type); |
+ } |
+ |
void forEach(f(WorkItem work)); |
void logSummary(log(message)) { |