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 11231074: Change signature of noSuchMethod to take an InvocationMirror. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: One more test expectation 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
Index: lib/compiler/implementation/compiler.dart
diff --git a/lib/compiler/implementation/compiler.dart b/lib/compiler/implementation/compiler.dart
index 4d587cbccf17751bb32b95de3f3d8e7f06412087..0f5fa175133601bfff948f08cb1ba97eaa6bcd58 100644
--- a/lib/compiler/implementation/compiler.dart
+++ b/lib/compiler/implementation/compiler.dart
@@ -128,9 +128,11 @@ abstract class Compiler implements DiagnosticListener {
ClassElement nullClass;
ClassElement listClass;
ClassElement mapClass;
+ ClassElement jsInvocationMirrorClass;
Element assertMethod;
Element identicalFunction;
Element functionApplyMethod;
+ Element invokeOnMethod;
Element get currentElement => _currentElement;
withCurrentElement(Element element, f()) {
@@ -181,12 +183,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;
@@ -343,6 +348,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) {
@@ -394,6 +404,8 @@ abstract class Compiler implements DiagnosticListener {
functionClass = lookupSpecialClass(const SourceString('Function'));
listClass = lookupSpecialClass(const SourceString('List'));
mapClass = lookupSpecialClass(const SourceString('Map'));
+ jsInvocationMirrorClass =
+ lookupSpecialClass(const SourceString('JSInvocationMirror'));
closureClass = lookupSpecialClass(const SourceString('Closure'));
dynamicClass = lookupSpecialClass(const SourceString('Dynamic_'));
nullClass = lookupSpecialClass(const SourceString('Null'));
@@ -426,6 +438,9 @@ abstract class Compiler implements DiagnosticListener {
functionClass.ensureResolved(this);
functionApplyMethod =
functionClass.lookupLocalMember(const SourceString('apply'));
+ jsInvocationMirrorClass.ensureResolved(this);
+ invokeOnMethod = jsInvocationMirrorClass.lookupLocalMember(
+ const SourceString('invokeOn'));
}
void loadCoreImplLibrary() {

Powered by Google App Engine
This is Rietveld 408576698