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

Unified Diff: sdk/lib/_internal/compiler/implementation/ssa/optimize.dart

Issue 24952003: Change TypeMask.base to be a ClassElement. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Moar declaration. Created 7 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
Index: sdk/lib/_internal/compiler/implementation/ssa/optimize.dart
diff --git a/sdk/lib/_internal/compiler/implementation/ssa/optimize.dart b/sdk/lib/_internal/compiler/implementation/ssa/optimize.dart
index 333bd7e725947cb630a0096d80d4a4e9f3bac075..999cf479b4fb8614c8d9103069d5c39ab3ee0d9e 100644
--- a/sdk/lib/_internal/compiler/implementation/ssa/optimize.dart
+++ b/sdk/lib/_internal/compiler/implementation/ssa/optimize.dart
@@ -201,11 +201,10 @@ class SsaInstructionSimplifier extends HBaseVisitor
HType type = input.instructionType;
if (type.isBoolean()) return input;
// All values that cannot be 'true' are boolified to false.
- DartType booleanType = backend.jsBoolClass.computeType(compiler);
TypeMask mask = type.computeMask(compiler);
// TODO(kasperl): Get rid of the null check here once all HTypes
// have a proper mask.
- if (mask != null && !mask.contains(booleanType, compiler)) {
+ if (mask != null && !mask.contains(backend.jsBoolClass, compiler)) {
return graph.addConstantBool(false, compiler);
}
return node;
@@ -637,7 +636,8 @@ class SsaInstructionSimplifier extends HBaseVisitor
} else if (!RuntimeTypes.hasTypeArguments(type)) {
TypeMask expressionMask = expressionType.computeMask(compiler);
TypeMask typeMask = (element == compiler.nullClass)
- ? new TypeMask.subtype(type) : new TypeMask.nonNullSubtype(type);
+ ? new TypeMask.subtype(element)
+ : new TypeMask.nonNullSubtype(element);
if (expressionMask.union(typeMask, compiler) == typeMask) {
return graph.addConstantBool(true, compiler);
} else if (expressionMask.intersection(typeMask, compiler).isEmpty) {
@@ -1503,7 +1503,6 @@ class SsaTypeConversionInserter extends HBaseVisitor
visitDominatorTree(graph);
}
-
// Update users of [input] that are dominated by [:dominator.first:]
// to use [newInput] instead.
void changeUsesDominatedBy(HBasicBlock dominator,
@@ -1543,7 +1542,7 @@ class SsaTypeConversionInserter extends HBaseVisitor
if (ifUsers.isEmpty && notIfUsers.isEmpty) return;
- HType convertedType = new HType.nonNullSubtype(type, compiler);
+ HType convertedType = new HType.nonNullSubtype(element, compiler);
HInstruction input = instruction.expression;
for (HIf ifUser in ifUsers) {
changeUsesDominatedBy(ifUser.thenBlock, input, convertedType);
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/ssa/nodes.dart ('k') | sdk/lib/_internal/compiler/implementation/ssa/types.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698