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

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

Issue 1900863004: VM: Remove _leftShiftWithMask32. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 8 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 | « runtime/lib/integers.cc ('k') | runtime/lib/object_patch.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) 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 abstract class _IntegerImplementation { 5 abstract class _IntegerImplementation {
6 // The Dart class _Bigint extending _IntegerImplementation requires a 6 // The Dart class _Bigint extending _IntegerImplementation requires a
7 // default constructor. 7 // default constructor.
8 8
9 Type get runtimeType => int; 9 Type get runtimeType => int;
10 10
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 _OneByteString string = _OneByteString._allocate(length); 256 _OneByteString string = _OneByteString._allocate(length);
257 string._setAt(0, 0x2d); // '-'. Is overwritten if not negative. 257 string._setAt(0, 0x2d); // '-'. Is overwritten if not negative.
258 var mask = radix - 1; 258 var mask = radix - 1;
259 do { 259 do {
260 string._setAt(--length, _digits.codeUnitAt(value & mask)); 260 string._setAt(--length, _digits.codeUnitAt(value & mask));
261 value >>= bitsPerDigit; 261 value >>= bitsPerDigit;
262 } while (value > 0); 262 } while (value > 0);
263 return string; 263 return string;
264 } 264 }
265 265
266 _leftShiftWithMask32(count, mask) native "Integer_leftShiftWithMask32";
267
268 // Returns pow(this, e) % m. 266 // Returns pow(this, e) % m.
269 int modPow(int e, int m) { 267 int modPow(int e, int m) {
270 if (e is! int) { 268 if (e is! int) {
271 throw new ArgumentError.value(e, "exponent", "not an integer"); 269 throw new ArgumentError.value(e, "exponent", "not an integer");
272 } 270 }
273 if (m is! int) { 271 if (m is! int) {
274 throw new ArgumentError.value(m, "modulus", "not an integer"); 272 throw new ArgumentError.value(m, "modulus", "not an integer");
275 } 273 }
276 if (e < 0) throw new RangeError.range(e, 0, null, "exponent"); 274 if (e < 0) throw new RangeError.range(e, 0, null, "exponent");
277 if (m <= 0) throw new RangeError.range(m, 1, null, "modulus"); 275 if (m <= 0) throw new RangeError.range(m, 1, null, "modulus");
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after
615 // Shift by mint exceeds range that can be handled by the VM. 613 // Shift by mint exceeds range that can be handled by the VM.
616 int _shrFromInt(int other) { 614 int _shrFromInt(int other) {
617 if (other < 0) { 615 if (other < 0) {
618 return -1; 616 return -1;
619 } else { 617 } else {
620 return 0; 618 return 0;
621 } 619 }
622 } 620 }
623 int _shlFromInt(int other) native "Mint_shlFromInt"; 621 int _shlFromInt(int other) native "Mint_shlFromInt";
624 } 622 }
OLDNEW
« no previous file with comments | « runtime/lib/integers.cc ('k') | runtime/lib/object_patch.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698