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 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 } | 222 } |
223 | 223 |
224 String visitBoolify(HBoolify node) { | 224 String visitBoolify(HBoolify node) { |
225 return "Boolify: ${temporaryId(node.inputs[0])}"; | 225 return "Boolify: ${temporaryId(node.inputs[0])}"; |
226 } | 226 } |
227 | 227 |
228 String visitAdd(HAdd node) => visitInvokeStatic(node); | 228 String visitAdd(HAdd node) => visitInvokeStatic(node); |
229 | 229 |
230 String visitBitAnd(HBitAnd node) => visitInvokeStatic(node); | 230 String visitBitAnd(HBitAnd node) => visitInvokeStatic(node); |
231 | 231 |
232 String visitBitNot(HBitNot node) => visitInvokeStatic(node); | 232 String visitBitNot(HBitNot node) { |
| 233 String operand = temporaryId(node.operand); |
| 234 return "~$operand"; |
| 235 } |
233 | 236 |
234 String visitBitOr(HBitOr node) => visitInvokeStatic(node); | 237 String visitBitOr(HBitOr node) => visitInvokeStatic(node); |
235 | 238 |
236 String visitBitXor(HBitXor node) => visitInvokeStatic(node); | 239 String visitBitXor(HBitXor node) => visitInvokeStatic(node); |
237 | 240 |
238 String visitBoundsCheck(HBoundsCheck node) { | 241 String visitBoundsCheck(HBoundsCheck node) { |
239 String lengthId = temporaryId(node.length); | 242 String lengthId = temporaryId(node.length); |
240 String indexId = temporaryId(node.index); | 243 String indexId = temporaryId(node.index); |
241 return "Bounds check: length = $lengthId, index = $indexId"; | 244 return "Bounds check: length = $lengthId, index = $indexId"; |
242 } | 245 } |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
305 } | 308 } |
306 return "$invokeType: $functionName($argumentsString)"; | 309 return "$invokeType: $functionName($argumentsString)"; |
307 } | 310 } |
308 | 311 |
309 String visitIndex(HIndex node) { | 312 String visitIndex(HIndex node) { |
310 String receiver = temporaryId(node.receiver); | 313 String receiver = temporaryId(node.receiver); |
311 String index = temporaryId(node.index); | 314 String index = temporaryId(node.index); |
312 return "Index: $receiver[$index]"; | 315 return "Index: $receiver[$index]"; |
313 } | 316 } |
314 | 317 |
315 String visitIndexAssign(HIndexAssign node) => visitInvokeStatic(node); | 318 String visitIndexAssign(HIndexAssign node) { |
| 319 String receiver = temporaryId(node.receiver); |
| 320 String index = temporaryId(node.index); |
| 321 String value = temporaryId(node.value); |
| 322 return "IndexAssign: $receiver[$index] = $value"; |
| 323 } |
316 | 324 |
317 String visitIntegerCheck(HIntegerCheck node) { | 325 String visitIntegerCheck(HIntegerCheck node) { |
318 String value = temporaryId(node.value); | 326 String value = temporaryId(node.value); |
319 return "Integer check: $value"; | 327 return "Integer check: $value"; |
320 } | 328 } |
321 | 329 |
322 String visitInterceptor(HInterceptor node) { | 330 String visitInterceptor(HInterceptor node) { |
323 String value = temporaryId(node.inputs[0]); | 331 String value = temporaryId(node.inputs[0]); |
324 return "Intercept: $value"; | 332 return "Intercept: $value"; |
325 } | 333 } |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
386 HBasicBlock bodyBlock = currentBlock.successors[0]; | 394 HBasicBlock bodyBlock = currentBlock.successors[0]; |
387 HBasicBlock exitBlock = currentBlock.successors[1]; | 395 HBasicBlock exitBlock = currentBlock.successors[1]; |
388 String conditionId = temporaryId(branch.inputs[0]); | 396 String conditionId = temporaryId(branch.inputs[0]); |
389 return "While ($conditionId): (B${bodyBlock.id}) then (B${exitBlock.id})"; | 397 return "While ($conditionId): (B${bodyBlock.id}) then (B${exitBlock.id})"; |
390 } | 398 } |
391 | 399 |
392 String visitModulo(HModulo node) => visitInvokeStatic(node); | 400 String visitModulo(HModulo node) => visitInvokeStatic(node); |
393 | 401 |
394 String visitMultiply(HMultiply node) => visitInvokeStatic(node); | 402 String visitMultiply(HMultiply node) => visitInvokeStatic(node); |
395 | 403 |
396 String visitNegate(HNegate node) => visitInvokeStatic(node); | 404 String visitNegate(HNegate node) { |
| 405 String operand = temporaryId(node.operand); |
| 406 return "-$operand"; |
| 407 } |
397 | 408 |
398 String visitNot(HNot node) => "Not: ${temporaryId(node.inputs[0])}"; | 409 String visitNot(HNot node) => "Not: ${temporaryId(node.inputs[0])}"; |
399 | 410 |
400 String visitParameterValue(HParameterValue node) { | 411 String visitParameterValue(HParameterValue node) { |
401 return "p${node.sourceElement.name.slowToString()}"; | 412 return "p${node.sourceElement.name.slowToString()}"; |
402 } | 413 } |
403 | 414 |
404 String visitLocalValue(HLocalValue node) { | 415 String visitLocalValue(HLocalValue node) { |
405 return "l${node.sourceElement.name.slowToString()}"; | 416 return "l${node.sourceElement.name.slowToString()}"; |
406 } | 417 } |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
535 } | 546 } |
536 | 547 |
537 String visitTypeConversion(HTypeConversion node) { | 548 String visitTypeConversion(HTypeConversion node) { |
538 return "TypeConversion: ${temporaryId(node.checkedInput)} to ${node.type}"; | 549 return "TypeConversion: ${temporaryId(node.checkedInput)} to ${node.type}"; |
539 } | 550 } |
540 | 551 |
541 String visitRangeConversion(HRangeConversion node) { | 552 String visitRangeConversion(HRangeConversion node) { |
542 return "RangeConversion: ${node.checkedInput}"; | 553 return "RangeConversion: ${node.checkedInput}"; |
543 } | 554 } |
544 } | 555 } |
OLD | NEW |