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

Unified Diff: pkg/compiler/lib/src/constants/constructors.dart

Issue 2857373002: Handle more constants in Constantifier (Closed)
Patch Set: Updated cf. comments. Created 3 years, 7 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/compiler.dart ('k') | pkg/compiler/lib/src/constants/evaluation.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/constants/constructors.dart
diff --git a/pkg/compiler/lib/src/constants/constructors.dart b/pkg/compiler/lib/src/constants/constructors.dart
index f5d5ab7ca3acac9e8c1327c5215185737ef08dce..c0b3d12740c8d5d862f0a48e66728bab1ad3bc86 100644
--- a/pkg/compiler/lib/src/constants/constructors.dart
+++ b/pkg/compiler/lib/src/constants/constructors.dart
@@ -24,12 +24,12 @@ abstract class ConstantConstructor {
/// Computes the type of the instance created in a const constructor
/// invocation with type [newType].
InterfaceType computeInstanceType(
- Environment environment, InterfaceType newType);
+ EvaluationEnvironment environment, InterfaceType newType);
/// Computes the constant expressions of the fields of the created instance
/// in a const constructor invocation with [arguments].
Map<FieldEntity, ConstantExpression> computeInstanceFields(
- Environment environment,
+ EvaluationEnvironment environment,
List<ConstantExpression> arguments,
CallStructure callStructure);
@@ -63,12 +63,12 @@ class GenerativeConstantConstructor implements ConstantConstructor {
ConstantConstructorKind get kind => ConstantConstructorKind.GENERATIVE;
InterfaceType computeInstanceType(
- Environment environment, InterfaceType newType) {
+ EvaluationEnvironment environment, InterfaceType newType) {
return environment.substByContext(type, newType);
}
Map<FieldEntity, ConstantExpression> computeInstanceFields(
- Environment environment,
+ EvaluationEnvironment environment,
List<ConstantExpression> arguments,
CallStructure callStructure) {
NormalizedArguments args =
@@ -131,7 +131,7 @@ class GenerativeConstantConstructor implements ConstantConstructor {
/// [constructorInvocation]. If [constructorInvocation] is `null`, an empty
/// map is created.
static Map<FieldEntity, ConstantExpression> applyFields(
- Environment environment,
+ EvaluationEnvironment environment,
NormalizedArguments args,
ConstructedConstantExpression constructorInvocation) {
Map<FieldEntity, ConstantExpression> appliedFieldMap =
@@ -160,13 +160,13 @@ class RedirectingGenerativeConstantConstructor implements ConstantConstructor {
}
InterfaceType computeInstanceType(
- Environment environment, InterfaceType newType) {
+ EvaluationEnvironment environment, InterfaceType newType) {
return environment.substByContext(
thisConstructorInvocation.computeInstanceType(environment), newType);
}
Map<FieldEntity, ConstantExpression> computeInstanceFields(
- Environment environment,
+ EvaluationEnvironment environment,
List<ConstantExpression> arguments,
CallStructure callStructure) {
NormalizedArguments args =
@@ -217,13 +217,13 @@ class RedirectingFactoryConstantConstructor implements ConstantConstructor {
}
InterfaceType computeInstanceType(
- Environment environment, InterfaceType newType) {
+ EvaluationEnvironment environment, InterfaceType newType) {
return environment.substByContext(
targetConstructorInvocation.computeInstanceType(environment), newType);
}
Map<FieldEntity, ConstantExpression> computeInstanceFields(
- Environment environment,
+ EvaluationEnvironment environment,
List<ConstantExpression> arguments,
CallStructure callStructure) {
ConstantConstructor constantConstructor =
« no previous file with comments | « pkg/compiler/lib/src/compiler.dart ('k') | pkg/compiler/lib/src/constants/evaluation.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698