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

Unified Diff: lib/compiler/implementation/enqueue.dart

Issue 10910088: Fix host-checked + checked by registering when a class is being instantiated, not when being proces… (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 | « lib/compiler/implementation/compiler.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/compiler/implementation/enqueue.dart
===================================================================
--- lib/compiler/implementation/enqueue.dart (revision 11873)
+++ lib/compiler/implementation/enqueue.dart (working copy)
@@ -169,21 +169,8 @@
if (universe.generatedCode.containsKey(member)) return;
if (resolvedElements[member] !== null) return;
if (!member.isInstanceMember()) return;
+ if (member.isField()) return;
- if (member.kind === ElementKind.FIELD) {
- universe.instantiatedClassInstanceFields.add(member.name);
ahe 2012/09/05 12:52:04 I think this field is unused. Could you remove it
ngeoffray 2012/09/05 12:57:30 Done.
- if (compiler.enableTypeAssertions) {
- DartType type = member.computeType(compiler);
- registerIsCheck(type.element);
- SourceString helper = compiler.backend.getCheckedModeHelper(type);
- if (helper != null) {
- Element helperElement = compiler.findHelper(helper);
- registerStaticUse(helperElement);
- }
- }
- return;
- }
-
String memberName = member.name.slowToString();
Link<Element> members = instanceMembersByName.putIfAbsent(
memberName, () => const EmptyLink<Element>());
@@ -241,6 +228,21 @@
if (isResolutionQueue) {
compiler.resolver.checkMembers(cls);
}
+
+ if (compiler.enableTypeAssertions) {
ahe 2012/09/05 12:52:04 This still doesn't feel right.
ngeoffray 2012/09/05 12:57:30 Added a TODO.
+ // We need to register is checks and helpers for checking
+ // assignments to fields.
+ cls.localMembers.forEach((Element member) {
+ if (!member.isInstanceMember() && !member.isField()) return;
+ DartType type = member.computeType(compiler);
+ registerIsCheck(type.element);
+ SourceString helper = compiler.backend.getCheckedModeHelper(type);
+ if (helper != null) {
+ Element helperElement = compiler.findHelper(helper);
+ registerStaticUse(helperElement);
+ }
+ });
+ }
}
});
}
« no previous file with comments | « lib/compiler/implementation/compiler.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698