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

Unified Diff: pkg/compiler/lib/src/dart_backend/backend.dart

Issue 1424923004: Add StaticUse for more precise registration of statically known element use. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Updated cf. comments. Created 5 years, 1 month 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 | « pkg/compiler/lib/src/compiler.dart ('k') | pkg/compiler/lib/src/deferred_load.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/dart_backend/backend.dart
diff --git a/pkg/compiler/lib/src/dart_backend/backend.dart b/pkg/compiler/lib/src/dart_backend/backend.dart
index 5db667a7cec186d11f6641fc0822571e1a432102..f26240bb4baae11eba242d7b39b77ce392e645fd 100644
--- a/pkg/compiler/lib/src/dart_backend/backend.dart
+++ b/pkg/compiler/lib/src/dart_backend/backend.dart
@@ -137,12 +137,12 @@ class DartBackend extends Backend {
}
// Enqueue the methods that the VM might invoke on user objects because
// we don't trust the resolution to always get these included.
- world.registerInvocation(new UniverseSelector(Selectors.toString_, null));
- world.registerInvokedGetter(
+ world.registerDynamicUse(new UniverseSelector(Selectors.toString_, null));
+ world.registerDynamicUse(
new UniverseSelector(Selectors.hashCode_, null));
- world.registerInvocation(
+ world.registerDynamicUse(
new UniverseSelector(new Selector.binaryOperator('=='), null));
- world.registerInvocation(
+ world.registerDynamicUse(
new UniverseSelector(Selectors.compareTo, null));
}
@@ -265,10 +265,7 @@ class DartBackend extends Backend {
Enqueuer enqueuer,
Registry registry,
{bool mirrorUsage: false}) {
- registerPlatformMembers(type,
- registerGetter: registry.registerDynamicGetter,
- registerSetter: registry.registerDynamicSetter,
- registerInvocation: registry.registerDynamicInvocation);
+ registerPlatformMembers(type, registerUse: registry.registerDynamicUse);
super.registerInstantiatedType(
type, enqueuer, registry, mirrorUsage: mirrorUsage);
}
@@ -277,9 +274,7 @@ class DartBackend extends Backend {
/// of types defined in the platform libraries.
void registerPlatformMembers(
InterfaceType type,
- {void registerGetter(UniverseSelector selector),
- void registerSetter(UniverseSelector selector),
- void registerInvocation(UniverseSelector selector)}) {
+ {void registerUse(UniverseSelector selector)}) {
// Without patching, dart2dart has no way of performing sound tree-shaking
// in face external functions. Therefore we employ another scheme:
@@ -331,16 +326,8 @@ class DartBackend extends Backend {
FunctionElement function = element.asFunctionElement();
element.computeType(resolution);
Selector selector = new Selector.fromElement(element);
- if (selector.isGetter) {
- registerGetter(
- new UniverseSelector(selector, null));
- } else if (selector.isSetter) {
- registerSetter(
- new UniverseSelector(selector, null));
- } else {
- registerInvocation(
- new UniverseSelector(selector, null));
- }
+ registerUse(
+ new UniverseSelector(selector, null));
});
}
}
@@ -376,9 +363,7 @@ class DartImpactTransformer extends ImpactTransformer {
// the world impact itself.
transformed.registerInstantiatedType(instantiatedType);
backend.registerPlatformMembers(instantiatedType,
- registerGetter: transformed.registerDynamicGetter,
- registerSetter: transformed.registerDynamicSetter,
- registerInvocation: transformed.registerDynamicInvocation);
+ registerUse: transformed.registerDynamicUse);
}
return transformed;
}
« no previous file with comments | « pkg/compiler/lib/src/compiler.dart ('k') | pkg/compiler/lib/src/deferred_load.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698