Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(276)

Unified Diff: lib/compiler/implementation/native_handler.dart

Issue 10825337: Add name and library to selectors. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Merge from master. Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: lib/compiler/implementation/native_handler.dart
diff --git a/lib/compiler/implementation/native_handler.dart b/lib/compiler/implementation/native_handler.dart
index 54e5541d1673448c37439928ccec6ca6f04b0748..56ae07abffd18979d66cd6ae33b2bb6c9116c2d8 100644
--- a/lib/compiler/implementation/native_handler.dart
+++ b/lib/compiler/implementation/native_handler.dart
@@ -191,24 +191,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;
}

Powered by Google App Engine
This is Rietveld 408576698