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

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

Issue 11304021: Add NativeEnqueuer to work with the Enqueuer. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: code review fixes Created 8 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
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 f97d3d9c8729085597dead1feeeafbfc71254cb1..9d4bc5159757a9ecf7d3532b01ddb09fd810c14d 100644
--- a/sdk/lib/_internal/compiler/implementation/compiler.dart
+++ b/sdk/lib/_internal/compiler/implementation/compiler.dart
@@ -74,8 +74,16 @@ abstract class Backend {
void enqueueHelpers(Enqueuer world);
void codegen(WorkItem work);
- void processNativeClasses(Enqueuer world,
- Collection<LibraryElement> libraries);
+
+ // The backend determines the native resolution enqueuer, with a no-op
+ // default, so tools like dart2dart can ignore the native classes.
+ native.NativeEnqueuer nativeResolutionEnqueuer(world) {
+ return new native.NativeEnqueuer();
+ }
+ native.NativeEnqueuer nativeCodegenEnqueuer(world) {
+ return new native.NativeEnqueuer();
+ }
+
void assembleProgram();
List<CompilerTask> get tasks;
@@ -103,6 +111,7 @@ abstract class Compiler implements DiagnosticListener {
final bool enableTypeAssertions;
final bool enableUserAssertions;
final bool enableConcreteTypeInference;
+ final bool enableNativeLiveTypeAnalysis;
bool disableInlining = false;
@@ -210,6 +219,7 @@ abstract class Compiler implements DiagnosticListener {
this.enableUserAssertions: false,
this.enableConcreteTypeInference: false,
this.enableMinification: false,
+ this.enableNativeLiveTypeAnalysis: false,
bool emitJavaScript: true,
bool generateSourceMap: true,
bool disallowUnsafeEval: false,
@@ -515,11 +525,16 @@ abstract class Compiler implements DiagnosticListener {
});
}
+ enqueuer.resolution.nativeEnqueuer =
+ backend.nativeResolutionEnqueuer(enqueuer.resolution);
ngeoffray 2012/11/15 12:49:57 The reason why I asked about why not initializing
+ enqueuer.codegen.nativeEnqueuer =
+ backend.nativeCodegenEnqueuer(enqueuer.codegen);
+
log('Resolving...');
phase = PHASE_RESOLVING;
backend.enqueueHelpers(enqueuer.resolution);
processQueue(enqueuer.resolution, main);
- log('Resolved ${enqueuer.resolution.resolvedElements.length} elements.');
+ enqueuer.resolution.logSummary(log);
if (compilationFailed) return;
@@ -533,7 +548,7 @@ abstract class Compiler implements DiagnosticListener {
log('Compiling...');
phase = PHASE_COMPILING;
processQueue(enqueuer.codegen, main);
- log('Compiled ${codegenWorld.generatedCode.length} methods.');
+ enqueuer.codegen.logSummary(log);
if (compilationFailed) return;
@@ -543,7 +558,7 @@ abstract class Compiler implements DiagnosticListener {
}
void processQueue(Enqueuer world, Element main) {
- backend.processNativeClasses(world, libraries.values);
+ world.nativeEnqueuer.processNativeClasses(libraries.values);
world.addToWorkList(main);
progress.reset();
world.forEach((WorkItem work) {

Powered by Google App Engine
This is Rietveld 408576698