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

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

Issue 10562002: Extend the {+,-,/,*}= support by allowing non-constants on the right side. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 6 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 | « lib/compiler/implementation/ssa/codegen.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/compiler/implementation/ssa/nodes.dart
diff --git a/lib/compiler/implementation/ssa/nodes.dart b/lib/compiler/implementation/ssa/nodes.dart
index 3c205251de1b983a6d07d4a73b82db366c4d02d6..0d6bb70f794abbcb31a2ea8f7c1da901b83f25c2 100644
--- a/lib/compiler/implementation/ssa/nodes.dart
+++ b/lib/compiler/implementation/ssa/nodes.dart
@@ -757,6 +757,7 @@ class HInstruction implements Hashable {
bool isString() => propagatedType.isString();
bool isTypeUnknown() => propagatedType.isUnknown();
bool isIndexablePrimitive() => propagatedType.isIndexablePrimitive();
+ bool isPrimitive() => propagatedType.isPrimitive();
bool canBePrimitive() => propagatedType.canBePrimitive();
/**
@@ -1543,7 +1544,9 @@ class HBinaryBitOp extends HBinaryArithmetic {
bool get builtin() => left.isInteger() && right.isInteger();
HType computeTypeFromInputTypes() {
- if (left.isInteger()) return HType.INTEGER;
+ // All bitwise operations on primitive types either produce an
+ // integer or throw an error.
+ if (left.isPrimitive()) return HType.INTEGER;
return HType.UNKNOWN;
}
@@ -1678,8 +1681,9 @@ class HBitNot extends HInvokeUnary {
bool get builtin() => operand.isInteger();
HType computeTypeFromInputTypes() {
- HType operandType = operand.propagatedType;
- if (operandType.isInteger()) return HType.INTEGER;
+ // All bitwise operations on primitive types either produce an
+ // integer or throw an error.
+ if (operand.isPrimitive()) return HType.INTEGER;
return HType.UNKNOWN;
}
« no previous file with comments | « lib/compiler/implementation/ssa/codegen.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698