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

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

Issue 2319863002: Revert "dart2js: Pass type information to constructor rather than add later." (Closed)
Patch Set: Created 4 years, 3 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 | pkg/compiler/lib/src/js_backend/constant_emitter.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 e813fe938a9f6e0dee1eefc47ca68fd2d6172d24..2bd492d656ede023310ad8c0eaf8463963d25dcb 100644
--- a/pkg/compiler/lib/src/js_backend/backend.dart
+++ b/pkg/compiler/lib/src/js_backend/backend.dart
@@ -1106,7 +1106,7 @@ class JavaScriptBackend extends Backend {
type.isFunctionType ? coreTypes.functionType : type;
if (type is InterfaceType) {
registry.registerInstantiation(instantiatedType);
- if (classNeedsRtiField(type.element)) {
+ if (!type.treatAsRaw && classNeedsRti(type.element)) {
registry.registerStaticUse(new StaticUse.staticInvoke(
// TODO(johnniwinther): Find the right [CallStructure].
helpers.setRuntimeTypeInfo,
@@ -1475,14 +1475,8 @@ class JavaScriptBackend extends Backend {
}
bool classNeedsRti(ClassElement cls) {
- if (compiler.enabledRuntimeType) return true;
- return rti.classesNeedingRti.contains(cls.declaration);
- }
-
- bool classNeedsRtiField(ClassElement cls) {
- if (cls.rawType.typeArguments.isEmpty) return false;
- if (compiler.enabledRuntimeType) return true;
- return rti.classesNeedingRti.contains(cls.declaration);
+ return rti.classesNeedingRti.contains(cls.declaration) ||
+ compiler.enabledRuntimeType;
}
bool isComplexNoSuchMethod(FunctionElement element) =>
« no previous file with comments | « no previous file | pkg/compiler/lib/src/js_backend/constant_emitter.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698