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

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

Issue 2310573002: dart2js: Pass type information to constructor rather than add later. (Closed)
Patch Set: Filter out type info pseudofield when parsing fieldspec for mirrors 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 2bd492d656ede023310ad8c0eaf8463963d25dcb..e813fe938a9f6e0dee1eefc47ca68fd2d6172d24 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 (!type.treatAsRaw && classNeedsRti(type.element)) {
+ if (classNeedsRtiField(type.element)) {
registry.registerStaticUse(new StaticUse.staticInvoke(
// TODO(johnniwinther): Find the right [CallStructure].
helpers.setRuntimeTypeInfo,
@@ -1475,8 +1475,14 @@ class JavaScriptBackend extends Backend {
}
bool classNeedsRti(ClassElement cls) {
- return rti.classesNeedingRti.contains(cls.declaration) ||
- compiler.enabledRuntimeType;
+ 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);
}
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