Index: pkg/compiler/lib/src/universe/codegen_world_builder.dart |
diff --git a/pkg/compiler/lib/src/universe/codegen_world_builder.dart b/pkg/compiler/lib/src/universe/codegen_world_builder.dart |
index e1bead987d39f40bc0290bfc7e8529cd1622719c..409624961d863a400324b2f93936a657a3a90bd9 100644 |
--- a/pkg/compiler/lib/src/universe/codegen_world_builder.dart |
+++ b/pkg/compiler/lib/src/universe/codegen_world_builder.dart |
@@ -14,9 +14,9 @@ abstract class CodegenWorldBuilder implements WorldBuilder { |
ClassEntity cls, void f(ClassEntity declarer, FieldEntity field)); |
/// Calls [f] for each parameter of [function] providing the type and name of |
- /// the parameter and the [defaultValue] if the parameter is optional. |
- void forEachParameter(FunctionEntity function, |
- void f(DartType type, String name, ConstantValue defaultValue)); |
+ /// the parameter. |
+ void forEachParameter( |
+ FunctionEntity function, void f(DartType type, String name)); |
void forEachInvokedName( |
f(String name, Map<Selector, SelectorConstraints> selectors)); |
@@ -27,12 +27,6 @@ abstract class CodegenWorldBuilder implements WorldBuilder { |
void forEachInvokedSetter( |
f(String name, Map<Selector, SelectorConstraints> selectors)); |
- /// Returns `true` if [field] has a constant initializer. |
- bool hasConstantFieldInitializer(FieldEntity field); |
- |
- /// Returns the constant initializer for [field]. |
- ConstantValue getConstantFieldInitializer(FieldEntity field); |
- |
/// Returns `true` if [member] is invoked as a setter. |
bool hasInvokedSetter(MemberEntity member, ClosedWorld world); |
@@ -548,10 +542,7 @@ abstract class CodegenWorldBuilderImpl implements CodegenWorldBuilder { |
} |
class ElementCodegenWorldBuilderImpl extends CodegenWorldBuilderImpl { |
- final JavaScriptConstantCompiler _constants; |
- |
ElementCodegenWorldBuilderImpl( |
- this._constants, |
ElementEnvironment elementEnvironment, |
NativeBasicData nativeBasicData, |
ClosedWorld world, |
@@ -559,18 +550,6 @@ class ElementCodegenWorldBuilderImpl extends CodegenWorldBuilderImpl { |
: super(elementEnvironment, nativeBasicData, world, |
selectorConstraintsStrategy); |
- @override |
- bool hasConstantFieldInitializer(FieldElement field) { |
- return field.constant != null; |
- } |
- |
- @override |
- ConstantValue getConstantFieldInitializer(FieldElement field) { |
- assert(field.constant != null, |
- failedAt(field, "Field $field doesn't have a constant initial value.")); |
- return _constants.getConstantValue(field.constant); |
- } |
- |
/// Calls [f] with every instance field, together with its declarer, in an |
/// instance of [cls]. |
void forEachInstanceField( |
@@ -580,18 +559,12 @@ class ElementCodegenWorldBuilderImpl extends CodegenWorldBuilderImpl { |
} |
@override |
- void forEachParameter(MethodElement function, |
- void f(DartType type, String name, ConstantValue defaultValue)) { |
+ void forEachParameter( |
+ MethodElement function, void f(DartType type, String name)) { |
FunctionSignature parameters = function.functionSignature; |
parameters.forEachParameter((_parameter) { |
ParameterElement parameter = _parameter; |
- ConstantValue value; |
- if (parameter.constant != null) { |
- value = _constants.getConstantValue(parameter.constant); |
- } else { |
- value = new NullConstantValue(); |
- } |
- f(parameter.type, parameter.name, value); |
+ f(parameter.type, parameter.name); |
}); |
} |
@@ -627,10 +600,7 @@ class ElementCodegenWorldBuilderImpl extends CodegenWorldBuilderImpl { |
} |
class KernelCodegenWorldBuilder extends CodegenWorldBuilderImpl { |
- KernelToElementMapImpl _elementMap; |
- |
KernelCodegenWorldBuilder( |
- this._elementMap, |
ElementEnvironment elementEnvironment, |
NativeBasicData nativeBasicData, |
ClosedWorld world, |
@@ -639,19 +609,9 @@ class KernelCodegenWorldBuilder extends CodegenWorldBuilderImpl { |
selectorConstraintsStrategy); |
@override |
- bool hasConstantFieldInitializer(FieldEntity field) { |
- return _elementMap.hasConstantFieldInitializer(field); |
- } |
- |
- @override |
- ConstantValue getConstantFieldInitializer(FieldEntity field) { |
- return _elementMap.getConstantFieldInitializer(field); |
- } |
- |
- @override |
- void forEachParameter(FunctionEntity function, |
- void f(DartType type, String name, ConstantValue defaultValue)) { |
- _elementMap.forEachParameter(function, f); |
+ void forEachParameter( |
+ FunctionEntity function, void f(DartType type, String name)) { |
+ throw new UnimplementedError('KernelCodegenWorldBuilder.forEachParameter'); |
} |
@override |