| Index: lib/compiler/implementation/ssa/builder.dart
|
| diff --git a/lib/compiler/implementation/ssa/builder.dart b/lib/compiler/implementation/ssa/builder.dart
|
| index 03109eaf8858d4b900a8216a9c460d719831d0de..358daf16742c6c8baeadd5f25a178c95e32e7206 100644
|
| --- a/lib/compiler/implementation/ssa/builder.dart
|
| +++ b/lib/compiler/implementation/ssa/builder.dart
|
| @@ -184,6 +184,9 @@ class SsaBuilderTask extends CompilerTask {
|
| graph = builder.buildMethod(element);
|
| } else if (kind === ElementKind.FIELD) {
|
| graph = builder.buildLazyInitializer(element);
|
| + } else {
|
| + compiler.internalErrorOnElement(element,
|
| + 'unexpected element kind $kind');
|
| }
|
| assert(graph.isValid());
|
| if (kind !== ElementKind.FIELD) {
|
| @@ -196,8 +199,11 @@ class SsaBuilderTask extends CompilerTask {
|
|
|
| // If there is an estimate of the parameter types assume these types
|
| // when compiling.
|
| + // TODO(karlklose,ngeoffray): add a check to make sure that element is
|
| + // of type FunctionElement.
|
| + FunctionElement function = element;
|
| OptionalParameterTypes defaultValueTypes = null;
|
| - FunctionSignature signature = element.computeSignature(compiler);
|
| + FunctionSignature signature = function.computeSignature(compiler);
|
| if (signature.optionalParameterCount > 0) {
|
| defaultValueTypes =
|
| new OptionalParameterTypes(signature.optionalParameterCount);
|
| @@ -1345,7 +1351,8 @@ class SsaBuilder extends ResolvedVisitor implements Visitor {
|
| // for us here?
|
| LibraryElement library = body.getLibrary();
|
| Selector selector = new Selector.call(name, library, arity);
|
| - HInstruction invoke = new HInvokeDynamicMethod(selector, bodyCallInputs);
|
| + HInvokeDynamic invoke =
|
| + new HInvokeDynamicMethod(selector, bodyCallInputs);
|
| invoke.element = body;
|
| add(invoke);
|
| }
|
| @@ -2625,8 +2632,8 @@ class SsaBuilder extends ResolvedVisitor implements Visitor {
|
| // TODO(johnniwinther): Try to eliminate the need to distinguish declaration
|
| // and implementation signatures. Currently it is need because the
|
| // signatures have different elements for parameters.
|
| - FunctionSignature params
|
| - = function.implementation.computeSignature(compiler);
|
| + FunctionElement implementation = function.implementation;
|
| + FunctionSignature params = implementation.computeSignature(compiler);
|
| if (params.optionalParameterCount !== 0) {
|
| compiler.cancel(
|
| 'JS_TO_CLOSURE does not handle closure with optional parameters',
|
|
|