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

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

Issue 10543050: Compute the swap temporary to not clash with parameter names. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/
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 unified diff | Download patch | Annotate | Revision Log
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 final JavaScriptBackend backend; 6 final JavaScriptBackend backend;
7 SsaCodeGeneratorTask(JavaScriptBackend backend) 7 SsaCodeGeneratorTask(JavaScriptBackend backend)
8 : this.backend = backend, 8 : this.backend = backend,
9 super(backend.compiler); 9 super(backend.compiler);
10 String get name() => 'SSA code generator'; 10 String get name() => 'SSA code generator';
(...skipping 1057 matching lines...) Expand 10 before | Expand all | Expand 10 after
1068 } 1068 }
1069 } 1069 }
1070 1070
1071 // Check if we have a cycle. 1071 // Check if we have a cycle.
1072 String current = worklist.removeLast(); 1072 String current = worklist.removeLast();
1073 // If [current] is used as a source, and the assignment has been 1073 // If [current] is used as a source, and the assignment has been
1074 // done, we are done with this variable. Otherwise there is a 1074 // done, we are done with this variable. Otherwise there is a
1075 // cycle that we break by using a temporary name. 1075 // cycle that we break by using a temporary name.
1076 if (currentLocation[current] !== null 1076 if (currentLocation[current] !== null
1077 && current != currentLocation[initialValue[current]]) { 1077 && current != currentLocation[initialValue[current]]) {
1078 String tempName = VariableNames.SWAP_TEMP; 1078 String tempName = variableNames.swapTemp;
1079 emitAssignment(tempName, current); 1079 emitAssignment(tempName, current);
1080 currentLocation[current] = tempName; 1080 currentLocation[current] = tempName;
1081 // [current] can now be safely updated. Copies of [current] 1081 // [current] can now be safely updated. Copies of [current]
1082 // will now use [tempName]. 1082 // will now use [tempName].
1083 ready.add(current); 1083 ready.add(current);
1084 } 1084 }
1085 } 1085 }
1086 } 1086 }
1087 1087
1088 void assignPhisOfSuccessors(HBasicBlock node) { 1088 void assignPhisOfSuccessors(HBasicBlock node) {
(...skipping 1584 matching lines...) Expand 10 before | Expand all | Expand 10 after
2673 startBailoutSwitch(); 2673 startBailoutSwitch();
2674 } 2674 }
2675 } 2675 }
2676 2676
2677 void endLabeledBlock(HLabeledBlockInformation labeledBlockInfo) { 2677 void endLabeledBlock(HLabeledBlockInformation labeledBlockInfo) {
2678 if (labeledBlockInfo.body.start.hasGuards()) { 2678 if (labeledBlockInfo.body.start.hasGuards()) {
2679 endBailoutSwitch(); 2679 endBailoutSwitch();
2680 } 2680 }
2681 } 2681 }
2682 } 2682 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698