| Index: sdk/lib/_internal/compiler/implementation/ssa/builder.dart
|
| ===================================================================
|
| --- sdk/lib/_internal/compiler/implementation/ssa/builder.dart (revision 23797)
|
| +++ sdk/lib/_internal/compiler/implementation/ssa/builder.dart (working copy)
|
| @@ -54,33 +54,11 @@
|
| if (!identical(kind, ElementKind.FIELD)) {
|
| FunctionElement function = element;
|
| graph.calledInLoop = compiler.world.isCalledInLoop(function);
|
| - OptionalParameterTypes defaultValueTypes = null;
|
| FunctionSignature signature = function.computeSignature(compiler);
|
| - if (signature.optionalParameterCount > 0) {
|
| - defaultValueTypes =
|
| - new OptionalParameterTypes(signature.optionalParameterCount);
|
| - int index = 0;
|
| - signature.forEachOptionalParameter((Element parameter) {
|
| - Constant defaultValue = builder.compileVariable(parameter);
|
| - HType type = HGraph.mapConstantTypeToSsaType(defaultValue);
|
| - defaultValueTypes.update(index, parameter.name, type);
|
| - index++;
|
| - });
|
| - } else {
|
| - // BUG(10938): the types are stored in the wrong order.
|
| - // order.
|
| - HTypeList parameterTypes =
|
| - backend.optimisticParameterTypes(element.declaration,
|
| - defaultValueTypes);
|
| - if (!parameterTypes.allUnknown) {
|
| - int i = 0;
|
| - signature.forEachParameter((Element param) {
|
| - builder.parameters[param].instructionType = parameterTypes[i++];
|
| - });
|
| - }
|
| - backend.registerParameterTypesOptimization(
|
| - element.declaration, parameterTypes, defaultValueTypes);
|
| - }
|
| + signature.forEachOptionalParameter((Element parameter) {
|
| + // This ensures the default value will be computed.
|
| + builder.compileVariable(parameter);
|
| + });
|
| }
|
|
|
| if (compiler.tracer.enabled) {
|
| @@ -1141,12 +1119,6 @@
|
| List<HInstruction> compiledArguments;
|
| bool isInstanceMember = function.isInstanceMember();
|
|
|
| - if (function.isGenerativeConstructor()) {
|
| - // The optimistic field type optimization requires
|
| - // to know all generative constructors seen in codegen.
|
| - backend.registerConstructor(function);
|
| - }
|
| -
|
| if (currentNode == null
|
| || currentNode.asForIn() != null
|
| || !isInstanceMember
|
| @@ -3790,14 +3762,6 @@
|
|
|
| if (type == null) {
|
| type = new HType.inferredReturnTypeForElement(element, compiler);
|
| - if (type.isUnknown()) {
|
| - // TODO(ngeoffray): Only do this if knowing the return type is
|
| - // useful.
|
| - type =
|
| - builder.backend.optimisticReturnTypesWithRecompilationOnTypeChange(
|
| - currentElement, element);
|
| - if (type == null) type = HType.UNKNOWN;
|
| - }
|
| }
|
| // TODO(5346): Try to avoid the need for calling [declaration] before
|
| // creating an [HInvokeStatic].
|
|
|