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

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 1ded67edec6988131570988d2d1a7ad98bdaec6e..ba7ff4278c57a9ec454b96a15a4ea84f37775985 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(FunctionElement functionElement) => null;
ahe 2013/12/02 15:20:26 Please add new features at the end of this class d
+
void initializeHelperClasses() {}
void enqueueAllTopLevelFunctions(LibraryElement lib, Enqueuer world) {
@@ -110,9 +109,6 @@ abstract class Backend {
void onResolutionComplete() {}
- // TODO(ahe,karlklose): rename this?
- void dumpInferredTypes() {}
-
ItemCompilationContext createItemCompilationContext() {
return new ItemCompilationContext();
}
@@ -368,6 +364,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
@@ -549,6 +546,7 @@ abstract class Compiler implements DiagnosticListener {
EnqueueTask enqueuer;
DeferredLoadTask deferredLoadTask;
MirrorUsageAnalyzerTask mirrorUsageAnalyzerTask;
+ DumpInfoTask dumpInfoTask;
String buildId;
static const String MAIN = 'main';
@@ -622,6 +620,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,
@@ -659,7 +658,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);
}
@@ -1129,6 +1129,10 @@ abstract class Compiler implements DiagnosticListener {
backend.assembleProgram();
+ if (dumpInfo) {
+ dumpInfoTask.dumpInfo();
+ }
+
checkQueues();
if (compilationFailed) {
@@ -1188,9 +1192,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