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 String interceptor = node.interceptor == null | 246 return '(TypeTest $value ${node.dartType} ($typeArguments))'; |
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})'; | |
255 } | 247 } |
256 | 248 |
257 String visitLiteralList(LiteralList node) { | 249 String visitLiteralList(LiteralList node) { |
258 String values = node.values.map(access).join(' '); | 250 String values = node.values.map(access).join(' '); |
259 return '(LiteralList ($values))'; | 251 return '(LiteralList ($values))'; |
260 } | 252 } |
261 | 253 |
262 String visitLiteralMap(LiteralMap node) { | 254 String visitLiteralMap(LiteralMap node) { |
263 String keys = node.entries.map((e) => access(e.key)).join(' '); | 255 String keys = node.entries.map((e) => access(e.key)).join(' '); |
264 String values = node.entries.map((e) => access(e.value)).join(' '); | 256 String values = node.entries.map((e) => access(e.value)).join(' '); |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
493 void setReturnContinuation(Continuation node) { | 485 void setReturnContinuation(Continuation node) { |
494 assert(!_names.containsKey(node) || _names[node] == 'return'); | 486 assert(!_names.containsKey(node) || _names[node] == 'return'); |
495 _names[node] = 'return'; | 487 _names[node] = 'return'; |
496 } | 488 } |
497 | 489 |
498 String getName(Node node) { | 490 String getName(Node node) { |
499 if (!_names.containsKey(node)) return 'MISSING_NAME'; | 491 if (!_names.containsKey(node)) return 'MISSING_NAME'; |
500 return _names[node]; | 492 return _names[node]; |
501 } | 493 } |
502 } | 494 } |
OLD | NEW |