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

Side by Side Diff: lib/compiler/implementation/ssa/codegen.dart

Issue 10958069: Variable use should not be mapped to its declaration. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 2 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 class SsaCodeGeneratorTask extends CompilerTask { 5 class SsaCodeGeneratorTask extends CompilerTask {
6 6
7 final JavaScriptBackend backend; 7 final JavaScriptBackend backend;
8 8
9 SsaCodeGeneratorTask(JavaScriptBackend backend) 9 SsaCodeGeneratorTask(JavaScriptBackend backend)
10 : this.backend = backend, 10 : this.backend = backend,
(...skipping 647 matching lines...) Expand 10 before | Expand all | Expand 10 after
658 void use(HInstruction argument) { 658 void use(HInstruction argument) {
659 if (isGenerateAtUseSite(argument)) { 659 if (isGenerateAtUseSite(argument)) {
660 visitExpression(argument); 660 visitExpression(argument);
661 } else if (argument is HCheck && argument.isControlFlow()) { 661 } else if (argument is HCheck && argument.isControlFlow()) {
662 // A [HCheck] that has control flow can never be used as an 662 // A [HCheck] that has control flow can never be used as an
663 // expression and may not have a name. Therefore we just use the 663 // expression and may not have a name. Therefore we just use the
664 // checked instruction. 664 // checked instruction.
665 HCheck check = argument; 665 HCheck check = argument;
666 use(check.checkedInput); 666 use(check.checkedInput);
667 } else { 667 } else {
668 push(new js.VariableUse(variableNames.getName(argument)), argument); 668 push(new js.VariableUse(variableNames.getName(argument)));
669 } 669 }
670 } 670 }
671 671
672 visit(HInstruction node) { 672 visit(HInstruction node) {
673 node.accept(this); 673 node.accept(this);
674 } 674 }
675 675
676 visitExpression(HInstruction node) { 676 visitExpression(HInstruction node) {
677 bool oldIsGeneratingExpression = isGeneratingExpression; 677 bool oldIsGeneratingExpression = isGeneratingExpression;
678 isGeneratingExpression = true; 678 isGeneratingExpression = true;
(...skipping 2315 matching lines...) Expand 10 before | Expand all | Expand 10 after
2994 if (leftType.canBeNull() && rightType.canBeNull()) { 2994 if (leftType.canBeNull() && rightType.canBeNull()) {
2995 if (left.isConstantNull() || right.isConstantNull() || 2995 if (left.isConstantNull() || right.isConstantNull() ||
2996 (leftType.isPrimitive() && leftType == rightType)) { 2996 (leftType.isPrimitive() && leftType == rightType)) {
2997 return '=='; 2997 return '==';
2998 } 2998 }
2999 return null; 2999 return null;
3000 } else { 3000 } else {
3001 return '==='; 3001 return '===';
3002 } 3002 }
3003 } 3003 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698