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

Unified Diff: pkg/compiler/lib/src/js_emitter/old_emitter/container_builder.dart

Issue 881363006: Store the aliasName of a method in the model. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: REBASE 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/model.dart ('k') | pkg/compiler/lib/src/js_emitter/program_builder.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/js_emitter/old_emitter/container_builder.dart
diff --git a/pkg/compiler/lib/src/js_emitter/old_emitter/container_builder.dart b/pkg/compiler/lib/src/js_emitter/old_emitter/container_builder.dart
index f7a586a237b996428a12e4409581dd3f768065b8..b225fb92114fa96078eca82a4c8917dcb8cfbdd7 100644
--- a/pkg/compiler/lib/src/js_emitter/old_emitter/container_builder.dart
+++ b/pkg/compiler/lib/src/js_emitter/old_emitter/container_builder.dart
@@ -11,19 +11,20 @@ part of dart2js.js_emitter;
class ContainerBuilder extends CodeEmitterHelper {
void addMemberMethod(DartMethod method, ClassBuilder builder) {
- final FunctionElement member = method.element;
+ FunctionElement member = method.element;
String name = method.name;
- final FunctionSignature parameters = member.functionSignature;
+ FunctionSignature parameters = member.functionSignature;
jsAst.Expression code = method.code;
- final bool needsStubs = method.parameterStubs.isNotEmpty;
- final bool canTearOff = method.needsTearOff;
- final String tearOffName = method.tearOffName;
- final bool canBeReflected = method.canBeReflected;
- final bool canBeApplied = method.canBeApplied;
- final bool isClosure = method is InstanceMethod && method.isClosure;
- final bool hasSuperAlias = method is InstanceMethod && method.hasSuperAlias;
-
- final bool needStructuredInfo =
+ bool needsStubs = method.parameterStubs.isNotEmpty;
+ bool canBeApplied = method.canBeApplied;
+ bool canBeReflected = method.canBeReflected;
+ bool canTearOff = method.needsTearOff;
+ String tearOffName = method.tearOffName;
+ bool isClosure = method is InstanceMethod && method.isClosure;
+ String superAlias = method is InstanceMethod ? method.aliasName : null;
+ bool hasSuperAlias = superAlias != null;
+
+ bool needStructuredInfo =
canTearOff || canBeReflected || canBeApplied || hasSuperAlias;
emitter.interceptorEmitter.recordMangledNameOfMemberMethod(member, name);
@@ -74,14 +75,13 @@ class ContainerBuilder extends CodeEmitterHelper {
List<jsAst.Expression> expressions = <jsAst.Expression>[];
// Create the optional aliasing entry if this method is called via super.
- if (backend.isAliasedSuperMember(member)) {
- expressions.add(new jsAst.LiteralString(
- '"${namer.getNameOfAliasedSuperMember(member)}"'));
+ if (hasSuperAlias) {
+ expressions.add(new jsAst.LiteralString('"${superAlias}"'));
}
expressions.add(code);
- final bool onlyNeedsSuperAlias =
+ bool onlyNeedsSuperAlias =
!(canTearOff || canBeReflected || canBeApplied || needsStubs);
if (onlyNeedsSuperAlias) {
« no previous file with comments | « pkg/compiler/lib/src/js_emitter/model.dart ('k') | pkg/compiler/lib/src/js_emitter/program_builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698