Index: pkg/compiler/lib/src/kernel/element_map_impl.dart |
diff --git a/pkg/compiler/lib/src/kernel/element_map_impl.dart b/pkg/compiler/lib/src/kernel/element_map_impl.dart |
index 4d0483de4811780b35742ff41d29ae6f9d57ebaa..07dc4f65c4e3c48fb953cc2124373149a4c6e76e 100644 |
--- a/pkg/compiler/lib/src/kernel/element_map_impl.dart |
+++ b/pkg/compiler/lib/src/kernel/element_map_impl.dart |
@@ -141,7 +141,6 @@ class KernelToElementMapImpl extends KernelToElementMapMixin { |
@override |
ConstantValue getFieldConstantValue(ir.Field field) { |
- // TODO(johnniwinther): Cache the result in [_FieldData]. |
return getConstantValue(field.initializer, requireConstant: field.isConst); |
} |
@@ -674,31 +673,12 @@ class KernelToElementMapImpl extends KernelToElementMapMixin { |
@override |
FieldEntity getField(ir.Field node) => _getField(node); |
- bool hasConstantFieldInitializer(KField field) { |
- _FieldData data = _memberList[field.memberIndex]; |
- return getFieldConstantValue(data.node) != null; |
- } |
- |
- ConstantValue getConstantFieldInitializer(KField field) { |
- _FieldData data = _memberList[field.memberIndex]; |
- ConstantValue value = getFieldConstantValue(data.node); |
- assert(value != null, |
- failedAt(field, "Field $field doesn't have a constant initial value.")); |
- return value; |
- } |
- |
TypeVariableEntity getTypeVariable(ir.TypeParameter node) => |
_getTypeVariable(node); |
@override |
FunctionEntity getMethod(ir.Procedure node) => _getMethod(node); |
- void forEachParameter(KFunction function, |
- void f(DartType type, String name, ConstantValue defaultValue)) { |
- _FunctionData data = _memberList[function.memberIndex]; |
- data.forEachParameter(this, f); |
- } |
- |
@override |
MemberEntity getMember(ir.Member node) { |
if (node is ir.Field) { |
@@ -1086,29 +1066,6 @@ class _FunctionData extends _MemberData { |
FunctionType getFunctionType(KernelToElementMapImpl elementMap) { |
return _type ??= elementMap.getFunctionType(functionNode); |
} |
- |
- void forEachParameter(KernelToElementMap elementMap, |
- void f(DartType type, String name, ConstantValue defaultValue)) { |
- void handleParameter(ir.VariableDeclaration node, {bool isOptional: true}) { |
- DartType type = elementMap.getDartType(node.type); |
- String name = node.name; |
- ConstantValue defaultValue; |
- if (isOptional) { |
- if (node.initializer != null) { |
- defaultValue = elementMap.getConstantValue(node.initializer); |
- } else { |
- defaultValue = new NullConstantValue(); |
- } |
- } |
- f(type, name, defaultValue); |
- } |
- |
- for (int i = 0; i < functionNode.positionalParameters.length; i++) { |
- handleParameter(functionNode.positionalParameters[i], |
- isOptional: i < functionNode.requiredParameterCount); |
- } |
- functionNode.namedParameters.forEach(handleParameter); |
- } |
} |
class _ConstructorData extends _FunctionData { |