OLD | NEW |
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 library dart2js.enqueue; | 5 library dart2js.enqueue; |
6 | 6 |
7 import 'dart:collection' show Queue; | 7 import 'dart:collection' show Queue; |
8 | 8 |
9 import 'common/tasks.dart' show CompilerTask; | 9 import 'common/tasks.dart' show CompilerTask; |
10 import 'common/work.dart' show WorkItem; | 10 import 'common/work.dart' show WorkItem; |
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
389 void forEach(void f(WorkItem work)) { | 389 void forEach(void f(WorkItem work)) { |
390 do { | 390 do { |
391 while (_queue.isNotEmpty) { | 391 while (_queue.isNotEmpty) { |
392 // TODO(johnniwinther): Find an optimal process order. | 392 // TODO(johnniwinther): Find an optimal process order. |
393 WorkItem work = _queue.removeLast(); | 393 WorkItem work = _queue.removeLast(); |
394 if (!_processedEntities.contains(work.element)) { | 394 if (!_processedEntities.contains(work.element)) { |
395 strategy.processWorkItem(f, work); | 395 strategy.processWorkItem(f, work); |
396 _processedEntities.add(work.element); | 396 _processedEntities.add(work.element); |
397 } | 397 } |
398 } | 398 } |
399 List recents = _recentClasses.toList(growable: false); | 399 List<ClassEntity> recents = _recentClasses.toList(growable: false); |
400 _recentClasses.clear(); | 400 _recentClasses.clear(); |
401 _recentConstants = false; | 401 _recentConstants = false; |
402 if (!_onQueueEmpty(recents)) { | 402 if (!_onQueueEmpty(recents)) { |
403 _recentClasses.addAll(recents); | 403 _recentClasses.addAll(recents); |
404 } | 404 } |
405 } while (_queue.isNotEmpty || | 405 } while (_queue.isNotEmpty || |
406 _recentClasses.isNotEmpty || | 406 _recentClasses.isNotEmpty || |
407 _deferredQueue.isNotEmpty || | 407 _deferredQueue.isNotEmpty || |
408 _recentConstants); | 408 _recentConstants); |
409 } | 409 } |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
597 final Entity element; | 597 final Entity element; |
598 final DeferredActionFunction action; | 598 final DeferredActionFunction action; |
599 | 599 |
600 DeferredAction(this.element, this.action); | 600 DeferredAction(this.element, this.action); |
601 } | 601 } |
602 | 602 |
603 /// Interface for creating work items for enqueued member entities. | 603 /// Interface for creating work items for enqueued member entities. |
604 abstract class WorkItemBuilder { | 604 abstract class WorkItemBuilder { |
605 WorkItem createWorkItem(MemberEntity entity); | 605 WorkItem createWorkItem(MemberEntity entity); |
606 } | 606 } |
OLD | NEW |