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

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

Issue 10139012: Refactor types in ssa nodes. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments and remove isIntegerOrDouble. Created 8 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
Index: lib/compiler/implementation/ssa/optimize.dart
diff --git a/lib/compiler/implementation/ssa/optimize.dart b/lib/compiler/implementation/ssa/optimize.dart
index a1562b535c79efae6f852115688d6281c8b531fc..9057f92d3d9555225197822f44a1e0d380972ee1 100644
--- a/lib/compiler/implementation/ssa/optimize.dart
+++ b/lib/compiler/implementation/ssa/optimize.dart
@@ -289,7 +289,7 @@ class SsaConstantFolder extends HBaseVisitor implements OptimizationPhase {
HInstruction visitTypeGuard(HTypeGuard node) {
HInstruction value = node.guarded;
- HType combinedType = value.propagatedType.combine(node.guardedType);
+ HType combinedType = value.propagatedType.intersect(node.guardedType);
ngeoffray 2012/04/23 10:19:21 Please add a simple comment or example on why this
floitsch 2012/04/24 15:25:18 Good thing you made me do this. Should have been u
return (combinedType == value.propagatedType) ? value : node;
}
@@ -403,7 +403,7 @@ class SsaCheckInserter extends HBaseVisitor implements OptimizationPhase {
}
void visitIndex(HIndex node) {
- if (!node.receiver.isStringOrArray()) return;
+ if (!node.receiver.isIndexablePrimitive()) return;
HInstruction index = node.index;
if (index is HBoundsCheck) return;
if (!node.index.isInteger()) {

Powered by Google App Engine
This is Rietveld 408576698