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

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

Issue 220203004: Improve the mirror support for deferred loading. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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
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 typedef ItemCompilationContext ItemCompilationContextCreator(); 7 typedef ItemCompilationContext ItemCompilationContextCreator();
8 8
9 class EnqueueTask extends CompilerTask { 9 class EnqueueTask extends CompilerTask {
10 final ResolutionEnqueuer resolution; 10 final ResolutionEnqueuer resolution;
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after
358 void registerNewSymbol(TreeElements elements) { 358 void registerNewSymbol(TreeElements elements) {
359 compiler.backend.registerNewSymbol(elements); 359 compiler.backend.registerNewSymbol(elements);
360 } 360 }
361 361
362 void enqueueEverything() { 362 void enqueueEverything() {
363 if (hasEnqueuedEverything) return; 363 if (hasEnqueuedEverything) return;
364 compiler.log('Enqueuing everything'); 364 compiler.log('Enqueuing everything');
365 task.ensureAllElementsByName(); 365 task.ensureAllElementsByName();
366 for (Link link in task.allElementsByName.values) { 366 for (Link link in task.allElementsByName.values) {
367 for (Element element in link) { 367 for (Element element in link) {
368 pretendElementWasUsed(element, compiler.globalDependencies); 368 pretendElementWasUsed(element, compiler.mirrorDependencies);
369 } 369 }
370 } 370 }
371 hasEnqueuedEverything = true; 371 hasEnqueuedEverything = true;
372 hasEnqueuedReflectiveStaticFields = true; 372 hasEnqueuedReflectiveStaticFields = true;
373 } 373 }
374 374
375 /// Enqueue the static fields that have been marked as used by reflective 375 /// Enqueue the static fields that have been marked as used by reflective
376 /// usage through `MirrorsUsed`. 376 /// usage through `MirrorsUsed`.
377 void enqueueReflectiveStaticFields(Iterable<Element> elements) { 377 void enqueueReflectiveStaticFields(Iterable<Element> elements) {
378 if (hasEnqueuedReflectiveStaticFields) return; 378 if (hasEnqueuedReflectiveStaticFields) return;
379 hasEnqueuedReflectiveStaticFields = true; 379 hasEnqueuedReflectiveStaticFields = true;
380 for (Element element in elements) { 380 for (Element element in elements) {
381 pretendElementWasUsed(element, compiler.globalDependencies); 381 pretendElementWasUsed(element, compiler.mirrorDependencies);
382 } 382 }
383 } 383 }
384 384
385 processLink(Map<String, Link<Element>> map, 385 processLink(Map<String, Link<Element>> map,
386 String memberName, 386 String memberName,
387 bool f(Element e)) { 387 bool f(Element e)) {
388 Link<Element> members = map[memberName]; 388 Link<Element> members = map[memberName];
389 if (members != null) { 389 if (members != null) {
390 // [f] might add elements to [: map[memberName] :] during the loop below 390 // [f] might add elements to [: map[memberName] :] during the loop below
391 // so we create a new list for [: map[memberName] :] and prepend the 391 // so we create a new list for [: map[memberName] :] and prepend the
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after
772 } 772 }
773 CodegenWorkItem workItem = new CodegenWorkItem( 773 CodegenWorkItem workItem = new CodegenWorkItem(
774 element, itemCompilationContextCreator()); 774 element, itemCompilationContextCreator());
775 queue.add(workItem); 775 queue.add(workItem);
776 } 776 }
777 777
778 void _logSpecificSummary(log(message)) { 778 void _logSpecificSummary(log(message)) {
779 log('Compiled ${generatedCode.length} methods.'); 779 log('Compiled ${generatedCode.length} methods.');
780 } 780 }
781 } 781 }
OLDNEW
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/deferred_load.dart ('k') | tests/compiler/dart2js/deferred_mirrors_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698