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

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

Issue 10557003: Fix most warnings and other minor cleanups. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: rebase. 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/builder.dart ('k') | lib/compiler/implementation/ssa/tracer.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 779ff35e47f1be5794f37fb16b754a5035c5127c..1108f0f78ee2e506a1539adc5b801b0ebdb55f5d 100644
--- a/lib/compiler/implementation/ssa/codegen.dart
+++ b/lib/compiler/implementation/ssa/codegen.dart
@@ -502,9 +502,11 @@ class SsaCodeGenerator implements HVisitor, HBlockInformationVisitor {
}
// Is it a builtin operation involving +, -, /, or *?
- if (instruction.builtin && instruction.inputs.length == 3) {
- var left = instruction.inputs[1];
- var right = instruction.inputs[2];
+ HBinaryArithmetic binaryInstruction = instruction;
+ assert(binaryInstruction.inputs.length == 3);
+ if (binaryInstruction.builtin) {
+ var left = binaryInstruction.left;
+ var right = binaryInstruction.right;
if (isCommutative && variableNames.getName(right) == name) {
var tmp = right;
right = left;
@@ -518,20 +520,21 @@ class SsaCodeGenerator implements HVisitor, HBlockInformationVisitor {
bool rightIsOne = false;
if (right.isConstantNumber()) {
HConstant rightConstant = right;
- rightIsOne = (rightConstant.constant.value == 1);
+ NumConstant numConstant = rightConstant.constant;
+ rightIsOne = (numConstant.value == 1);
}
- if (instruction is HAdd && rightIsOne) {
+ if (binaryInstruction is HAdd && rightIsOne) {
beginExpression(JSPrecedence.PREFIX_PRECEDENCE);
buffer.add('++');
declareVariable(name);
endExpression(JSPrecedence.PREFIX_PRECEDENCE);
- } else if (instruction is HSubtract && rightIsOne) {
+ } else if (binaryInstruction is HSubtract && rightIsOne) {
beginExpression(JSPrecedence.PREFIX_PRECEDENCE);
buffer.add('--');
declareVariable(name);
endExpression(JSPrecedence.PREFIX_PRECEDENCE);
} else {
- var operation = instruction.operation.name;
+ var operation = binaryInstruction.operation.name;
beginExpression(JSPrecedence.ASSIGNMENT_PRECEDENCE);
declareVariable(name);
buffer.add(' ${operation}= ');
@@ -2491,8 +2494,8 @@ class SsaOptimizedCodeGenerator extends SsaCodeGenerator {
void bailout(HTypeGuard guard, String reason) {
if (maxBailoutParameters === null) {
maxBailoutParameters = 0;
- work.guards.forEach((HTypeGuard guard) {
- int inputLength = guard.inputs.length;
+ work.guards.forEach((HTypeGuard workGuard) {
+ int inputLength = workGuard.inputs.length;
if (inputLength > maxBailoutParameters) {
maxBailoutParameters = inputLength;
}
« no previous file with comments | « lib/compiler/implementation/ssa/builder.dart ('k') | lib/compiler/implementation/ssa/tracer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698