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

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

Issue 1397043002: Introduce BackendImpact to separate enqueueing from data. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Updated cf. comments. Created 5 years, 2 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 | « pkg/compiler/lib/src/common/codegen.dart ('k') | pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/common/resolution.dart
diff --git a/pkg/compiler/lib/src/common/resolution.dart b/pkg/compiler/lib/src/common/resolution.dart
index 474b10e743803d7a257c514d8f6a8e50eb0249f3..2e29611978f5fc516606aed484fffe03258afd00 100644
--- a/pkg/compiler/lib/src/common/resolution.dart
+++ b/pkg/compiler/lib/src/common/resolution.dart
@@ -65,85 +65,9 @@ class ResolutionWorkItem extends WorkItem {
// and clean up the interface.
/// Backend callbacks function specific to the resolution phase.
class ResolutionCallbacks {
- ///
+ /// Transform the [ResolutionWorldImpact] into a [WorldImpact] adding the
+ /// backend dependencies for features used in [worldImpact].
WorldImpact transformImpact(ResolutionWorldImpact worldImpact) => worldImpact;
-
- /// Register that an assert has been seen.
- void onAssert(bool hasMessage, Registry registry) {}
-
- /// Register that an 'await for' has been seen.
- void onAsyncForIn(AsyncForIn node, Registry registry) {}
-
- /// Called during resolution to notify to the backend that the
- /// program uses string interpolation.
- void onStringInterpolation(Registry registry) {}
-
- /// Called during resolution to notify to the backend that the
- /// program has a catch statement.
- void onCatchStatement(Registry registry) {}
-
- /// Called during resolution to notify to the backend that the
- /// program explicitly throws an exception.
- void onThrowExpression(Registry registry) {}
-
- /// Called during resolution to notify to the backend that the
- /// program has a global variable with a lazy initializer.
- void onLazyField(Registry registry) {}
-
- /// Called during resolution to notify to the backend that the
- /// program uses a type variable as an expression.
- void onTypeVariableExpression(Registry registry,
- TypeVariableElement variable) {}
-
- /// Called during resolution to notify to the backend that the
- /// program uses a type literal.
- void onTypeLiteral(DartType type, Registry registry) {}
-
- /// Called during resolution to notify to the backend that the
- /// program has a catch statement with a stack trace.
- void onStackTraceInCatch(Registry registry) {}
-
- /// Register an is check to the backend.
- void onIsCheck(DartType type, Registry registry) {}
-
- /// Called during resolution to notify to the backend that the
- /// program has a for-in loop.
- void onSyncForIn(Registry registry) {}
-
- /// Register an as check to the backend.
- void onAsCheck(DartType type, Registry registry) {}
-
- /// Registers that a type variable bounds check might occur at runtime.
- void onTypeVariableBoundCheck(Registry registry) {}
-
- /// Register that the application may throw a [NoSuchMethodError].
- void onThrowNoSuchMethod(Registry registry) {}
-
- /// Register that the application may throw a [RuntimeError].
- void onThrowRuntimeError(Registry registry) {}
-
- /// Register that the application has a compile time error.
- void onCompileTimeError(Registry registry, ErroneousElement error) {}
-
- /// Register that the application may throw an
- /// [AbstractClassInstantiationError].
- void onAbstractClassInstantiation(Registry registry) {}
-
- /// Register that the application may throw a [FallThroughError].
- void onFallThroughError(Registry registry) {}
-
- /// Register that a super call will end up calling
- /// [: super.noSuchMethod :].
- void onSuperNoSuchMethod(Registry registry) {}
-
- /// Register that the application creates a constant map.
- void onMapLiteral(Registry registry, DartType type, bool isConstant) {}
-
- /// Called when resolving the `Symbol` constructor.
- void onSymbolConstructor(Registry registry) {}
-
- /// Called when resolving a prefix or postfix expression.
- void onIncDecOperation(Registry registry) {}
}
class ResolutionWorldImpact extends WorldImpact {
@@ -185,8 +109,6 @@ enum Feature {
INC_DEC_OPERATION,
/// A field whose initialization is not a constant.
LAZY_FIELD,
- /// A call to `new Symbol`.
- NEW_SYMBOL,
/// A catch clause with a variable for the stack trace.
STACK_TRACE_IN_CATCH,
/// String interpolation.
@@ -266,7 +188,7 @@ class ListLiteralUse {
/// [ResolutionWorldImpact] to [WorldImpact].
// TODO(johnniwinther): Remove [Registry] when dependency is tracked directly
// on [WorldImpact].
-class TransformedWorldImpact implements WorldImpact, Registry {
+class TransformedWorldImpact implements WorldImpact {
final ResolutionWorldImpact worldImpact;
Setlet<Element> _staticUses;
@@ -317,24 +239,8 @@ class TransformedWorldImpact implements WorldImpact, Registry {
return _staticUses;
}
- @override
- bool get isForResolution => true;
-
_unsupported(String message) => throw new UnsupportedError(message);
- @override
- Iterable<Element> get otherDependencies => _unsupported('otherDependencies');
-
- // TODO(johnniwinther): Remove this.
- @override
- void registerAssert(bool hasMessage) => _unsupported('registerAssert');
-
- @override
- void registerDependency(Element element) {
- worldImpact.registerDependency(element);
- }
-
- @override
void registerDynamicGetter(UniverseSelector selector) {
if (_dynamicGetters == null) {
_dynamicGetters = new Setlet<UniverseSelector>();
@@ -343,7 +249,6 @@ class TransformedWorldImpact implements WorldImpact, Registry {
_dynamicGetters.add(selector);
}
- @override
void registerDynamicInvocation(UniverseSelector selector) {
if (_dynamicInvocations == null) {
_dynamicInvocations = new Setlet<UniverseSelector>();
@@ -352,7 +257,6 @@ class TransformedWorldImpact implements WorldImpact, Registry {
_dynamicInvocations.add(selector);
}
- @override
void registerDynamicSetter(UniverseSelector selector) {
if (_dynamicSetters == null) {
_dynamicSetters = new Setlet<UniverseSelector>();
@@ -361,16 +265,10 @@ class TransformedWorldImpact implements WorldImpact, Registry {
_dynamicSetters.add(selector);
}
- @override
- void registerGetOfStaticFunction(FunctionElement element) {
- _unsupported('registerGetOfStaticFunction($element)');
- }
-
- @override
- void registerInstantiation(InterfaceType type) {
+ void registerInstantiatedType(InterfaceType type) {
// TODO(johnniwinther): Remove this when dependency tracking is done on
// the world impact itself.
- registerDependency(type.element);
+ worldImpact.registerDependency(type.element);
if (_instantiatedTypes == null) {
_instantiatedTypes = new Setlet<InterfaceType>();
}
@@ -383,11 +281,10 @@ class TransformedWorldImpact implements WorldImpact, Registry {
? _instantiatedTypes : const <InterfaceType>[];
}
- @override
- void registerStaticInvocation(Element element) {
+ void registerStaticUse(Element element) {
// TODO(johnniwinther): Remove this when dependency tracking is done on
// the world impact itself.
- registerDependency(element);
+ worldImpact.registerDependency(element);
if (_staticUses == null) {
_staticUses = new Setlet<Element>();
}
« no previous file with comments | « pkg/compiler/lib/src/common/codegen.dart ('k') | pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698