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

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

Issue 10537025: Prototype re-compiling methods in dart2js (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed review comments from ager@ Created 8 years, 6 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/world.dart
diff --git a/lib/compiler/implementation/world.dart b/lib/compiler/implementation/world.dart
index f616c5aa4c892251aa2f5984e0c03e6980e8324a..12ce7c878e5f8c016680ef723b545b25c6be0e2e 100644
--- a/lib/compiler/implementation/world.dart
+++ b/lib/compiler/implementation/world.dart
@@ -4,8 +4,10 @@
class World {
final Map<ClassElement, Set<ClassElement>> subtypes;
+ final Map<ClassElement, Set<SourceString>> setters;
- World() : subtypes = new Map<ClassElement, Set<ClassElement>>();
+ World() : subtypes = new Map<ClassElement, Set<ClassElement>>(),
+ setters = new Map<ClassElement, Set<SourceString>>();
void populate(Compiler compiler, Collection<LibraryElement> libraries) {
void addSubtypes(ClassElement cls) {
@@ -69,6 +71,18 @@ class World {
});
return (fieldCount == 1 && nonFieldCount == 0) ? field : null;
}
+
+ void setterUsed(Type type, SourceString member) {
+ Set<SourceString> settersForClass =
+ setters.putIfAbsent(type.element, () => new Set<SourceString>());
+ settersForClass.add(member);
+ }
+
+ bool isSetterUsed(Type type, SourceString member) {
+ Set<SourceString> settersForClass = setters[type.element];
+ if (settersForClass === null) return false;
+ return settersForClass.contains(member);
+ }
}
/**
@@ -85,4 +99,12 @@ class MemberSet {
}
bool isEmpty() => elements.isEmpty();
+
+ String toString() {
+ StringBuffer sb = new StringBuffer();
+ sb.add("MemberSet: {");
+ elements.every((Element element) => sb.add("${element.name}, "));
+ sb.add("}");
+ return sb.toString();
+ }
}
« lib/compiler/implementation/ssa/builder.dart ('K') | « lib/compiler/implementation/ssa/optimize.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698