OLD | NEW |
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 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 '../js_backend/js_backend.dart'; | 9 import '../js_backend/js_backend.dart'; |
10 import '../dart2jslib.dart'; | 10 import '../dart2jslib.dart'; |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
267 } | 267 } |
268 return "Continue: (B${target.id})"; | 268 return "Continue: (B${target.id})"; |
269 } | 269 } |
270 | 270 |
271 String visitDivide(HDivide node) => handleInvokeBinary(node, '/'); | 271 String visitDivide(HDivide node) => handleInvokeBinary(node, '/'); |
272 | 272 |
273 String visitExit(HExit node) => "exit"; | 273 String visitExit(HExit node) => "exit"; |
274 | 274 |
275 String visitFieldGet(HFieldGet node) { | 275 String visitFieldGet(HFieldGet node) { |
276 String fieldName = node.element.name.slowToString(); | 276 String fieldName = node.element.name.slowToString(); |
277 return 'get ${temporaryId(node.receiver)}.$fieldName'; | 277 return 'field get ${temporaryId(node.receiver)}.$fieldName'; |
278 } | 278 } |
279 | 279 |
280 String visitFieldSet(HFieldSet node) { | 280 String visitFieldSet(HFieldSet node) { |
281 String valueId = temporaryId(node.value); | 281 String valueId = temporaryId(node.value); |
282 String fieldName = node.element.name.slowToString(); | 282 String fieldName = node.element.name.slowToString(); |
283 return 'set ${temporaryId(node.receiver)}.$fieldName to $valueId'; | 283 return 'field set ${temporaryId(node.receiver)}.$fieldName to $valueId'; |
284 } | 284 } |
285 | 285 |
286 String visitLocalGet(HLocalGet node) => visitFieldGet(node); | 286 String visitLocalGet(HLocalGet node) { |
287 String visitLocalSet(HLocalSet node) => visitFieldSet(node); | 287 String localName = node.element.name.slowToString(); |
| 288 return 'local get ${temporaryId(node.local)}.$localName'; |
| 289 } |
| 290 |
| 291 String visitLocalSet(HLocalSet node) { |
| 292 String valueId = temporaryId(node.value); |
| 293 String localName = node.element.name.slowToString(); |
| 294 return 'local set ${temporaryId(node.local)}.$localName to $valueId'; |
| 295 } |
288 | 296 |
289 String visitGoto(HGoto node) { | 297 String visitGoto(HGoto node) { |
290 HBasicBlock target = currentBlock.successors[0]; | 298 HBasicBlock target = currentBlock.successors[0]; |
291 return "Goto: (B${target.id})"; | 299 return "Goto: (B${target.id})"; |
292 } | 300 } |
293 | 301 |
294 String visitGreater(HGreater node) => handleInvokeBinary(node, '>'); | 302 String visitGreater(HGreater node) => handleInvokeBinary(node, '>'); |
295 String visitGreaterEqual(HGreaterEqual node) { | 303 String visitGreaterEqual(HGreaterEqual node) { |
296 handleInvokeBinary(node, '>='); | 304 handleInvokeBinary(node, '>='); |
297 } | 305 } |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
543 } | 551 } |
544 | 552 |
545 String visitTypeConversion(HTypeConversion node) { | 553 String visitTypeConversion(HTypeConversion node) { |
546 return "TypeConversion: ${temporaryId(node.checkedInput)} to ${node.type}"; | 554 return "TypeConversion: ${temporaryId(node.checkedInput)} to ${node.type}"; |
547 } | 555 } |
548 | 556 |
549 String visitRangeConversion(HRangeConversion node) { | 557 String visitRangeConversion(HRangeConversion node) { |
550 return "RangeConversion: ${node.checkedInput}"; | 558 return "RangeConversion: ${node.checkedInput}"; |
551 } | 559 } |
552 } | 560 } |
OLD | NEW |