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

Unified Diff: pkg/compiler/lib/src/world.dart

Issue 2981673002: Register created closure class with the world. (Closed)
Patch Set: . Created 3 years, 5 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/world.dart
diff --git a/pkg/compiler/lib/src/world.dart b/pkg/compiler/lib/src/world.dart
index 1744f3eb2d94d42ab3417d2305cc4f027011deae..2c6a6fc99583d8830a7f78fcd6cc608651f70c11 100644
--- a/pkg/compiler/lib/src/world.dart
+++ b/pkg/compiler/lib/src/world.dart
@@ -4,7 +4,6 @@
library dart2js.world;
-import 'closure.dart' show ClosureClassElement;
import 'common.dart';
import 'constants/constant_system.dart';
import 'common_elements.dart' show CommonElements, ElementEnvironment;
@@ -376,8 +375,9 @@ abstract class ClosedWorldRefiner {
void registerCannotThrow(FunctionEntity element);
/// Adds the closure class [cls] to the inference world. The class is
- /// considered directly instantiated.
- void registerClosureClass(covariant ClassElement cls);
+ /// considered directly instantiated. If isInstanceMember is true, this
+ /// closure class represents a closure that is an instance member in a class.
Siggi Cherem (dart-lang) 2017/07/12 21:25:04 not sure I understand the concept of a "closure in
Emily Fortuna 2017/07/12 22:02:18 yes, that's what I meant, and that is phrased much
+ void registerClosureClass(covariant ClassEntity cls, bool isInstanceMember);
}
abstract class OpenWorld implements World {
@@ -1178,6 +1178,16 @@ abstract class ClosedWorldBase implements ClosedWorld, ClosedWorldRefiner {
.printOn(sb, ' ', instantiatedOnly: cls == null, withRespectTo: cls);
return sb.toString();
}
+
+ /// Should only be called by subclasses.
+ void addClassHierarchyNode(ClassEntity cls, ClassHierarchyNode node) {
+ _classHierarchyNodes[cls] = node;
+ }
+
+ /// Should only be called by subclasses.
+ void addClassSet(ClassEntity cls, ClassSet classSet) {
+ _classSets[cls] = classSet;
+ }
}
class ClosedWorldImpl extends ClosedWorldBase with ClosedWorldRtiNeedMixin {
@@ -1297,7 +1307,7 @@ class ClosedWorldImpl extends ClosedWorldBase with ClosedWorldRtiNeedMixin {
return selector.appliesUntyped(element);
}
- void registerClosureClass(ClosureClassElement cls) {
+ void registerClosureClass(ClassElement cls, bool not_used) {
Siggi Cherem (dart-lang) 2017/07/12 21:25:04 nit: a common convention is to use "_" for unused
Emily Fortuna 2017/07/12 22:02:18 done.
ClassHierarchyNode parentNode = getClassHierarchyNode(cls.superclass);
ClassHierarchyNode node = _classHierarchyNodes[cls] =
new ClassHierarchyNode(parentNode, cls, cls.hierarchyDepth);
« pkg/compiler/lib/src/kernel/env.dart ('K') | « pkg/compiler/lib/src/kernel/env.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698