| Index: lib/compiler/implementation/native_handler.dart
|
| diff --git a/lib/compiler/implementation/native_handler.dart b/lib/compiler/implementation/native_handler.dart
|
| index e2fcb00a32f6c13d356fcbb60235f0290fd7e196..a75a3f44a0ac73dd752ea092230aadf462f5c8e9 100644
|
| --- a/lib/compiler/implementation/native_handler.dart
|
| +++ b/lib/compiler/implementation/native_handler.dart
|
| @@ -190,24 +190,20 @@ void handleSsaNative(SsaBuilder builder, Expression nativeBody) {
|
| if (element.name == const SourceString('typeName')
|
| && element.isGetter()
|
| && nativeEmitter.toNativeName(element.getEnclosingClass()) == 'DOMType') {
|
| - Element methodElement =
|
| + Element helper =
|
| compiler.findHelper(const SourceString('getTypeNameOf'));
|
| - HStatic method = new HStatic(methodElement);
|
| - builder.add(method);
|
| - builder.push(new HInvokeStatic(Selector.INVOCATION_1,
|
| - <HInstruction>[method, builder.localsHandler.readThis()]));
|
| + builder.pushInvokeHelper1(helper, builder.localsHandler.readThis());
|
| builder.close(new HReturn(builder.pop())).addSuccessor(builder.graph.exit);
|
| }
|
|
|
| HInstruction convertDartClosure(Element parameter, FunctionType type) {
|
| HInstruction local = builder.localsHandler.readLocal(parameter);
|
| + HInstruction arity = builder.graph.addConstantInt(type.computeArity());
|
| // TODO(ngeoffray): For static methods, we could pass a method with a
|
| // defined arity.
|
| - builder.push(new HStatic(builder.interceptors.getClosureConverter()));
|
| - HInstruction arity = builder.graph.addConstantInt(type.computeArity());
|
| - List<HInstruction> callInputs = <HInstruction>[builder.pop(), local, arity];
|
| - HInstruction closure = new HInvokeStatic(Selector.INVOCATION_1, callInputs);
|
| - builder.add(closure);
|
| + Element helper = builder.interceptors.getClosureConverter();
|
| + builder.pushInvokeHelper2(helper, local, arity);
|
| + HInstruction closure = builder.pop();
|
| return closure;
|
| }
|
|
|
|
|