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

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
« no previous file with comments | « pkg/compiler/lib/src/kernel/env.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..b7adef5700486d402006976695e9cb5311e34878 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,10 @@ 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 [fromInstanceMember] is true, this
+ /// closure class represents a closure that is inside an instance member, thus
+ /// has access to `this`.
+ void registerClosureClass(covariant ClassEntity cls, bool fromInstanceMember);
}
abstract class OpenWorld implements World {
@@ -1178,6 +1179,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 +1308,7 @@ class ClosedWorldImpl extends ClosedWorldBase with ClosedWorldRtiNeedMixin {
return selector.appliesUntyped(element);
}
- void registerClosureClass(ClosureClassElement cls) {
+ void registerClosureClass(ClassElement cls, bool _) {
ClassHierarchyNode parentNode = getClassHierarchyNode(cls.superclass);
ClassHierarchyNode node = _classHierarchyNodes[cls] =
new ClassHierarchyNode(parentNode, cls, cls.hierarchyDepth);
« no previous file with comments | « 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