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

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

Issue 90713003: Dart2js option to dump info about compilation (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years 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/compiler.dart
diff --git a/sdk/lib/_internal/compiler/implementation/compiler.dart b/sdk/lib/_internal/compiler/implementation/compiler.dart
index c49df9d921878e373d5d327bc44e42ba6cc709c6..7ec48ceb6584941d97872b0bc8619340fdd2149f 100644
--- a/sdk/lib/_internal/compiler/implementation/compiler.dart
+++ b/sdk/lib/_internal/compiler/implementation/compiler.dart
@@ -11,11 +11,6 @@ part of dart2js;
const bool REPORT_EXCESS_RESOLUTION = false;
/**
- * If true, dump the inferred types after compilation.
- */
-const bool DUMP_INFERRED_TYPES = false;
-
-/**
* Contains backend-specific data that is used throughout the compilation of
* one work item.
*/
@@ -85,6 +80,10 @@ abstract class Backend {
[ConstantSystem constantSystem = DART_CONSTANT_SYSTEM])
: this.constantSystem = constantSystem;
+ // Given a [FunctionElement], return a buffer with the code generated for it
+ // or null if no code was generated.
+ CodeBuffer codeOf(Element element) => null;
+
void initializeHelperClasses() {}
void enqueueHelpers(ResolutionEnqueuer world, TreeElements elements);
@@ -104,9 +103,6 @@ abstract class Backend {
void onResolutionComplete() {}
- // TODO(ahe,karlklose): rename this?
- void dumpInferredTypes() {}
-
ItemCompilationContext createItemCompilationContext() {
return new ItemCompilationContext();
}
@@ -362,6 +358,7 @@ abstract class Compiler implements DiagnosticListener {
final bool trustTypeAnnotations;
final bool enableConcreteTypeInference;
final bool disableTypeInferenceFlag;
+ final bool dumpInfo;
/**
* The maximum size of a concrete type before it widens to dynamic during
@@ -543,6 +540,7 @@ abstract class Compiler implements DiagnosticListener {
EnqueueTask enqueuer;
DeferredLoadTask deferredLoadTask;
MirrorUsageAnalyzerTask mirrorUsageAnalyzerTask;
+ DumpInfoTask dumpInfoTask;
String buildId;
static const String MAIN = 'main';
@@ -616,6 +614,7 @@ abstract class Compiler implements DiagnosticListener {
this.sourceMapUri: null,
this.buildId: UNDETERMINED_BUILD_ID,
this.terseDiagnostics: false,
+ this.dumpInfo: false,
outputProvider,
List<String> strips: const []})
: this.analyzeOnly = analyzeOnly || analyzeSignaturesOnly,
@@ -653,7 +652,8 @@ abstract class Compiler implements DiagnosticListener {
constantHandler = new ConstantHandler(this, backend.constantSystem),
deferredLoadTask = new DeferredLoadTask(this),
mirrorUsageAnalyzerTask = new MirrorUsageAnalyzerTask(this),
- enqueuer = new EnqueueTask(this)];
+ enqueuer = new EnqueueTask(this),
+ dumpInfoTask = new DumpInfoTask(this)];
tasks.addAll(backend.tasks);
}
@@ -1130,6 +1130,10 @@ abstract class Compiler implements DiagnosticListener {
backend.assembleProgram();
+ if (dumpInfo) {
+ dumpInfoTask.dumpInfo();
+ }
+
checkQueues();
if (compilationFailed) {
@@ -1189,9 +1193,6 @@ abstract class Compiler implements DiagnosticListener {
world.queueIsClosed = true;
if (compilationFailed) return;
assert(world.checkNoEnqueuedInvokedInstanceMethods());
- if (DUMP_INFERRED_TYPES && phase == PHASE_COMPILING) {
- backend.dumpInferredTypes();
- }
}
/**

Powered by Google App Engine
This is Rietveld 408576698