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

Unified Diff: pkg/compiler/lib/src/common/codegen.dart

Issue 2807593002: Use entities in impact transformers. (Closed)
Patch Set: Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pkg/compiler/lib/src/common_elements.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/common/codegen.dart
diff --git a/pkg/compiler/lib/src/common/codegen.dart b/pkg/compiler/lib/src/common/codegen.dart
index 12c399f9d652ea0669a20e4d3736da23c5cc0c6e..ce72cfc586bb5b7f6c1215ec01b8ae673feef2c8 100644
--- a/pkg/compiler/lib/src/common/codegen.dart
+++ b/pkg/compiler/lib/src/common/codegen.dart
@@ -5,30 +5,28 @@
library dart2js.common.codegen;
import '../common.dart';
-import '../elements/resolution_types.dart'
- show ResolutionDartType, ResolutionInterfaceType;
import '../elements/elements.dart'
show
+ AsyncMarker,
ClassElement,
- Element,
- FunctionElement,
LocalFunctionElement,
MemberElement,
ResolvedAst;
import '../elements/entities.dart';
+import '../elements/types.dart' show DartType, InterfaceType;
import '../js_backend/backend.dart' show JavaScriptBackend;
import '../universe/use.dart' show ConstantUse, DynamicUse, StaticUse, TypeUse;
import '../universe/world_impact.dart'
show WorldImpact, WorldImpactBuilderImpl, WorldImpactVisitor;
+import '../util/enumset.dart';
import '../util/util.dart' show Pair, Setlet;
import 'work.dart' show WorkItem;
class CodegenImpact extends WorldImpact {
const CodegenImpact();
- Iterable<Pair<ResolutionDartType, ResolutionDartType>>
- get typeVariableBoundsSubtypeChecks {
- return const <Pair<ResolutionDartType, ResolutionDartType>>[];
+ Iterable<Pair<DartType, DartType>> get typeVariableBoundsSubtypeChecks {
+ return const <Pair<DartType, DartType>>[];
}
Iterable<String> get constSymbols => const <String>[];
@@ -39,16 +37,15 @@ class CodegenImpact extends WorldImpact {
bool get usesInterceptor => false;
- Iterable<Element> get asyncMarkers => const <FunctionElement>[];
+ Iterable<AsyncMarker> get asyncMarkers => <AsyncMarker>[];
}
class _CodegenImpact extends WorldImpactBuilderImpl implements CodegenImpact {
- Setlet<Pair<ResolutionDartType, ResolutionDartType>>
- _typeVariableBoundsSubtypeChecks;
+ Setlet<Pair<DartType, DartType>> _typeVariableBoundsSubtypeChecks;
Setlet<String> _constSymbols;
List<Set<ClassEntity>> _specializedGetInterceptors;
bool _usesInterceptor = false;
- Setlet<FunctionElement> _asyncMarkers;
+ EnumSet<AsyncMarker> _asyncMarkers;
_CodegenImpact();
@@ -59,20 +56,18 @@ class _CodegenImpact extends WorldImpactBuilderImpl implements CodegenImpact {
}
void registerTypeVariableBoundsSubtypeCheck(
- ResolutionDartType subtype, ResolutionDartType supertype) {
+ DartType subtype, DartType supertype) {
if (_typeVariableBoundsSubtypeChecks == null) {
- _typeVariableBoundsSubtypeChecks =
- new Setlet<Pair<ResolutionDartType, ResolutionDartType>>();
+ _typeVariableBoundsSubtypeChecks = new Setlet<Pair<DartType, DartType>>();
}
- _typeVariableBoundsSubtypeChecks.add(
- new Pair<ResolutionDartType, ResolutionDartType>(subtype, supertype));
+ _typeVariableBoundsSubtypeChecks
+ .add(new Pair<DartType, DartType>(subtype, supertype));
}
- Iterable<Pair<ResolutionDartType, ResolutionDartType>>
- get typeVariableBoundsSubtypeChecks {
+ Iterable<Pair<DartType, DartType>> get typeVariableBoundsSubtypeChecks {
return _typeVariableBoundsSubtypeChecks != null
? _typeVariableBoundsSubtypeChecks
- : const <Pair<ResolutionDartType, ResolutionDartType>>[];
+ : const <Pair<DartType, DartType>>[];
}
void registerConstSymbol(String name) {
@@ -105,15 +100,17 @@ class _CodegenImpact extends WorldImpactBuilderImpl implements CodegenImpact {
bool get usesInterceptor => _usesInterceptor;
- void registerAsyncMarker(FunctionElement element) {
+ void registerAsyncMarker(AsyncMarker asyncMarker) {
if (_asyncMarkers == null) {
- _asyncMarkers = new Setlet<FunctionElement>();
+ _asyncMarkers = new EnumSet<AsyncMarker>();
}
- _asyncMarkers.add(element);
+ _asyncMarkers.add(asyncMarker);
}
- Iterable<Element> get asyncMarkers {
- return _asyncMarkers != null ? _asyncMarkers : const <FunctionElement>[];
+ Iterable<AsyncMarker> get asyncMarkers {
+ return _asyncMarkers != null
+ ? _asyncMarkers.iterable(AsyncMarker.values)
+ : const <AsyncMarker>[];
}
}
@@ -153,7 +150,7 @@ class CodegenRegistry {
}
void registerTypeVariableBoundsSubtypeCheck(
- ResolutionDartType subtype, ResolutionDartType supertype) {
+ DartType subtype, DartType supertype) {
worldImpact.registerTypeVariableBoundsSubtypeCheck(subtype, supertype);
}
@@ -173,12 +170,12 @@ class CodegenRegistry {
worldImpact.registerUseInterceptor();
}
- void registerInstantiation(ResolutionInterfaceType type) {
+ void registerInstantiation(InterfaceType type) {
registerTypeUse(new TypeUse.instantiation(type));
}
- void registerAsyncMarker(FunctionElement element) {
- worldImpact.registerAsyncMarker(element);
+ void registerAsyncMarker(AsyncMarker asyncMarker) {
+ worldImpact.registerAsyncMarker(asyncMarker);
}
}
« no previous file with comments | « no previous file | pkg/compiler/lib/src/common_elements.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698