| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 dart2js.ir_tracer; | 5 library dart2js.ir_tracer; |
| 6 | 6 |
| 7 import 'dart:async' show EventSink; | 7 import 'dart:async' show EventSink; |
| 8 import 'cps_ir_nodes.dart' as cps_ir; | 8 import 'cps_ir_nodes.dart' as cps_ir; |
| 9 import '../tracer.dart'; | 9 import '../tracer.dart'; |
| 10 | 10 |
| (...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 305 String typeInformation = | 305 String typeInformation = |
| 306 node.typeInformation.map(formatReference).join(', '); | 306 node.typeInformation.map(formatReference).join(', '); |
| 307 return 'CreateInstance $className ($arguments) <$typeInformation>'; | 307 return 'CreateInstance $className ($arguments) <$typeInformation>'; |
| 308 } | 308 } |
| 309 | 309 |
| 310 visitInterceptor(cps_ir.Interceptor node) { | 310 visitInterceptor(cps_ir.Interceptor node) { |
| 311 return 'Interceptor(${formatReference(node.input)}, ' | 311 return 'Interceptor(${formatReference(node.input)}, ' |
| 312 '${node.interceptedClasses})'; | 312 '${node.interceptedClasses})'; |
| 313 } | 313 } |
| 314 | 314 |
| 315 visitCreateFunction(cps_ir.CreateFunction node) { | |
| 316 return "CreateFunction ${node.definition.element.name}"; | |
| 317 } | |
| 318 | |
| 319 visitGetMutable(cps_ir.GetMutable node) { | 315 visitGetMutable(cps_ir.GetMutable node) { |
| 320 String variable = names.name(node.variable.definition); | 316 String variable = names.name(node.variable.definition); |
| 321 return 'GetMutable $variable'; | 317 return 'GetMutable $variable'; |
| 322 } | 318 } |
| 323 | 319 |
| 324 visitReadTypeVariable(cps_ir.ReadTypeVariable node) { | 320 visitReadTypeVariable(cps_ir.ReadTypeVariable node) { |
| 325 return "ReadTypeVariable ${node.variable.element} " | 321 return "ReadTypeVariable ${node.variable.element} " |
| 326 "${formatReference(node.target)}"; | 322 "${formatReference(node.target)}"; |
| 327 } | 323 } |
| 328 | 324 |
| 329 visitReifyRuntimeType(cps_ir.ReifyRuntimeType node) { | 325 visitReifyRuntimeType(cps_ir.ReifyRuntimeType node) { |
| 330 return "ReifyRuntimeType ${formatReference(node.value)}"; | 326 return "ReifyRuntimeType ${formatReference(node.value)}"; |
| 331 } | 327 } |
| 332 | 328 |
| 333 visitTypeExpression(cps_ir.TypeExpression node) { | 329 visitTypeExpression(cps_ir.TypeExpression node) { |
| 334 return "TypeExpression ${node.dartType} " | 330 return "TypeExpression ${node.dartType} " |
| 335 "${node.arguments.map(formatReference).join(', ')}"; | 331 "${node.arguments.map(formatReference).join(', ')}"; |
| 336 } | 332 } |
| 337 | 333 |
| 338 visitCreateInvocationMirror(cps_ir.CreateInvocationMirror node) { | 334 visitCreateInvocationMirror(cps_ir.CreateInvocationMirror node) { |
| 339 String args = node.arguments.map(formatReference).join(', '); | 335 String args = node.arguments.map(formatReference).join(', '); |
| 340 return "CreateInvocationMirror(${node.selector.name}, $args)"; | 336 return "CreateInvocationMirror(${node.selector.name}, $args)"; |
| 341 } | 337 } |
| 342 | 338 |
| 343 visitTypeTest(cps_ir.TypeTest node) { | 339 visitTypeTest(cps_ir.TypeTest node) { |
| 344 String value = formatReference(node.value); | 340 String value = formatReference(node.value); |
| 345 String args = node.typeArguments.map(formatReference).join(', '); | 341 String args = node.typeArguments.map(formatReference).join(', '); |
| 346 String interceptor = node.interceptor == null | 342 return "TypeTest ($value ${node.dartType} ($args))"; |
| 347 ? '' | |
| 348 : ' ${formatReference(node.interceptor)}'; | |
| 349 return "TypeTest ($value ${node.dartType} ($args)$interceptor)"; | |
| 350 } | 343 } |
| 351 | 344 |
| 352 visitTypeTestViaFlag(cps_ir.TypeTestViaFlag node) { | 345 visitTypeTestViaFlag(cps_ir.TypeTestViaFlag node) { |
| 353 String interceptor = formatReference(node.interceptor); | 346 String interceptor = formatReference(node.interceptor); |
| 354 return "TypeTestViaFlag ($interceptor ${node.dartType})"; | 347 return "TypeTestViaFlag ($interceptor ${node.dartType})"; |
| 355 } | 348 } |
| 356 | 349 |
| 357 visitApplyBuiltinOperator(cps_ir.ApplyBuiltinOperator node) { | 350 visitApplyBuiltinOperator(cps_ir.ApplyBuiltinOperator node) { |
| 358 String operator = node.operator.toString(); | 351 String operator = node.operator.toString(); |
| 359 String args = node.arguments.map(formatReference).join(', '); | 352 String args = node.arguments.map(formatReference).join(', '); |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 568 } | 561 } |
| 569 | 562 |
| 570 visitLiteralMap(cps_ir.LiteralMap node) { | 563 visitLiteralMap(cps_ir.LiteralMap node) { |
| 571 unexpectedNode(node); | 564 unexpectedNode(node); |
| 572 } | 565 } |
| 573 | 566 |
| 574 visitConstant(cps_ir.Constant node) { | 567 visitConstant(cps_ir.Constant node) { |
| 575 unexpectedNode(node); | 568 unexpectedNode(node); |
| 576 } | 569 } |
| 577 | 570 |
| 578 visitCreateFunction(cps_ir.CreateFunction node) { | |
| 579 unexpectedNode(node); | |
| 580 } | |
| 581 | |
| 582 visitGetMutable(cps_ir.GetMutable node) { | 571 visitGetMutable(cps_ir.GetMutable node) { |
| 583 unexpectedNode(node); | 572 unexpectedNode(node); |
| 584 } | 573 } |
| 585 | 574 |
| 586 visitParameter(cps_ir.Parameter node) { | 575 visitParameter(cps_ir.Parameter node) { |
| 587 unexpectedNode(node); | 576 unexpectedNode(node); |
| 588 } | 577 } |
| 589 | 578 |
| 590 visitMutableVariable(cps_ir.MutableVariable node) { | 579 visitMutableVariable(cps_ir.MutableVariable node) { |
| 591 unexpectedNode(node); | 580 unexpectedNode(node); |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 676 } | 665 } |
| 677 | 666 |
| 678 visitYield(cps_ir.Yield node) { | 667 visitYield(cps_ir.Yield node) { |
| 679 unexpectedNode(node); | 668 unexpectedNode(node); |
| 680 } | 669 } |
| 681 | 670 |
| 682 visitRefinement(cps_ir.Refinement node) { | 671 visitRefinement(cps_ir.Refinement node) { |
| 683 unexpectedNode(node); | 672 unexpectedNode(node); |
| 684 } | 673 } |
| 685 } | 674 } |
| OLD | NEW |