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 import '../common/codegen.dart' show CodegenRegistry, CodegenWorkItem; | 5 import '../common/codegen.dart' show CodegenRegistry, CodegenWorkItem; |
6 import '../common/names.dart' show Selectors; | 6 import '../common/names.dart' show Selectors; |
7 import '../common/tasks.dart' show CompilerTask; | 7 import '../common/tasks.dart' show CompilerTask; |
8 import '../compiler.dart' show Compiler; | 8 import '../compiler.dart' show Compiler; |
9 import '../constants/constant_system.dart'; | 9 import '../constants/constant_system.dart'; |
10 import '../constants/values.dart'; | 10 import '../constants/values.dart'; |
(...skipping 1052 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1063 ..sourceInformation = node.sourceInformation; | 1063 ..sourceInformation = node.sourceInformation; |
1064 } | 1064 } |
1065 } else if (element == commonElements.checkConcurrentModificationError) { | 1065 } else if (element == commonElements.checkConcurrentModificationError) { |
1066 if (node.inputs.length == 2) { | 1066 if (node.inputs.length == 2) { |
1067 HInstruction firstArgument = node.inputs[0]; | 1067 HInstruction firstArgument = node.inputs[0]; |
1068 if (firstArgument is HConstant) { | 1068 if (firstArgument is HConstant) { |
1069 HConstant constant = firstArgument; | 1069 HConstant constant = firstArgument; |
1070 if (constant.constant.isTrue) return constant; | 1070 if (constant.constant.isTrue) return constant; |
1071 } | 1071 } |
1072 } | 1072 } |
1073 } else if (element == commonElements.checkInt) { | 1073 } else if (commonElements.isCheckInt(element)) { |
1074 if (node.inputs.length == 1) { | 1074 if (node.inputs.length == 1) { |
1075 HInstruction argument = node.inputs[0]; | 1075 HInstruction argument = node.inputs[0]; |
1076 if (argument.isInteger(_closedWorld)) return argument; | 1076 if (argument.isInteger(_closedWorld)) return argument; |
1077 } | 1077 } |
1078 } else if (element == commonElements.checkNum) { | 1078 } else if (commonElements.isCheckNum(element)) { |
1079 if (node.inputs.length == 1) { | 1079 if (node.inputs.length == 1) { |
1080 HInstruction argument = node.inputs[0]; | 1080 HInstruction argument = node.inputs[0]; |
1081 if (argument.isNumber(_closedWorld)) return argument; | 1081 if (argument.isNumber(_closedWorld)) return argument; |
1082 } | 1082 } |
1083 } else if (element == commonElements.checkString) { | 1083 } else if (commonElements.isCheckString(element)) { |
1084 if (node.inputs.length == 1) { | 1084 if (node.inputs.length == 1) { |
1085 HInstruction argument = node.inputs[0]; | 1085 HInstruction argument = node.inputs[0]; |
1086 if (argument.isString(_closedWorld)) return argument; | 1086 if (argument.isString(_closedWorld)) return argument; |
1087 } | 1087 } |
1088 } | 1088 } |
1089 return node; | 1089 return node; |
1090 } | 1090 } |
1091 | 1091 |
1092 HInstruction visitStringConcat(HStringConcat node) { | 1092 HInstruction visitStringConcat(HStringConcat node) { |
1093 // Simplify string concat: | 1093 // Simplify string concat: |
(...skipping 1894 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2988 | 2988 |
2989 keyedValues.forEach((receiver, values) { | 2989 keyedValues.forEach((receiver, values) { |
2990 result.keyedValues[receiver] = | 2990 result.keyedValues[receiver] = |
2991 new Map<HInstruction, HInstruction>.from(values); | 2991 new Map<HInstruction, HInstruction>.from(values); |
2992 }); | 2992 }); |
2993 | 2993 |
2994 result.nonEscapingReceivers.addAll(nonEscapingReceivers); | 2994 result.nonEscapingReceivers.addAll(nonEscapingReceivers); |
2995 return result; | 2995 return result; |
2996 } | 2996 } |
2997 } | 2997 } |
OLD | NEW |