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

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

Issue 10908012: Support checked mode for field setters. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 4 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: lib/compiler/implementation/enqueue.dart
===================================================================
--- lib/compiler/implementation/enqueue.dart (revision 11628)
+++ lib/compiler/implementation/enqueue.dart (working copy)
@@ -163,19 +163,27 @@
void processInstantiatedClassMember(Element member) {
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);
+ if (compiler.enableTypeAssertions) {
ahe 2012/08/31 09:46:51 This doesn't feel like the right place for this.
+ Type type = member.computeType(compiler);
+ registerIsCheck(type.element);
+ SourceString helper = compiler.backend.getCheckedModeHelper(type);
ahe 2012/08/31 09:46:51 And this is feeling even wronger :-)
ngeoffray 2012/09/05 13:00:29 Agree. Fix is in https://chromiumcodereview.appspo
+ 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>());
instanceMembersByName[memberName] = members.prepend(member);
- if (member.kind === ElementKind.GETTER ||
- member.kind === ElementKind.FIELD) {
- universe.instantiatedClassInstanceFields.add(member.name);
- }
if (member.kind == ElementKind.FUNCTION) {
if (member.name == Compiler.NO_SUCH_METHOD) {
@@ -194,6 +202,7 @@
return addToWorkList(member);
}
} else if (member.kind == ElementKind.GETTER) {
+ universe.instantiatedClassInstanceFields.add(member.name);
if (universe.hasInvokedGetter(member, compiler)) {
return addToWorkList(member);
}
« no previous file with comments | « lib/compiler/implementation/elements/elements.dart ('k') | lib/compiler/implementation/js_backend/backend.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698