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

Unified Diff: pkg/compiler/lib/src/enqueue.dart

Issue 2732633002: Remove Enqueuer.nativeEnqueuer (Closed)
Patch Set: Updated cf. comment Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pkg/compiler/lib/src/js_backend/backend.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/enqueue.dart
diff --git a/pkg/compiler/lib/src/enqueue.dart b/pkg/compiler/lib/src/enqueue.dart
index 8a5cda013d2a7d098987076c42fdd7440723312b..2025673d73deb5a75e65641c13633ae369d6d415 100644
--- a/pkg/compiler/lib/src/enqueue.dart
+++ b/pkg/compiler/lib/src/enqueue.dart
@@ -17,7 +17,6 @@ import 'elements/elements.dart'
import 'elements/entities.dart';
import 'elements/resolution_types.dart' show ResolutionTypedefType;
import 'elements/types.dart';
-import 'native/native.dart' as native;
import 'universe/world_builder.dart';
import 'universe/use.dart'
show DynamicUse, StaticUse, StaticUseKind, TypeUse, TypeUseKind;
@@ -44,7 +43,6 @@ class EnqueueTask extends CompilerTask {
? const DirectEnqueuerStrategy()
: const TreeShakingEnqueuerStrategy(),
compiler.backend.resolutionEnqueuerListener,
- compiler.backend.nativeResolutionEnqueuer(),
new ElementResolutionWorldBuilder(
compiler.backend, compiler.resolution, const OpenWorldStrategy()),
new ResolutionWorkItemBuilder(compiler.resolution));
@@ -57,7 +55,6 @@ class EnqueueTask extends CompilerTask {
abstract class Enqueuer {
WorldBuilder get worldBuilder;
- native.NativeEnqueuer get nativeEnqueuer;
ImpactStrategy get impactStrategy;
void open(ImpactStrategy impactStrategy, FunctionEntity mainMethod,
@@ -83,7 +80,7 @@ abstract class Enqueuer {
/// Check the enqueuer queue is empty or fail otherwise.
void checkQueueIsEmpty();
- void logSummary(log(message));
+ void logSummary(void log(String message));
Iterable<Entity> get processedEntities;
@@ -92,7 +89,8 @@ abstract class Enqueuer {
abstract class EnqueuerListener {
/// Called to instruct to the backend that [type] has been instantiated.
- void registerInstantiatedType(InterfaceType type, {bool isGlobal});
+ void registerInstantiatedType(InterfaceType type,
+ {bool isGlobal: false, bool nativeUsage: false});
/// Called to notify to the backend that a class is being instantiated. Any
/// backend specific [WorldImpact] of this is returned.
@@ -135,6 +133,9 @@ abstract class EnqueuerListener {
/// [recentClasses], but every class seen by the [enqueuer] will be present in
/// [recentClasses] at least once.
bool onQueueEmpty(Enqueuer enqueuer, Iterable<ClassEntity> recentClasses);
+
+ /// Called after the queue has been emptied.
+ void logSummary(void log(String message));
}
abstract class EnqueuerImpl extends Enqueuer {
@@ -173,7 +174,6 @@ class ResolutionEnqueuer extends EnqueuerImpl {
final String name;
final CompilerOptions _options;
final EnqueuerListener listener;
- final native.NativeEnqueuer nativeEnqueuer;
final EnqueuerStrategy strategy;
final Set<ClassEntity> _recentClasses = new Setlet<ClassEntity>();
@@ -194,15 +194,8 @@ class ResolutionEnqueuer extends EnqueuerImpl {
/// has been emptied.
final Queue<_DeferredAction> _deferredQueue = new Queue<_DeferredAction>();
- ResolutionEnqueuer(
- this.task,
- this._options,
- this._reporter,
- this.strategy,
- this.listener,
- this.nativeEnqueuer,
- this._worldBuilder,
- this._workItemBuilder,
+ ResolutionEnqueuer(this.task, this._options, this._reporter, this.strategy,
+ this.listener, this._worldBuilder, this._workItemBuilder,
[this.name = 'resolution enqueuer']) {
_impactVisitor = new EnqueuerImplImpactVisitor(this);
}
@@ -238,11 +231,8 @@ class ResolutionEnqueuer extends EnqueuerImpl {
constructor: constructor,
byMirrors: mirrorUsage,
isRedirection: isRedirection);
- if (nativeUsage) {
- nativeEnqueuer.onInstantiatedType(type);
- }
listener.registerInstantiatedType(type,
- isGlobal: globalDependency && !mirrorUsage);
+ isGlobal: globalDependency && !mirrorUsage, nativeUsage: nativeUsage);
});
}
@@ -376,9 +366,9 @@ class ResolutionEnqueuer extends EnqueuerImpl {
} while (_queue.isNotEmpty || _recentClasses.isNotEmpty);
}
- void logSummary(log(message)) {
+ void logSummary(void log(String message)) {
log('Resolved ${_processedEntities.length} elements.');
- nativeEnqueuer.logSummary(log);
+ listener.logSummary(log);
}
String toString() => 'Enqueuer($name)';
« no previous file with comments | « no previous file | pkg/compiler/lib/src/js_backend/backend.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698