| 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 part of fixnum; | 5 part of fixnum; |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * An immutable 64-bit signed integer, in the range [-2^63, 2^63 - 1]. | 8 * An immutable 64-bit signed integer, in the range [-2^63, 2^63 - 1]. |
| 9 * Arithmetic operations may overflow in order to maintain this range. | 9 * Arithmetic operations may overflow in order to maintain this range. |
| 10 */ | 10 */ |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 } | 141 } |
| 142 | 142 |
| 143 if (negative) { | 143 if (negative) { |
| 144 v0 = _MASK & ~v0; | 144 v0 = _MASK & ~v0; |
| 145 v1 = _MASK & ~v1; | 145 v1 = _MASK & ~v1; |
| 146 v2 = _MASK2 & ~v2; | 146 v2 = _MASK2 & ~v2; |
| 147 } | 147 } |
| 148 return new Int64._bits(v0, v1, v2); | 148 return new Int64._bits(v0, v1, v2); |
| 149 } | 149 } |
| 150 | 150 |
| 151 /** | |
| 152 * Constructs an [Int64] with a given [int] value. | |
| 153 */ | |
| 154 @deprecated | |
| 155 factory Int64.fromInt(int value) => new Int64(value); | |
| 156 | |
| 157 factory Int64.fromBytes(List<int> bytes) { | 151 factory Int64.fromBytes(List<int> bytes) { |
| 158 int top = bytes[7] & 0xff; | 152 int top = bytes[7] & 0xff; |
| 159 top <<= 8; | 153 top <<= 8; |
| 160 top |= bytes[6] & 0xff; | 154 top |= bytes[6] & 0xff; |
| 161 top <<= 8; | 155 top <<= 8; |
| 162 top |= bytes[5] & 0xff; | 156 top |= bytes[5] & 0xff; |
| 163 top <<= 8; | 157 top <<= 8; |
| 164 top |= bytes[4] & 0xff; | 158 top |= bytes[4] & 0xff; |
| 165 | 159 |
| 166 int bottom = bytes[3] & 0xff; | 160 int bottom = bytes[3] & 0xff; |
| (...skipping 872 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1039 if (r0 == 0 && r1 == 0 && r2 == 0) { | 1033 if (r0 == 0 && r1 == 0 && r2 == 0) { |
| 1040 return ZERO; | 1034 return ZERO; |
| 1041 } else { | 1035 } else { |
| 1042 return _sub(b0, b1, b2, r0, r1, r2); | 1036 return _sub(b0, b1, b2, r0, r1, r2); |
| 1043 } | 1037 } |
| 1044 } else { | 1038 } else { |
| 1045 return _negate(r0, r1, r2); | 1039 return _negate(r0, r1, r2); |
| 1046 } | 1040 } |
| 1047 } | 1041 } |
| 1048 } | 1042 } |
| OLD | NEW |