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

Unified Diff: sdk/lib/_internal/compiler/implementation/js_backend/backend.dart

Issue 1259553002: Emit program and dependency information as relations in a Prolog database. Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 5 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: sdk/lib/_internal/compiler/implementation/js_backend/backend.dart
diff --git a/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart b/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart
index d599057ff83e0311cf392c7acd52140a44301d74..54b5acb6ce44d8f5ac0526ad86deda086007a6c6 100644
--- a/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart
+++ b/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart
@@ -282,6 +282,9 @@ class JavaScriptBackend extends Backend {
TypeVariableHandler typeVariableHandler;
+ static const bool DUMP_DEPENDENCIES =
+ const bool.fromEnvironment('DUMP_DEPENDENCIES');
+
/// Number of methods compiled before considering reflection.
int preMirrorsMethodCount = 0;
@@ -864,7 +867,10 @@ class JavaScriptBackend extends Backend {
registerCheckedModeHelpers(registry);
}
- onResolutionComplete() => rti.computeClassesNeedingRti();
+ onResolutionComplete() {
+ super.onResolutionComplete();
+ rti.computeClassesNeedingRti();
+ }
void onStringInterpolation(Registry registry) {
assert(registry.isForResolution);
@@ -1091,9 +1097,9 @@ class JavaScriptBackend extends Backend {
enqueueClass(compiler.enqueuer.resolution, compiler.stringClass, registry);
}
- void enableNoSuchMethod(Enqueuer world) {
+ void enableNoSuchMethod(context, Enqueuer world) {
enqueue(world, getCreateInvocationMirror(), compiler.globalDependencies);
- world.registerInvocation(compiler.noSuchMethodSelector);
+ world.registerInvocation(context, compiler.noSuchMethodSelector);
}
void onSuperNoSuchMethod(Registry registry) {
@@ -1300,6 +1306,19 @@ class JavaScriptBackend extends Backend {
}
}
}
+ if (true && DUMP_DEPENDENCIES) {
+ String representation(object) {
+ return "'$object'";
+ }
+ EventSink<String> output = compiler.outputProvider("", "pl");
+ [compiler.enqueuer.resolution, compiler.enqueuer.codegen].forEach((e) {
+ Relations deps = e.dependencies;
+ for (String relation in deps.links.keys) {
+ output.add('${deps.prefix}_$relation().\n');
+ }
+ });
+ output.close();
+ }
}
Element getDartClass(Element element) {

Powered by Google App Engine
This is Rietveld 408576698