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

Side by Side Diff: frog/leg/ssa/tracer.dart

Issue 9592009: Reapply "Refactor constant part." (r4958) with fixes. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Update tests and fix code after renaming. Created 8 years, 9 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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 #library('tracer'); 5 #library('tracer');
6 6
7 #import('dart:io'); 7 #import('dart:io');
8 #import('ssa.dart'); 8 #import('ssa.dart');
9 #import('../leg.dart'); 9 #import('../leg.dart');
10 10
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 } 210 }
211 211
212 String visitBreak(HBreak node) { 212 String visitBreak(HBreak node) {
213 HBasicBlock target = currentBlock.successors[0]; 213 HBasicBlock target = currentBlock.successors[0];
214 if (node.label !== null) { 214 if (node.label !== null) {
215 return "Break ${node.label.slowToString()}: (B${target.id})"; 215 return "Break ${node.label.slowToString()}: (B${target.id})";
216 } 216 }
217 return "Break: (B${target.id})"; 217 return "Break: (B${target.id})";
218 } 218 }
219 219
220 String visitConstant(HConstant constant) => "Constant ${constant.constant}";
221
220 String visitDivide(HDivide node) => visitInvokeStatic(node); 222 String visitDivide(HDivide node) => visitInvokeStatic(node);
221 223
222 String visitEquals(HEquals node) => visitInvokeStatic(node); 224 String visitEquals(HEquals node) => visitInvokeStatic(node);
223 225
224 String visitExit(HExit node) => "exit"; 226 String visitExit(HExit node) => "exit";
225 227
226 String visitFieldGet(HFieldGet node) { 228 String visitFieldGet(HFieldGet node) {
227 return 'get ${node.element.name.slowToString()}'; 229 return 'get ${node.element.name.slowToString()}';
228 } 230 }
229 231
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
320 322
321 String visitForeignNew(HForeignNew node) { 323 String visitForeignNew(HForeignNew node) {
322 return visitGenericInvoke("New", 324 return visitGenericInvoke("New",
323 "${node.element.name.slowToString()}", 325 "${node.element.name.slowToString()}",
324 node.inputs); 326 node.inputs);
325 } 327 }
326 328
327 String visitLess(HLess node) => visitInvokeStatic(node); 329 String visitLess(HLess node) => visitInvokeStatic(node);
328 String visitLessEqual(HLessEqual node) => visitInvokeStatic(node); 330 String visitLessEqual(HLessEqual node) => visitInvokeStatic(node);
329 331
330 String visitLiteral(HLiteral literal) => "Literal ${literal.value}";
331
332 String visitLiteralList(HLiteralList node) { 332 String visitLiteralList(HLiteralList node) {
333 StringBuffer elementsString = new StringBuffer(); 333 StringBuffer elementsString = new StringBuffer();
334 for (int i = 0; i < node.inputs.length; i++) { 334 for (int i = 0; i < node.inputs.length; i++) {
335 if (i != 0) elementsString.add(", "); 335 if (i != 0) elementsString.add(", ");
336 elementsString.add(temporaryId(node.inputs[i])); 336 elementsString.add(temporaryId(node.inputs[i]));
337 } 337 }
338 return "Literal list: [$elementsString]"; 338 return "Literal list: [$elementsString]";
339 } 339 }
340 340
341 String visitLoad(HLoad node) => "Load: ${temporaryId(node.inputs[0])}"; 341 String visitLoad(HLoad node) => "Load: ${temporaryId(node.inputs[0])}";
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
443 default: unreachable(); 443 default: unreachable();
444 } 444 }
445 return "TypeGuard: ${temporaryId(node.inputs[0])} is $type"; 445 return "TypeGuard: ${temporaryId(node.inputs[0])} is $type";
446 } 446 }
447 447
448 String visitIs(HIs node) { 448 String visitIs(HIs node) {
449 String type = node.typeExpression.toString(); 449 String type = node.typeExpression.toString();
450 return "TypeTest: ${temporaryId(node.expression)} is $type"; 450 return "TypeTest: ${temporaryId(node.expression)} is $type";
451 } 451 }
452 } 452 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698