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

Side by Side Diff: runtime/lib/integers.dart

Issue 57703004: Constant fold strict comparison based on incoming types: different (exact) types means that the res… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | runtime/vm/flow_graph_optimizer.cc » ('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) 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 // TODO(srdjan): fix limitations. 5 // TODO(srdjan): fix limitations.
6 // - shift amount must be a Smi. 6 // - shift amount must be a Smi.
7 class _IntegerImplementation { 7 class _IntegerImplementation {
8 factory _IntegerImplementation._uninstantiable() { 8 factory _IntegerImplementation._uninstantiable() {
9 throw new UnsupportedError( 9 throw new UnsupportedError(
10 "_IntegerImplementation can only be allocated by the VM"); 10 "_IntegerImplementation can only be allocated by the VM");
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 282
283 _OneByteString string = _OneByteString._allocate(index); 283 _OneByteString string = _OneByteString._allocate(index);
284 for (int i = 0, j = index; i < index; i++) { 284 for (int i = 0, j = index; i < index; i++) {
285 string._setAt(i, reversed[--j]); 285 string._setAt(i, reversed[--j]);
286 } 286 }
287 return string; 287 return string;
288 } 288 }
289 } 289 }
290 290
291 // Reusable buffer used by smi.toString. 291 // Reusable buffer used by smi.toString.
292 List _toStringBuffer = new Uint8List(20); 292 final List _toStringBuffer = new Uint8List(20);
293 293
294 // Represents integers that cannot be represented by Smi but fit into 64bits. 294 // Represents integers that cannot be represented by Smi but fit into 64bits.
295 class _Mint extends _IntegerImplementation implements int { 295 class _Mint extends _IntegerImplementation implements int {
296 factory _Mint._uninstantiable() { 296 factory _Mint._uninstantiable() {
297 throw new UnsupportedError( 297 throw new UnsupportedError(
298 "_Mint can only be allocated by the VM"); 298 "_Mint can only be allocated by the VM");
299 } 299 }
300 int get _identityHashCode { 300 int get _identityHashCode {
301 return this; 301 return this;
302 } 302 }
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
334 } else { 334 } else {
335 return 0; 335 return 0;
336 } 336 }
337 } 337 }
338 int _shlFromInt(int other) native "Bigint_shlFromInt"; 338 int _shlFromInt(int other) native "Bigint_shlFromInt";
339 339
340 int pow(int exponent) { 340 int pow(int exponent) {
341 throw "Bigint.pow not implemented"; 341 throw "Bigint.pow not implemented";
342 } 342 }
343 } 343 }
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/flow_graph_optimizer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698