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

Unified Diff: pkg/compiler/lib/src/ssa/codegen.dart

Issue 2314703002: Split World usage into open, inference, and closed world. (Closed)
Patch Set: Updated cf. comments 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 | « pkg/compiler/lib/src/ssa/builder.dart ('k') | pkg/compiler/lib/src/ssa/interceptor_simplifier.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/ssa/codegen.dart
diff --git a/pkg/compiler/lib/src/ssa/codegen.dart b/pkg/compiler/lib/src/ssa/codegen.dart
index abd0314aa45d4ca41cd3399deef69fe4e94f619a..e294336c51a26cb7401d5b0717e9b26bf57f0f31 100644
--- a/pkg/compiler/lib/src/ssa/codegen.dart
+++ b/pkg/compiler/lib/src/ssa/codegen.dart
@@ -1656,21 +1656,22 @@ class SsaCodeGenerator implements HVisitor, HBlockInformationVisitor {
// type because our optimizations might end up in a state where the
// invoke dynamic knows more than the receiver.
ClassElement enclosing = node.element.enclosingClass;
- if (compiler.world.isInstantiated(enclosing)) {
- return new TypeMask.nonNullExact(enclosing.declaration, compiler.world);
+ if (compiler.closedWorld.isInstantiated(enclosing)) {
+ return new TypeMask.nonNullExact(
+ enclosing.declaration, compiler.closedWorld);
} else {
// The element is mixed in so a non-null subtype mask is the most
// precise we have.
- assert(invariant(node, compiler.world.isUsedAsMixin(enclosing),
+ assert(invariant(node, compiler.closedWorld.isUsedAsMixin(enclosing),
message: "Element ${node.element} from $enclosing expected "
"to be mixed in."));
return new TypeMask.nonNullSubtype(
- enclosing.declaration, compiler.world);
+ enclosing.declaration, compiler.closedWorld);
}
}
// If [JSInvocationMirror._invokeOn] is enabled, and this call
// might hit a `noSuchMethod`, we register an untyped selector.
- return compiler.world.extendMaskIfReachesAll(selector, mask);
+ return compiler.closedWorld.extendMaskIfReachesAll(selector, mask);
}
void registerMethodInvoke(HInvokeDynamic node) {
@@ -2708,7 +2709,7 @@ class SsaCodeGenerator implements HVisitor, HBlockInformationVisitor {
js.Expression generateReceiverOrArgumentTypeTest(
HInstruction input, TypeMask checkedType) {
- ClassWorld classWorld = compiler.world;
+ ClassWorld classWorld = compiler.closedWorld;
TypeMask inputType = input.instructionType;
// Figure out if it is beneficial to turn this into a null check.
// V8 generally prefers 'typeof' checks, but for integers and
@@ -2748,7 +2749,7 @@ class SsaCodeGenerator implements HVisitor, HBlockInformationVisitor {
void visitTypeConversion(HTypeConversion node) {
if (node.isArgumentTypeCheck || node.isReceiverTypeCheck) {
- ClassWorld classWorld = compiler.world;
+ ClassWorld classWorld = compiler.closedWorld;
// An int check if the input is not int or null, is not
// sufficient for doing an argument or receiver check.
assert(compiler.options.trustTypeAnnotations ||
@@ -2915,10 +2916,11 @@ class SsaCodeGenerator implements HVisitor, HBlockInformationVisitor {
}
bool needsSubstitutionForTypeVariableAccess(ClassElement cls) {
- ClassWorld classWorld = compiler.world;
+ ClassWorld classWorld = compiler.closedWorld;
if (classWorld.isUsedAsMixin(cls)) return true;
- return compiler.world.anyStrictSubclassOf(cls, (ClassElement subclass) {
+ return compiler.closedWorld.anyStrictSubclassOf(cls,
+ (ClassElement subclass) {
return !backend.rti.isTrivialSubstitution(subclass, cls);
});
}
« no previous file with comments | « pkg/compiler/lib/src/ssa/builder.dart ('k') | pkg/compiler/lib/src/ssa/interceptor_simplifier.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698