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

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

Issue 12033003: Deferred (aka lazy) loading of static functions. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: 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
Index: dart/sdk/lib/_internal/compiler/implementation/elements/modelx.dart
diff --git a/dart/sdk/lib/_internal/compiler/implementation/elements/modelx.dart b/dart/sdk/lib/_internal/compiler/implementation/elements/modelx.dart
index 8c43df5589a77a52f70df93cf77e2121ced29cc7..87cc5ef369388e25e2bfff233eb6d4b1d7e3c1df 100644
--- a/dart/sdk/lib/_internal/compiler/implementation/elements/modelx.dart
+++ b/dart/sdk/lib/_internal/compiler/implementation/elements/modelx.dart
@@ -5,6 +5,7 @@
library elements.modelx;
import 'dart:uri';
+import 'dart:collection' show LinkedHashMap;
import 'elements.dart';
import '../../compiler.dart' as api;
@@ -564,6 +565,9 @@ class LibraryElementX extends ElementX implements LibraryElement {
*/
Link<Element> slotForExports;
+ final Map<LibraryDependency, LibraryElement> tagMapping =
+ new LinkedHashMap<LibraryDependency, LibraryElement>();
+
LibraryElementX(Script script, [Uri canonicalUri, LibraryElement this.origin])
: this.canonicalUri = ((canonicalUri == null) ? script.uri : canonicalUri),
importScope = new Map<SourceString, Element>(),
@@ -590,6 +594,13 @@ class LibraryElementX extends ElementX implements LibraryElement {
tags = tags.prepend(tag);
}
+ void resolvedTag(LibraryDependency tag, LibraryElement library) {
+ assert(tagMapping[tag] == null);
+ tagMapping[tag] = library;
+ }
+
+ LibraryElement getDependency(LibraryDependency tag) => tagMapping[tag];
+
/**
* Adds [element] to the import scope of this library.
*

Powered by Google App Engine
This is Rietveld 408576698