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

Unified Diff: pkg/compiler/lib/src/js_backend/backend.dart

Issue 1913033002: dart2js: Pass type information to constructor rather than add later. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: rebase Created 4 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: pkg/compiler/lib/src/js_backend/backend.dart
diff --git a/pkg/compiler/lib/src/js_backend/backend.dart b/pkg/compiler/lib/src/js_backend/backend.dart
index b79556e5e4187959d86c68965a39ea7851c8ac39..b9c86b1ab0c0452e410b38f0aa5c9b3983d3e6ee 100644
--- a/pkg/compiler/lib/src/js_backend/backend.dart
+++ b/pkg/compiler/lib/src/js_backend/backend.dart
@@ -1113,7 +1113,7 @@ class JavaScriptBackend extends Backend {
type.isFunctionType ? coreTypes.functionType : type;
if (type is InterfaceType) {
registry.registerInstantiation(instantiatedType);
- if (!type.treatAsRaw && classNeedsRti(type.element)) {
+ if (classNeedsRti(type.element)) {
registry.registerStaticUse(new StaticUse.staticInvoke(
// TODO(johnniwinther): Find the right [CallStructure].
helpers.setRuntimeTypeInfo,
@@ -1486,8 +1486,10 @@ class JavaScriptBackend extends Backend {
}
bool classNeedsRti(ClassElement cls) {
- return rti.classesNeedingRti.contains(cls.declaration) ||
- compiler.enabledRuntimeType;
+ if (cls.rawType.typeArguments.isEmpty) return false;
+ if (rti.classesNeedingRti.contains(cls.declaration)) return true;
+ if (compiler.enabledRuntimeType) return true; // Needed e.g. to print.
+ return false;
}
bool isComplexNoSuchMethod(FunctionElement element) =>

Powered by Google App Engine
This is Rietveld 408576698