Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(72)

Side by Side Diff: pkg/compiler/lib/src/cps_ir/builtin_operator.dart

Issue 1699033003: dart2js cps: Combine integer type check with bounds check. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Rebase Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 /// Compiles to `typeof x === 'number' && Math.floor(x) === x` 135 /// Compiles to `typeof x === 'number' && Math.floor(x) === x`
136 IsInteger, 136 IsInteger,
137 137
138 /// Returns true if the argument is not an integer. 138 /// Returns true if the argument is not an integer.
139 /// 139 ///
140 /// The argument must be repeated 3 times. 140 /// The argument must be repeated 3 times.
141 /// 141 ///
142 /// Compiles to `typeof x !== 'number' || Math.floor(x) !== x` 142 /// Compiles to `typeof x !== 'number' || Math.floor(x) !== x`
143 IsNotInteger, 143 IsNotInteger,
144 144
145 /// Returns true if `x` is an unsigned 32-bit integer.
146 ///
147 /// The argument must be repeated 2 times.
148 ///
149 /// Compiles to `x >>> 0 === x`
150 IsUnsigned32BitInteger,
151
152 /// Returns false if `x` is an unsigned 32-bit integer.
153 ///
154 /// The argument must be repeated 2 times.
155 ///
156 /// Compiles to `x >>> 0 !== x`
157 IsNotUnsigned32BitInteger,
158
145 /// Returns true if the argument is a fixed length Array. 159 /// Returns true if the argument is a fixed length Array.
146 /// 160 ///
147 /// Uses one argument. 161 /// Uses one argument.
148 /// 162 ///
149 /// Precondition: Argument is a JavaScript Array. 163 /// Precondition: Argument is a JavaScript Array.
150 IsFixedLengthJSArray, 164 IsFixedLengthJSArray,
151 165
152 // TODO(sra): Remove this and replace with IsFalsy(IsFixedLengthJSArray(x)). 166 // TODO(sra): Remove this and replace with IsFalsy(IsFixedLengthJSArray(x)).
153 IsExtendableJSArray, 167 IsExtendableJSArray,
154 168
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 case BuiltinOperator.NumSubtract: 210 case BuiltinOperator.NumSubtract:
197 case BuiltinOperator.NumMultiply: 211 case BuiltinOperator.NumMultiply:
198 case BuiltinOperator.NumDivide: 212 case BuiltinOperator.NumDivide:
199 case BuiltinOperator.NumRemainder: 213 case BuiltinOperator.NumRemainder:
200 case BuiltinOperator.StringConcatenate: 214 case BuiltinOperator.StringConcatenate:
201 return true; 215 return true;
202 default: 216 default:
203 return false; 217 return false;
204 } 218 }
205 } 219 }
OLDNEW
« no previous file with comments | « no previous file | pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698