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

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

Issue 10834330: Clean-up of getCompilationUnit. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 4 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/js_backend/emitter.dart ('k') | lib/compiler/implementation/typechecker.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/compiler/implementation/ssa/codegen.dart
diff --git a/lib/compiler/implementation/ssa/codegen.dart b/lib/compiler/implementation/ssa/codegen.dart
index 3b5cabcdcec72d21961e343d6e5d3846d39678c8..163e38087503c1710fd2bd09f39fa5b59e05deac 100644
--- a/lib/compiler/implementation/ssa/codegen.dart
+++ b/lib/compiler/implementation/ssa/codegen.dart
@@ -184,8 +184,9 @@ class SsaCodeGenerator implements HVisitor, HBlockInformationVisitor {
bool isNonNegativeInt32Constant(HInstruction instruction) {
if (instruction.isConstantInteger()) {
- int value =
- ((instruction as HConstant).constant as PrimitiveConstant).value;
+ HConstant constantInstruction = instruction;
+ PrimitiveConstant primitiveConstant = constantInstruction.constant;
+ int value = primitiveConstant.value;
if (value >= 0 && value < (1 << 31)) {
return true;
}
@@ -213,10 +214,12 @@ class SsaCodeGenerator implements HVisitor, HBlockInformationVisitor {
// integer. Also, if we are using & with a positive constant we know
// that the result is positive already and need no conversion.
bool requiresUintConversion(HInstruction instruction) {
- if (instruction is HBitAnd &&
- (isNonNegativeInt32Constant((instruction as HBitAnd).left) ||
- isNonNegativeInt32Constant((instruction as HBitAnd).right))) {
- return false;
+ if (instruction is HBitAnd) {
+ HBitAnd bitAnd = instruction;
+ if (isNonNegativeInt32Constant(bitAnd.left) ||
+ isNonNegativeInt32Constant(bitAnd.right)) {
+ return false;
+ }
}
return hasNonBitOpUser(instruction, new Set<HPhi>());
}
« no previous file with comments | « lib/compiler/implementation/js_backend/emitter.dart ('k') | lib/compiler/implementation/typechecker.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698