Chromium Code Reviews| Index: lib/compiler/implementation/compiler.dart |
| diff --git a/lib/compiler/implementation/compiler.dart b/lib/compiler/implementation/compiler.dart |
| index c327d7dafd60863ed63f269907da3e76f64e6469..9703b69719907f0cc06eb0dc5bf3597afae987a1 100644 |
| --- a/lib/compiler/implementation/compiler.dart |
| +++ b/lib/compiler/implementation/compiler.dart |
| @@ -132,9 +132,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()) { |
| @@ -178,12 +180,15 @@ abstract class Compiler implements DiagnosticListener { |
| static const SourceString MAIN = const SourceString('main'); |
|
ahe
2012/10/29 12:14:05
How about adding a TODO that these should be selec
|
| 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; |
| @@ -325,6 +330,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')); |
|
ahe
2012/10/29 12:14:05
This looks specific to the JS backend.
|
| + enqueuer.resolution.addToWorkList(createInvocationMirrorElement); |
| + enqueuer.codegen.addToWorkList(createInvocationMirrorElement); |
|
ahe
2012/10/29 12:14:05
This should only be added if it is really needed.
|
| } |
| void enableIsolateSupport(LibraryElement element) { |
| @@ -376,6 +386,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')); |
|
ahe
2012/10/29 12:14:05
This looks specific to the JS backend.
|
| closureClass = lookupSpecialClass(const SourceString('Closure')); |
| dynamicClass = lookupSpecialClass(const SourceString('Dynamic_')); |
| nullClass = lookupSpecialClass(const SourceString('Null')); |
| @@ -408,6 +420,9 @@ abstract class Compiler implements DiagnosticListener { |
| functionClass.ensureResolved(this); |
| functionApplyMethod = |
| functionClass.lookupLocalMember(const SourceString('apply')); |
| + jsInvocationMirrorClass.ensureResolved(this); |
| + invokeOnMethod = jsInvocationMirrorClass.lookupLocalMember( |
| + const SourceString('invokeOn')); |
|
ahe
2012/10/29 12:14:05
This looks specific to the JS backend.
|
| } |
| void loadCoreImplLibrary() { |