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

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

Issue 11017006: Create and use new change/depends flags for the GVN analysis. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 2 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/ssa/nodes.dart ('k') | tests/language/language_dart2js.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/compiler/implementation/world.dart
===================================================================
--- lib/compiler/implementation/world.dart (revision 13214)
+++ lib/compiler/implementation/world.dart (working copy)
@@ -8,10 +8,12 @@
final Set<ClassElement> classesNeedingRti;
final Map<ClassElement, Set<ClassElement>> rtiDependencies;
final FunctionSet userDefinedGetters;
+ final FunctionSet userDefinedSetters;
World(Compiler compiler)
: subtypes = new Map<ClassElement, Set<ClassElement>>(),
userDefinedGetters = new FunctionSet(compiler),
+ userDefinedSetters = new FunctionSet(compiler),
classesNeedingRti = new Set<ClassElement>(),
rtiDependencies = new Map<ClassElement, Set<ClassElement>>(),
this.compiler = compiler;
@@ -89,15 +91,28 @@
userDefinedGetters.add(element);
}
+ void recordUserDefinedSetter(Element element) {
+ assert(element.isSetter());
+ userDefinedSetters.add(element);
+ }
+
bool hasAnyUserDefinedGetter(Selector selector) {
return userDefinedGetters.hasAnyElementMatchingSelector(selector);
}
+ bool hasAnyUserDefinedSetter(Selector selector) {
+ return userDefinedSetters.hasAnyElementMatchingSelector(selector);
+ }
+
void registerUsedElement(Element element) {
- if (element.isMember() && element.isGetter()) {
- // We're collecting user-defined getters to let the codegen know which
- // field accesses might have side effects.
- userDefinedGetters.add(element);
+ if (element.isMember()) {
+ if (element.isGetter()) {
+ // We're collecting user-defined getters to let the codegen know which
+ // field accesses might have side effects.
+ recordUserDefinedGetter(element);
+ } else if (element.isSetter()) {
+ recordUserDefinedSetter(element);
+ }
}
}
« no previous file with comments | « lib/compiler/implementation/ssa/nodes.dart ('k') | tests/language/language_dart2js.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698