Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dart2JS dump info duplicates code related to method alias installation #49348

Open
Markzipan opened this issue Jun 27, 2022 · 0 comments
Open
Labels
area-web Use area-web for Dart web related issues, including the DDC and dart2js compilers and JS interop. dart2js-info web-dart2js

Comments

@Markzipan
Copy link
Contributor

Snippet:

//@dart = 2.9

import 'package:expect/expect.dart';

class Super<T> {
  void method(T t) {}
}

class Mixin {
  void method(int t) {}
}

class Clazz = Super<int> with Mixin;

class Subclass extends Clazz {
  void test() {
	super.method(0);
  }
}

main() {
  Super<Object> s = new Subclass()..test();
  Expect.throws(() => s.method(''));
}

Generates function/mix.dart::Mixin.method and function/mix.dart::Clazz.method, both of which have an 81-byte code size overhead:
"code": "method$1(t) {\n }\nvar _ = A.Mixin.prototype;\n\n_.super$Mixin$method = _.method$1;\n",

However, that code snippet only occurs once. I suspect we're overcounting these cases.

@Markzipan Markzipan added web-dart2js dart2js-info area-web Use area-web for Dart web related issues, including the DDC and dart2js compilers and JS interop. labels Jun 27, 2022
copybara-service bot pushed a commit that referenced this issue Jun 28, 2022
Includes skipping duplicated installation code.
For more info, see #49348

Change-Id: I34833df32156d9fe090b579b665dd9cb93860f8b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/250020
Commit-Queue: Mark Zhou <markzipan@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-web Use area-web for Dart web related issues, including the DDC and dart2js compilers and JS interop. dart2js-info web-dart2js
Projects
None yet
Development

No branches or pull requests

1 participant