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

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

Issue 11598006: Concept of how dart:mirrors LibraryMirror, ClassMirror can be implemented in dart2js. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Added enough closure support to get tests/lib/mirrors/mirrors_test.dart pass. Created 7 years, 12 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 | sdk/lib/_internal/compiler/implementation/enqueue.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 636fcc530952bc44532781cfc2215c708c93adf1..5d4178b25d735ea4cd4182436de7948809686456 100644
--- a/sdk/lib/_internal/compiler/implementation/compiler.dart
+++ b/sdk/lib/_internal/compiler/implementation/compiler.dart
@@ -134,6 +134,7 @@ abstract class Compiler implements DiagnosticListener {
LibraryElement coreLibrary;
LibraryElement isolateLibrary;
LibraryElement isolateHelperLibrary;
+ LibraryElement mirrorsLibrary;
LibraryElement jsHelperLibrary;
LibraryElement interceptorsLibrary;
LibraryElement foreignLibrary;
@@ -218,6 +219,8 @@ abstract class Compiler implements DiagnosticListener {
static const SourceString RUNTIME_TYPE = const SourceString('runtimeType');
static const SourceString START_ROOT_ISOLATE =
const SourceString('startRootIsolate');
+ static const SourceString CREATE_MIRROR_SYSTEM =
+ const SourceString('_createMirrorSystem');
bool enabledNoSuchMethod = false;
bool enabledRuntimeType = false;
bool enabledFunctionApply = false;
@@ -421,6 +424,16 @@ abstract class Compiler implements DiagnosticListener {
bool hasIsolateSupport() => isolateLibrary != null;
+ void enableMirrorsSupport(LibraryElement element) {
+ mirrorsLibrary = element.patch;
+ enqueuer.resolution.addToWorkList(
+ mirrorsLibrary.find(CREATE_MIRROR_SYSTEM));
+ enqueuer.codegen.addToWorkList(
+ mirrorsLibrary.find(CREATE_MIRROR_SYSTEM));
+ }
+
+ bool hasMirrorsSupport() => mirrorsLibrary != null;
+
/**
* This method is called before [library] import and export scopes have been
* set up.
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/enqueue.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698