| 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/universe.dart' show Selector, CallStructure; | 10 import '../universe/universe.dart' show Selector, CallStructure; |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 String visitThrow(Throw node) { | 185 String visitThrow(Throw node) { |
| 186 String value = access(node.value); | 186 String value = access(node.value); |
| 187 return '$indentation(Throw $value)'; | 187 return '$indentation(Throw $value)'; |
| 188 } | 188 } |
| 189 | 189 |
| 190 String visitRethrow(Rethrow node) { | 190 String visitRethrow(Rethrow node) { |
| 191 return '$indentation(Rethrow)'; | 191 return '$indentation(Rethrow)'; |
| 192 } | 192 } |
| 193 | 193 |
| 194 String visitBranch(Branch node) { | 194 String visitBranch(Branch node) { |
| 195 String condition = visit(node.condition); | 195 String condition = access(node.condition); |
| 196 String trueCont = access(node.trueContinuation); | 196 String trueCont = access(node.trueContinuation); |
| 197 String falseCont = access(node.falseContinuation); | 197 String falseCont = access(node.falseContinuation); |
| 198 return '$indentation(Branch $condition $trueCont $falseCont)'; | 198 String strict = node.isStrictCheck ? 'Strict' : 'NonStrict'; |
| 199 return '$indentation(Branch $condition $trueCont $falseCont $strict)'; |
| 199 } | 200 } |
| 200 | 201 |
| 201 String visitUnreachable(Unreachable node) { | 202 String visitUnreachable(Unreachable node) { |
| 202 return '$indentation(Unreachable)'; | 203 return '$indentation(Unreachable)'; |
| 203 } | 204 } |
| 204 | 205 |
| 205 String visitConstant(Constant node) { | 206 String visitConstant(Constant node) { |
| 206 String value = node.value.accept(new ConstantStringifier(), null); | 207 String value = node.value.accept(new ConstantStringifier(), null); |
| 207 return '(Constant $value)'; | 208 return '(Constant $value)'; |
| 208 } | 209 } |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 String values = node.values.map(access).join(' '); | 245 String values = node.values.map(access).join(' '); |
| 245 return '(LiteralList ($values))'; | 246 return '(LiteralList ($values))'; |
| 246 } | 247 } |
| 247 | 248 |
| 248 String visitLiteralMap(LiteralMap node) { | 249 String visitLiteralMap(LiteralMap node) { |
| 249 String keys = node.entries.map((e) => access(e.key)).join(' '); | 250 String keys = node.entries.map((e) => access(e.key)).join(' '); |
| 250 String values = node.entries.map((e) => access(e.value)).join(' '); | 251 String values = node.entries.map((e) => access(e.value)).join(' '); |
| 251 return '(LiteralMap ($keys) ($values))'; | 252 return '(LiteralMap ($keys) ($values))'; |
| 252 } | 253 } |
| 253 | 254 |
| 254 String visitIsTrue(IsTrue node) { | |
| 255 String value = access(node.value); | |
| 256 return '(IsTrue $value)'; | |
| 257 } | |
| 258 | |
| 259 String visitSetField(SetField node) { | 255 String visitSetField(SetField node) { |
| 260 String object = access(node.object); | 256 String object = access(node.object); |
| 261 String field = node.field.name; | 257 String field = node.field.name; |
| 262 String value = access(node.value); | 258 String value = access(node.value); |
| 263 return '(SetField $object $field $value)'; | 259 return '(SetField $object $field $value)'; |
| 264 } | 260 } |
| 265 | 261 |
| 266 String visitGetField(GetField node) { | 262 String visitGetField(GetField node) { |
| 267 String object = access(node.object); | 263 String object = access(node.object); |
| 268 String field = node.field.name; | 264 String field = node.field.name; |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 472 void setReturnContinuation(Continuation node) { | 468 void setReturnContinuation(Continuation node) { |
| 473 assert(!_names.containsKey(node) || _names[node] == 'return'); | 469 assert(!_names.containsKey(node) || _names[node] == 'return'); |
| 474 _names[node] = 'return'; | 470 _names[node] = 'return'; |
| 475 } | 471 } |
| 476 | 472 |
| 477 String getName(Node node) { | 473 String getName(Node node) { |
| 478 if (!_names.containsKey(node)) return 'MISSING_NAME'; | 474 if (!_names.containsKey(node)) return 'MISSING_NAME'; |
| 479 return _names[node]; | 475 return _names[node]; |
| 480 } | 476 } |
| 481 } | 477 } |
| OLD | NEW |