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

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: Make library == null for non-private selectors. 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 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;
}

Powered by Google App Engine
This is Rietveld 408576698