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

Side by Side Diff: lib/compiler/implementation/enqueue.dart

Issue 11264005: InvocationMirror implemented in dart2js. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Working version Created 8 years, 1 month 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
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 class EnqueueTask extends CompilerTask { 5 class EnqueueTask extends CompilerTask {
6 final Enqueuer codegen; 6 final Enqueuer codegen;
7 final Enqueuer resolution; 7 final Enqueuer resolution;
8 8
9 String get name => 'Enqueue'; 9 String get name => 'Enqueue';
10 10
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 }); 240 });
241 } 241 }
242 242
243 void registerNewSelector(SourceString name, 243 void registerNewSelector(SourceString name,
244 Selector selector, 244 Selector selector,
245 Map<SourceString, Set<Selector>> selectorsMap) { 245 Map<SourceString, Set<Selector>> selectorsMap) {
246 if (name != selector.name) { 246 if (name != selector.name) {
247 String message = "$name != ${selector.name} (${selector.kind})"; 247 String message = "$name != ${selector.name} (${selector.kind})";
248 compiler.internalError("Wrong selector name: $message."); 248 compiler.internalError("Wrong selector name: $message.");
249 } 249 }
250 if (!compiler.enabledInvokeOn && name == Compiler.INVOKE_ON) {
251 if (selector.applies(compiler.invokeOnMethod, compiler)) {
bakster 2012/10/24 13:43:04 Why two if statements when you have three expressi
Johnni Winther 2012/10/25 13:34:56 Test removed.
252 compiler.enabledInvokeOn = true;
253 }
254 }
250 Set<Selector> selectors = 255 Set<Selector> selectors =
251 selectorsMap.putIfAbsent(name, () => new Set<Selector>()); 256 selectorsMap.putIfAbsent(name, () => new Set<Selector>());
252 if (!selectors.contains(selector)) { 257 if (!selectors.contains(selector)) {
253 selectors.add(selector); 258 selectors.add(selector);
254 handleUnseenSelector(name, selector); 259 handleUnseenSelector(name, selector);
255 } 260 }
256 } 261 }
257 262
258 void registerInvocation(SourceString methodName, Selector selector) { 263 void registerInvocation(SourceString methodName, Selector selector) {
259 task.measure(() { 264 task.measure(() {
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
362 367
363 String toString() => 'Enqueuer($name)'; 368 String toString() => 'Enqueuer($name)';
364 369
365 registerUsedSelector(Selector selector) { 370 registerUsedSelector(Selector selector) {
366 Element interceptor = compiler.backend.getInterceptor(selector); 371 Element interceptor = compiler.backend.getInterceptor(selector);
367 if (interceptor != null) { 372 if (interceptor != null) {
368 registerStaticUse(interceptor); 373 registerStaticUse(interceptor);
369 } 374 }
370 } 375 }
371 } 376 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698