Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 library builtin_operator; | 4 library builtin_operator; |
| 5 // This is shared by the CPS and Tree IRs. | 5 // This is shared by the CPS and Tree IRs. |
| 6 // Both cps_ir_nodes and tree_ir_nodes import and re-export this file. | 6 // Both cps_ir_nodes and tree_ir_nodes import and re-export this file. |
| 7 | 7 |
| 8 /// An operator supported natively in the CPS and Tree IRs using the | 8 /// An operator supported natively in the CPS and Tree IRs using the |
| 9 /// `ApplyBuiltinOperator` instructions. | 9 /// `ApplyBuiltinOperator` instructions. |
| 10 /// | 10 /// |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 126 /// The argument must be repeated 2 times. | 126 /// The argument must be repeated 2 times. |
| 127 /// | 127 /// |
| 128 /// Compiles to `Math.floor(x) === x` | 128 /// Compiles to `Math.floor(x) === x` |
| 129 IsFloor, | 129 IsFloor, |
| 130 | 130 |
| 131 /// Returns true if the argument is an integer. | 131 /// Returns true if the argument is an integer. |
| 132 /// | 132 /// |
| 133 /// The argument must be repeated 3 times. | 133 /// The argument must be repeated 3 times. |
| 134 /// | 134 /// |
| 135 /// Compiles to `typeof x === 'number' && Math.floor(x) === x` | 135 /// Compiles to `typeof x === 'number' && Math.floor(x) === x` |
| 136 IsNumberAndFloor, | 136 IsNumberAndFloor, |
|
asgerf
2016/02/10 08:37:04
Please rename this to IsInteger to be consistent.
Siggi Cherem (dart-lang)
2016/02/12 00:14:00
Technically I no longer need IsNotInteger, so I co
asgerf
2016/02/12 10:29:10
No please leave it in. It's been bothering me that
| |
| 137 | 137 |
| 138 /// Returns true if the argument is not an integer. | |
| 139 /// | |
| 140 /// The argument must be repeated 3 times. | |
| 141 /// | |
| 142 /// Compiles to `typeof x !== 'number' || Math.floor(x) !== x` | |
| 143 IsNotInteger, | |
| 144 | |
| 138 /// Returns true if the argument is a fixed length Array. | 145 /// Returns true if the argument is a fixed length Array. |
| 139 /// | 146 /// |
| 140 /// Uses one argument. | 147 /// Uses one argument. |
| 141 /// | 148 /// |
| 142 /// Precondition: Argument is a JavaScript Array. | 149 /// Precondition: Argument is a JavaScript Array. |
| 143 IsFixedLengthJSArray, | 150 IsFixedLengthJSArray, |
| 144 | 151 |
| 145 // TODO(sra): Remove this and replace with IsFalsy(IsFixedLengthJSArray(x)). | 152 // TODO(sra): Remove this and replace with IsFalsy(IsFixedLengthJSArray(x)). |
| 146 IsExtendableJSArray, | 153 IsExtendableJSArray, |
| 147 | 154 |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 189 case BuiltinOperator.NumSubtract: | 196 case BuiltinOperator.NumSubtract: |
| 190 case BuiltinOperator.NumMultiply: | 197 case BuiltinOperator.NumMultiply: |
| 191 case BuiltinOperator.NumDivide: | 198 case BuiltinOperator.NumDivide: |
| 192 case BuiltinOperator.NumRemainder: | 199 case BuiltinOperator.NumRemainder: |
| 193 case BuiltinOperator.StringConcatenate: | 200 case BuiltinOperator.StringConcatenate: |
| 194 return true; | 201 return true; |
| 195 default: | 202 default: |
| 196 return false; | 203 return false; |
| 197 } | 204 } |
| 198 } | 205 } |
| OLD | NEW |