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

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

Issue 12033003: Deferred (aka lazy) loading of static functions. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Address comments and use IsolateNatives.thisScript Created 7 years, 10 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
« no previous file with comments | « no previous file | dart/sdk/lib/_internal/compiler/implementation/dart2jslib.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/sdk/lib/_internal/compiler/implementation/compiler.dart
diff --git a/dart/sdk/lib/_internal/compiler/implementation/compiler.dart b/dart/sdk/lib/_internal/compiler/implementation/compiler.dart
index ae6c87a243c5ea482f52c80c9f48978d42a68e09..aae34dfb784948e09930fbd6d99044425a85f620 100644
--- a/dart/sdk/lib/_internal/compiler/implementation/compiler.dart
+++ b/dart/sdk/lib/_internal/compiler/implementation/compiler.dart
@@ -307,6 +307,7 @@ abstract class Compiler implements DiagnosticListener {
ConstantHandler metadataHandler;
EnqueueTask enqueuer;
CompilerTask fileReadingTask;
+ DeferredLoadTask deferredLoadTask;
static const SourceString MAIN = const SourceString('main');
static const SourceString CALL_OPERATOR_NAME = const SourceString('call');
@@ -385,6 +386,7 @@ abstract class Compiler implements DiagnosticListener {
checker = new TypeCheckerTask(this),
typesTask = new ti.TypesTask(this),
constantHandler = new ConstantHandler(this, backend.constantSystem),
+ deferredLoadTask = new DeferredLoadTask(this),
enqueuer = new EnqueueTask(this)];
tasks.addAll(backend.tasks);
@@ -653,6 +655,8 @@ abstract class Compiler implements DiagnosticListener {
}
}
+ deferredLoadTask.registerMainApp(mainApp);
+
log('Resolving...');
phase = PHASE_RESOLVING;
if (analyzeAll) {
@@ -1042,7 +1046,7 @@ class CompilerTask {
String get name => 'Unknown task';
int get timing => watch.elapsedMilliseconds;
- measure(Function action) {
+ measure(action()) {
CompilerTask previous = compiler.measuredTask;
if (identical(this, previous)) return action();
compiler.measuredTask = this;
@@ -1056,6 +1060,10 @@ class CompilerTask {
compiler.measuredTask = previous;
}
}
+
+ measureElement(Element element, action()) {
+ compiler.withCurrentElement(element, () => measure(action));
+ }
}
class CompilerCancelledException implements Exception {
« no previous file with comments | « no previous file | dart/sdk/lib/_internal/compiler/implementation/dart2jslib.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698