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

Unified Diff: pkg/compiler/lib/src/kernel/world_builder.dart

Issue 2829223003: Check equivalence of closed world based on kernel elements. (Closed)
Patch Set: Updated cf. comments. Created 3 years, 8 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/universe/element_world_builder.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/kernel/world_builder.dart
diff --git a/pkg/compiler/lib/src/kernel/world_builder.dart b/pkg/compiler/lib/src/kernel/world_builder.dart
index 3b7f3ccbda7cf67f2d4138ba89ee60e72f6a5d84..519b33f585de80d48e628fdd505ccba91faa1500 100644
--- a/pkg/compiler/lib/src/kernel/world_builder.dart
+++ b/pkg/compiler/lib/src/kernel/world_builder.dart
@@ -26,6 +26,7 @@ import '../native/resolver.dart';
import '../ordered_typeset.dart';
import '../ssa/kernel_impact.dart';
import '../universe/call_structure.dart';
+import '../universe/world_builder.dart';
import '../util/util.dart' show Link, LinkBuilder;
import 'element_adapter.dart';
import 'elements.dart';
@@ -1102,6 +1103,50 @@ class _EvaluationEnvironment implements Environment {
}
}
+class KernelResolutionWorldBuilder extends KernelResolutionWorldBuilderBase {
+ final KernelWorldBuilder worldBuilder;
+
+ KernelResolutionWorldBuilder(
+ this.worldBuilder,
+ NativeBasicData nativeBasicData,
+ SelectorConstraintsStrategy selectorConstraintsStrategy)
+ : super(worldBuilder.elementEnvironment, worldBuilder.commonElements,
+ nativeBasicData, selectorConstraintsStrategy);
+
+ @override
+ Iterable<InterfaceType> getSupertypes(ClassEntity cls) {
+ return worldBuilder._getOrderedTypeSet(cls).supertypes;
+ }
+
+ @override
+ ClassEntity getSuperClass(ClassEntity cls) {
+ return worldBuilder._getSuperType(cls)?.element;
+ }
+
+ @override
+ bool implementsFunction(ClassEntity cls) {
+ // TODO(johnniwinther): Implement this.
+ return false;
+ }
+
+ @override
+ int getHierarchyDepth(ClassEntity cls) {
+ return worldBuilder._getHierarchyDepth(cls);
+ }
+
+ @override
+ ClassEntity getAppliedMixin(ClassEntity cls) {
+ // TODO(johnniwinther): Implement this.
+ return null;
+ }
+
+ @override
+ bool validateClass(ClassEntity cls) => true;
+
+ @override
+ bool checkClass(ClassEntity cls) => true;
+}
+
// Interface for testing equivalence of Kernel-based entities.
class WorldDeconstructionForTesting {
final KernelWorldBuilder builder;
« no previous file with comments | « no previous file | pkg/compiler/lib/src/universe/element_world_builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698