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_nodes_sexpr; | 5 library dart2js.ir_nodes_sexpr; |
6 | 6 |
7 import '../constants/values.dart'; | 7 import '../constants/values.dart'; |
8 import '../util/util.dart'; | 8 import '../util/util.dart'; |
9 import 'cps_ir_nodes.dart'; | 9 import 'cps_ir_nodes.dart'; |
10 import '../universe/call_structure.dart' show | 10 import '../universe/call_structure.dart' show |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 String value = access(node.value); | 236 String value = access(node.value); |
237 String cont = access(node.continuation); | 237 String cont = access(node.continuation); |
238 String typeArguments = node.typeArguments.map(access).join(' '); | 238 String typeArguments = node.typeArguments.map(access).join(' '); |
239 return '$indentation(TypeCast $value ${node.dartType}' | 239 return '$indentation(TypeCast $value ${node.dartType}' |
240 ' ($typeArguments) $cont)'; | 240 ' ($typeArguments) $cont)'; |
241 } | 241 } |
242 | 242 |
243 String visitTypeTest(TypeTest node) { | 243 String visitTypeTest(TypeTest node) { |
244 String value = access(node.value); | 244 String value = access(node.value); |
245 String typeArguments = node.typeArguments.map(access).join(' '); | 245 String typeArguments = node.typeArguments.map(access).join(' '); |
246 return '(TypeTest $value ${node.dartType} ($typeArguments))'; | 246 String interceptor = node.interceptor == null |
| 247 ? '' |
| 248 : access(node.interceptor); |
| 249 return '(TypeTest $value ${node.dartType} ($typeArguments) ($interceptor))'; |
| 250 } |
| 251 |
| 252 String visitTypeTestViaFlag(TypeTestViaFlag node) { |
| 253 String interceptor = access(node.interceptor); |
| 254 return '(TypeTestViaFlag $interceptor ${node.dartType})'; |
247 } | 255 } |
248 | 256 |
249 String visitLiteralList(LiteralList node) { | 257 String visitLiteralList(LiteralList node) { |
250 String values = node.values.map(access).join(' '); | 258 String values = node.values.map(access).join(' '); |
251 return '(LiteralList ($values))'; | 259 return '(LiteralList ($values))'; |
252 } | 260 } |
253 | 261 |
254 String visitLiteralMap(LiteralMap node) { | 262 String visitLiteralMap(LiteralMap node) { |
255 String keys = node.entries.map((e) => access(e.key)).join(' '); | 263 String keys = node.entries.map((e) => access(e.key)).join(' '); |
256 String values = node.entries.map((e) => access(e.value)).join(' '); | 264 String values = node.entries.map((e) => access(e.value)).join(' '); |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
485 void setReturnContinuation(Continuation node) { | 493 void setReturnContinuation(Continuation node) { |
486 assert(!_names.containsKey(node) || _names[node] == 'return'); | 494 assert(!_names.containsKey(node) || _names[node] == 'return'); |
487 _names[node] = 'return'; | 495 _names[node] = 'return'; |
488 } | 496 } |
489 | 497 |
490 String getName(Node node) { | 498 String getName(Node node) { |
491 if (!_names.containsKey(node)) return 'MISSING_NAME'; | 499 if (!_names.containsKey(node)) return 'MISSING_NAME'; |
492 return _names[node]; | 500 return _names[node]; |
493 } | 501 } |
494 } | 502 } |
OLD | NEW |