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

Unified Diff: pkg/compiler/lib/src/js_emitter/new_emitter/model_emitter.dart

Issue 891743002: Add support for super aliases to new emitter. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: fix warning 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 | « no previous file | 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/new_emitter/model_emitter.dart
diff --git a/pkg/compiler/lib/src/js_emitter/new_emitter/model_emitter.dart b/pkg/compiler/lib/src/js_emitter/new_emitter/model_emitter.dart
index 3749723ecd104aef64320be0a7c7e88c240e761c..9ddaa0903ce5e45cf5e4f92fb1210a460e89882d 100644
--- a/pkg/compiler/lib/src/js_emitter/new_emitter/model_emitter.dart
+++ b/pkg/compiler/lib/src/js_emitter/new_emitter/model_emitter.dart
@@ -429,6 +429,7 @@ class ModelEmitter {
/// [DartMethod.tearOffName]
/// [JavaScriptBackend.isInterceptedMethod]
/// functionType
+ /// [InstanceMethod.aliasName]
///
/// followed by
///
@@ -443,7 +444,7 @@ function parseFunctionDescriptor(proto, name, descriptor) {
proto[name] = descriptor[0];
var funs = [descriptor[0]];
funs[0].$callName = descriptor[1];
- for (var pos = 5; pos < descriptor.length; pos += 3) {
+ for (var pos = 6; pos < descriptor.length; pos += 3) {
var stub = descriptor[pos + 2];
stub.$callName = descriptor[pos + 1];
proto[descriptor[pos]] = stub;
@@ -455,6 +456,10 @@ function parseFunctionDescriptor(proto, name, descriptor) {
proto[descriptor[2]] =
tearOff(funs, reflectionInfo, false, name, isIntercepted);
}
+ // Install the alias for super calls on the prototype chain.
+ if (desc[5] != null) {
+ proto[desc[5]] = desc[0];
+ }
} else {
proto[name] = descriptor;
}
@@ -483,18 +488,23 @@ function parseFunctionDescriptor(proto, name, descriptor) {
return [js.string(stub.name), callName, stub.code];
}
- if (method is DartMethod) {
- if (method.needsTearOff) {
+ if (method is InstanceMethod) {
+ if (method.needsTearOff || method.aliasName != null) {
/// See [parseFunctionDescriptorBoilerplate] for a full description of
/// the format.
// [name, [function, callName, tearOffName, isIntercepted, functionType,
- // stub1_name, stub1_callName, stub1_code, ...]
+ // aliasName, stub1_name, stub1_callName, stub1_code, ...]
bool isIntercepted = backend.isInterceptedMethod(method.element);
var data = [method.code];
data.add(js.string(method.callName));
data.add(js.string(method.tearOffName));
data.add(new js.LiteralBool(isIntercepted));
data.add(_generateFunctionType(method.type));
+ if (method.aliasName != null) {
+ data.add(js.string(method.aliasName));
+ } else {
+ data.add(new js.LiteralNull());
+ }
data.addAll(method.parameterStubs.expand(makeNameCallNameCodeTriplet));
return [js.string(method.name), new js.ArrayInitializer(data)];
} else {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698