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

Side by Side Diff: sdk/lib/_internal/compiler/implementation/compiler.dart

Issue 14049010: Take noSuchMethod into account when computing the potential targets of a call. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/enqueue.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 part of dart2js; 5 part of dart2js;
6 6
7 /** 7 /**
8 * If true, print a warning for each method that was resolved, but not 8 * If true, print a warning for each method that was resolved, but not
9 * compiled. 9 * compiled.
10 */ 10 */
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after
376 static const SourceString RUNTIME_TYPE = const SourceString('runtimeType'); 376 static const SourceString RUNTIME_TYPE = const SourceString('runtimeType');
377 static const SourceString START_ROOT_ISOLATE = 377 static const SourceString START_ROOT_ISOLATE =
378 const SourceString('startRootIsolate'); 378 const SourceString('startRootIsolate');
379 379
380 final Selector iteratorSelector = 380 final Selector iteratorSelector =
381 new Selector.getter(const SourceString('iterator'), null); 381 new Selector.getter(const SourceString('iterator'), null);
382 final Selector currentSelector = 382 final Selector currentSelector =
383 new Selector.getter(const SourceString('current'), null); 383 new Selector.getter(const SourceString('current'), null);
384 final Selector moveNextSelector = 384 final Selector moveNextSelector =
385 new Selector.call(const SourceString('moveNext'), null, 0); 385 new Selector.call(const SourceString('moveNext'), null, 0);
386 final Selector noSuchMethodSelector = new Selector.call(
387 Compiler.NO_SUCH_METHOD, null, Compiler.NO_SUCH_METHOD_ARG_COUNT);
386 388
387 bool enabledNoSuchMethod = false; 389 bool enabledNoSuchMethod = false;
388 bool enabledRuntimeType = false; 390 bool enabledRuntimeType = false;
389 bool enabledFunctionApply = false; 391 bool enabledFunctionApply = false;
390 bool enabledInvokeOn = false; 392 bool enabledInvokeOn = false;
391 393
392 Stopwatch progress; 394 Stopwatch progress;
393 395
394 static const int PHASE_SCANNING = 0; 396 static const int PHASE_SCANNING = 0;
395 static const int PHASE_RESOLVING = 1; 397 static const int PHASE_RESOLVING = 1;
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after
800 typesTask.onResolutionComplete(main); 802 typesTask.onResolutionComplete(main);
801 803
802 log('Compiling...'); 804 log('Compiling...');
803 phase = PHASE_COMPILING; 805 phase = PHASE_COMPILING;
804 // TODO(johnniwinther): Move these to [CodegenEnqueuer]. 806 // TODO(johnniwinther): Move these to [CodegenEnqueuer].
805 if (hasIsolateSupport()) { 807 if (hasIsolateSupport()) {
806 enqueuer.codegen.addToWorkList( 808 enqueuer.codegen.addToWorkList(
807 isolateHelperLibrary.find(Compiler.START_ROOT_ISOLATE)); 809 isolateHelperLibrary.find(Compiler.START_ROOT_ISOLATE));
808 } 810 }
809 if (enabledNoSuchMethod) { 811 if (enabledNoSuchMethod) {
810 Selector selector = new Selector.noSuchMethod(); 812 enqueuer.codegen.registerInvocation(NO_SUCH_METHOD, noSuchMethodSelector);
811 enqueuer.codegen.registerInvocation(NO_SUCH_METHOD, selector);
812 enqueuer.codegen.addToWorkList(createInvocationMirrorElement); 813 enqueuer.codegen.addToWorkList(createInvocationMirrorElement);
813 } 814 }
814 processQueue(enqueuer.codegen, main); 815 processQueue(enqueuer.codegen, main);
815 enqueuer.codegen.logSummary(log); 816 enqueuer.codegen.logSummary(log);
816 817
817 if (compilationFailed) return; 818 if (compilationFailed) return;
818 819
819 backend.assembleProgram(); 820 backend.assembleProgram();
820 821
821 checkQueues(); 822 checkQueues();
(...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after
1279 1280
1280 void close() {} 1281 void close() {}
1281 1282
1282 toString() => name; 1283 toString() => name;
1283 1284
1284 /// Convenience method for getting an [api.CompilerOutputProvider]. 1285 /// Convenience method for getting an [api.CompilerOutputProvider].
1285 static NullSink outputProvider(String name, String extension) { 1286 static NullSink outputProvider(String name, String extension) {
1286 return new NullSink('$name.$extension'); 1287 return new NullSink('$name.$extension');
1287 } 1288 }
1288 } 1289 }
OLDNEW
« 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