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_helpers.dart

Issue 2563443007: Reduce use of Compiler.closedWorld (Closed)
Patch Set: Created 4 years 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/codegen.dart ('k') | pkg/compiler/lib/src/ssa/graph_builder.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_helpers.dart
diff --git a/pkg/compiler/lib/src/ssa/codegen_helpers.dart b/pkg/compiler/lib/src/ssa/codegen_helpers.dart
index 34d156b292898108a4e11f060c93f6c951c8e543..04fdb11aac35797024885dbec220780202708e6c 100644
--- a/pkg/compiler/lib/src/ssa/codegen_helpers.dart
+++ b/pkg/compiler/lib/src/ssa/codegen_helpers.dart
@@ -8,6 +8,7 @@ import '../elements/elements.dart';
import '../js_backend/js_backend.dart';
import '../types/types.dart';
import '../universe/selector.dart' show Selector;
+import '../world.dart' show ClosedWorld;
import 'nodes.dart';
/**
@@ -22,6 +23,8 @@ class SsaInstructionSelection extends HBaseVisitor {
JavaScriptBackend get backend => compiler.backend;
+ ClosedWorld get closedWorld => compiler.closedWorld;
+
void visitGraph(HGraph graph) {
this.graph = graph;
visitDominatorTree(graph);
@@ -67,7 +70,7 @@ class SsaInstructionSelection extends HBaseVisitor {
HInstruction interceptor = node.interceptor;
if (interceptor != null) {
return new HIsViaInterceptor(
- node.typeExpression, interceptor, backend.boolType);
+ node.typeExpression, interceptor, closedWorld.commonMasks.boolType);
}
}
return node;
@@ -86,7 +89,7 @@ class SsaInstructionSelection extends HBaseVisitor {
if (leftType.isNullable && rightType.isNullable) {
if (left.isConstantNull() ||
right.isConstantNull() ||
- (left.isPrimitive(compiler) && leftType == rightType)) {
+ (left.isPrimitive(closedWorld) && leftType == rightType)) {
return '==';
}
return null;
@@ -242,7 +245,7 @@ class SsaInstructionSelection extends HBaseVisitor {
HInstruction bitop(String assignOp) {
// HBitAnd, HBitOr etc. are more difficult because HBitAnd(a.x, y)
// sometimes needs to be forced to unsigned: a.x = (a.x & y) >>> 0.
- if (op.isUInt31(compiler)) return simpleBinary(assignOp);
+ if (op.isUInt31(closedWorld)) return simpleBinary(assignOp);
return noMatchingRead();
}
« no previous file with comments | « pkg/compiler/lib/src/ssa/codegen.dart ('k') | pkg/compiler/lib/src/ssa/graph_builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698