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

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

Issue 11264005: InvocationMirror implemented in dart2js. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Optimization + updated cf comments. Created 8 years, 2 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 | lib/compiler/implementation/enqueue.dart » ('j') | lib/compiler/implementation/enqueue.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/compiler/implementation/compiler.dart
diff --git a/lib/compiler/implementation/compiler.dart b/lib/compiler/implementation/compiler.dart
index e80dbaaf4351193c931f2b83f5ce8f27e36180bd..efa2ec3cb088655793375348d9e9658ca50a8a9b 100644
--- a/lib/compiler/implementation/compiler.dart
+++ b/lib/compiler/implementation/compiler.dart
@@ -131,9 +131,11 @@ abstract class Compiler implements DiagnosticListener {
ClassElement nullClass;
ClassElement listClass;
ClassElement mapClass;
+ ClassElement invocationMirrorClass;
Element assertMethod;
Element identicalFunction;
Element functionApplyMethod;
+ Element invokeOnMethod;
Element get currentElement => _currentElement;
withCurrentElement(Element element, f()) {
@@ -177,12 +179,15 @@ abstract class Compiler implements DiagnosticListener {
static const SourceString MAIN = const SourceString('main');
static const SourceString CALL_OPERATOR_NAME = const SourceString('call');
static const SourceString NO_SUCH_METHOD = const SourceString('noSuchMethod');
+ static const int NO_SUCH_METHOD_ARG_COUNT = 1;
+ static const SourceString INVOKE_ON = const SourceString('invokeOn');
static const SourceString RUNTIME_TYPE = const SourceString('runtimeType');
static const SourceString START_ROOT_ISOLATE =
const SourceString('startRootIsolate');
bool enabledNoSuchMethod = false;
bool enabledRuntimeType = false;
bool enabledFunctionApply = false;
+ bool enabledInvokeOn = false;
Stopwatch progress;
@@ -324,6 +329,11 @@ abstract class Compiler implements DiagnosticListener {
Selector selector = new Selector.noSuchMethod();
enqueuer.resolution.registerInvocation(NO_SUCH_METHOD, selector);
enqueuer.codegen.registerInvocation(NO_SUCH_METHOD, selector);
+
+ Element createInvocationMirrorElement =
+ findHelper(const SourceString('createInvocationMirror'));
+ enqueuer.resolution.addToWorkList(createInvocationMirrorElement);
+ enqueuer.codegen.addToWorkList(createInvocationMirrorElement);
}
void enableIsolateSupport(LibraryElement element) {
@@ -375,6 +385,8 @@ abstract class Compiler implements DiagnosticListener {
functionClass = lookupSpecialClass(const SourceString('Function'));
listClass = lookupSpecialClass(const SourceString('List'));
mapClass = lookupSpecialClass(const SourceString('Map'));
+ invocationMirrorClass =
+ lookupSpecialClass(const SourceString('InvocationMirror'));
closureClass = lookupSpecialClass(const SourceString('Closure'));
dynamicClass = lookupSpecialClass(const SourceString('Dynamic_'));
nullClass = lookupSpecialClass(const SourceString('Null'));
@@ -407,6 +419,9 @@ abstract class Compiler implements DiagnosticListener {
functionClass.ensureResolved(this);
functionApplyMethod =
functionClass.lookupLocalMember(const SourceString('apply'));
+ invocationMirrorClass.ensureResolved(this);
+ invokeOnMethod =
+ invocationMirrorClass.lookupLocalMember(const SourceString('invokeOn'));
}
void loadCoreImplLibrary() {
« no previous file with comments | « no previous file | lib/compiler/implementation/enqueue.dart » ('j') | lib/compiler/implementation/enqueue.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698