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

Unified Diff: pkg/compiler/lib/src/js_backend/enqueuer.dart

Issue 2549423002: Change Enqueuer to use Entity instead of Element. (Closed)
Patch Set: Updated cf. comments. Created 4 years 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 | « pkg/compiler/lib/src/js_backend/backend.dart ('k') | pkg/compiler/lib/src/js_backend/mirrors_analysis.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/js_backend/enqueuer.dart
diff --git a/pkg/compiler/lib/src/js_backend/enqueuer.dart b/pkg/compiler/lib/src/js_backend/enqueuer.dart
index e51a5fad3e193c6d06568d0bbd332bd4315bcae6..d5ade5226b923d70245f39a46bec1dfb95686657 100644
--- a/pkg/compiler/lib/src/js_backend/enqueuer.dart
+++ b/pkg/compiler/lib/src/js_backend/enqueuer.dart
@@ -18,16 +18,12 @@ import '../elements/elements.dart'
show
ClassElement,
Element,
- Elements,
Entity,
FunctionElement,
- LibraryElement,
- Member,
MemberElement,
MethodElement,
- Name,
- TypedElement,
- TypedefElement;
+ TypedElement;
+import '../elements/entities.dart';
import '../enqueue.dart';
import '../js/js.dart' as js;
import '../native/native.dart' as native;
@@ -38,7 +34,7 @@ import '../universe/world_builder.dart';
import '../universe/use.dart'
show DynamicUse, StaticUse, StaticUseKind, TypeUse, TypeUseKind;
import '../universe/world_impact.dart'
- show ImpactUseCase, ImpactStrategy, WorldImpact, WorldImpactVisitor;
+ show ImpactUseCase, WorldImpact, WorldImpactVisitor;
import '../util/util.dart' show Setlet;
import '../world.dart';
@@ -350,7 +346,7 @@ class CodegenEnqueuer extends EnqueuerImpl {
assert(invariant(element, element.isDeclaration,
message: "Element ${element} is not the declaration."));
_universe.registerStaticUse(staticUse);
- applyImpact(_backend.registerStaticUse(element, forResolution: false));
+ applyImpact(_backend.registerUsedElement(element, forResolution: false));
bool addElement = true;
switch (staticUse.kind) {
case StaticUseKind.STATIC_TEAR_OFF:
@@ -467,13 +463,6 @@ class CodegenEnqueuer extends EnqueuerImpl {
String toString() => 'Enqueuer($name)';
- void _forgetElement(Element element) {
- _universe.forgetElement(element, _compiler);
- _processedClasses.remove(element);
- _instanceMembersByName[element.name]?.remove(element);
- _instanceFunctionsByName[element.name]?.remove(element);
- }
-
ImpactUseCase get impactUse => IMPACT_USE;
bool isProcessed(Element member) =>
@@ -486,8 +475,11 @@ class CodegenEnqueuer extends EnqueuerImpl {
}
}
- void forgetElement(Element element, Compiler compiler) {
- _forgetElement(element);
+ void forgetEntity(Element element, Compiler compiler) {
+ _universe.forgetElement(element, _compiler);
+ _processedClasses.remove(element);
+ _instanceMembersByName[element.name]?.remove(element);
+ _instanceFunctionsByName[element.name]?.remove(element);
generatedCode.remove(element);
if (element is MemberElement) {
for (Element closure in element.nestedClosures) {
@@ -502,7 +494,7 @@ class CodegenEnqueuer extends EnqueuerImpl {
Iterable<Entity> get processedEntities => generatedCode.keys;
@override
- Iterable<ClassElement> get processedClasses => _processedClasses;
+ Iterable<ClassEntity> get processedClasses => _processedClasses;
}
void removeFromSet(Map<String, Set<Element>> map, Element element) {
« no previous file with comments | « pkg/compiler/lib/src/js_backend/backend.dart ('k') | pkg/compiler/lib/src/js_backend/mirrors_analysis.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698