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

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

Issue 10035032: Give a sourceElement to SSA instructions so that if they end up being 'define' in the codegen (ie n… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 8 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 SsaCodeGeneratorTask(Compiler compiler) : super(compiler); 6 SsaCodeGeneratorTask(Compiler compiler) : super(compiler);
7 String get name() => 'SSA code generator'; 7 String get name() => 'SSA code generator';
8 8
9 9
10 String generateMethod(WorkItem work, HGraph graph) { 10 String generateMethod(WorkItem work, HGraph graph) {
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 265
266 void visitConditionGraph(SubGraph conditionSubGraph) { 266 void visitConditionGraph(SubGraph conditionSubGraph) {
267 visitExpressionGraph(conditionSubGraph); 267 visitExpressionGraph(conditionSubGraph);
268 } 268 }
269 269
270 String temporary(HInstruction instruction) { 270 String temporary(HInstruction instruction) {
271 int id = instruction.id; 271 int id = instruction.id;
272 String name = names[id]; 272 String name = names[id];
273 if (name !== null) return name; 273 if (name !== null) return name;
274 274
275 if (instruction is HPhi) { 275 if (instruction.sourceElement !== null) {
276 HPhi phi = instruction; 276 Element element = instruction.sourceElement;
277 Element element = phi.element;
278 String prefix; 277 String prefix;
279 if (element !== null && !element.name.isEmpty()) { 278 if (element !== null && !element.name.isEmpty()) {
280 prefix = element.name.slowToString(); 279 prefix = element.name.slowToString();
281 } else { 280 } else {
282 prefix = 'v'; 281 prefix = 'v';
283 } 282 }
284 if (!prefixes.containsKey(prefix)) { 283 if (!prefixes.containsKey(prefix)) {
285 prefixes[prefix] = 0; 284 prefixes[prefix] = 0;
286 return newName(id, prefix); 285 return newName(id, prefix);
287 } else { 286 } else {
(...skipping 1625 matching lines...) Expand 10 before | Expand all | Expand 10 after
1913 startBailoutSwitch(); 1912 startBailoutSwitch();
1914 } 1913 }
1915 } 1914 }
1916 1915
1917 void endElse(HIf node) { 1916 void endElse(HIf node) {
1918 if (node.elseBlock.hasGuards()) { 1917 if (node.elseBlock.hasGuards()) {
1919 endBailoutSwitch(); 1918 endBailoutSwitch();
1920 } 1919 }
1921 } 1920 }
1922 } 1921 }
OLDNEW
« no previous file with comments | « lib/compiler/implementation/ssa/builder.dart ('k') | lib/compiler/implementation/ssa/nodes.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698