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

Unified Diff: pkg/compiler/lib/src/js_emitter/program_builder.dart

Issue 871243003: dart2js: store adapters in the model. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 11 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
« no previous file with comments | « pkg/compiler/lib/src/js_emitter/old_emitter/container_builder.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/js_emitter/program_builder.dart
diff --git a/pkg/compiler/lib/src/js_emitter/program_builder.dart b/pkg/compiler/lib/src/js_emitter/program_builder.dart
index 01c38363c652c425b6f3f54251a396ed2a68a335..ccafbf53c769f4667d93c14fac988cca8faa5215 100644
--- a/pkg/compiler/lib/src/js_emitter/program_builder.dart
+++ b/pkg/compiler/lib/src/js_emitter/program_builder.dart
@@ -451,7 +451,20 @@ class ProgramBuilder {
assert(invariant(element, !element.isConstructor));
}
- return new InstanceMethod(element, name, code, needsTearOff: canTearOff,
+ List<AdapterStubMethod> adapters = needsStubs || canTearOff
+ ? _task.oldEmitter.containerBuilder.generateParameterStubs(
+ element, canTearOff: canTearOff)
+ : const <AdapterStubMethod>[];
+
+ String callName = null;
+ if (canTearOff) {
+ Selector callSelector =
+ new Selector.fromElement(element).toCallSelector();
+ callName = namer.invocationName(callSelector);
+ }
+
+ return new InstanceMethod(element, name, code, adapters, callName,
+ needsTearOff: canTearOff,
tearOffName: tearOffName, isClosure: isClosure,
hasSuperAlias: hasSuperAlias, canBeApplied: canBeApplied,
canBeReflected: canBeReflected, needsStubs: needsStubs);
@@ -562,19 +575,34 @@ class ProgramBuilder {
String holder = namer.globalObjectFor(element);
js.Expression code = backend.generatedCode[element];
- final bool isNotApplyTarget = !element.isConstructor && !element.isAccessor;
+ final bool isApplyTarget = !element.isConstructor && !element.isAccessor;
final bool needsStubs = _methodNeedsStubs(element);
final bool canBeApplied = _methodCanBeApplied(element);
final bool canBeReflected = _methodCanBeReflected(element);
- final bool needsTearOff = isNotApplyTarget && (canBeReflected ||
- universe.staticFunctionsNeedingGetter.contains(element));
+ final bool needsTearOff = isApplyTarget &&
+ (canBeReflected ||
+ universe.staticFunctionsNeedingGetter.contains(element));
final String tearOffName =
needsTearOff ? namer.getStaticClosureName(element) : null;
+ List<AdapterStubMethod> adapters = needsTearOff
+ ? _task.oldEmitter.containerBuilder.generateParameterStubs(
+ element, canTearOff: needsTearOff)
+ : const <AdapterStubMethod>[];
+
+ String callName = null;
+ if (needsTearOff) {
+ Selector callSelector =
+ new Selector.fromElement(element).toCallSelector();
+ callName = namer.invocationName(callSelector);
+ }
+
return new StaticDartMethod(element,
name, _registry.registerHolder(holder), code,
+ adapters,
+ callName,
needsTearOff: needsTearOff,
tearOffName: tearOffName,
canBeApplied: canBeApplied,
« no previous file with comments | « pkg/compiler/lib/src/js_emitter/old_emitter/container_builder.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698