| 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 // Dart core library. | 4 // Dart core library. |
| 5 | 5 |
| 6 // VM implementation of int. | 6 // VM implementation of int. |
| 7 | 7 |
| 8 patch class int { | 8 patch class int { |
| 9 | 9 |
| 10 /* patch */ const factory int.fromEnvironment(String name, | 10 /* patch */ const factory int.fromEnvironment(String name, |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 int smallBlockSize = length; | 127 int smallBlockSize = length; |
| 128 while (smallBlockSize >= blockSize) smallBlockSize -= blockSize; | 128 while (smallBlockSize >= blockSize) smallBlockSize -= blockSize; |
| 129 int result = 0; | 129 int result = 0; |
| 130 if (smallBlockSize > 0) { | 130 if (smallBlockSize > 0) { |
| 131 int blockEnd = start + smallBlockSize; | 131 int blockEnd = start + smallBlockSize; |
| 132 _Smi smi = _parseBlock(source, radix, start, blockEnd); | 132 _Smi smi = _parseBlock(source, radix, start, blockEnd); |
| 133 if (smi == null) return null; | 133 if (smi == null) return null; |
| 134 result = sign * smi; | 134 result = sign * smi; |
| 135 start = blockEnd; | 135 start = blockEnd; |
| 136 } | 136 } |
| 137 _Smi multiplier = _PARSE_LIMITS[tableIndex + 1]; | 137 int multiplier = _PARSE_LIMITS[tableIndex + 1]; |
| 138 int blockEnd = start + blockSize; | 138 int blockEnd = start + blockSize; |
| 139 do { | 139 do { |
| 140 _Smi smi = _parseBlock(source, radix, start, blockEnd); | 140 _Smi smi = _parseBlock(source, radix, start, blockEnd); |
| 141 if (smi == null) return null; | 141 if (smi == null) return null; |
| 142 result = (result * multiplier) + (sign * smi); | 142 result = (result * multiplier) + (sign * smi); |
| 143 start = blockEnd; | 143 start = blockEnd; |
| 144 blockEnd = start + blockSize; | 144 blockEnd = start + blockSize; |
| 145 } while (blockEnd <= end); | 145 } while (blockEnd <= end); |
| 146 return result; | 146 return result; |
| 147 } | 147 } |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 6, 594823321, 12, 353814783205469041, | 203 6, 594823321, 12, 353814783205469041, |
| 204 6, 729000000, 12, 531441000000000000, /* radix: 30 */ | 204 6, 729000000, 12, 531441000000000000, /* radix: 30 */ |
| 205 6, 887503681, 12, 787662783788549761, | 205 6, 887503681, 12, 787662783788549761, |
| 206 6, 1073741824, 12, 1152921504606846976, | 206 6, 1073741824, 12, 1152921504606846976, |
| 207 5, 39135393, 12, 1667889514952984961, | 207 5, 39135393, 12, 1667889514952984961, |
| 208 5, 45435424, 12, 2386420683693101056, | 208 5, 45435424, 12, 2386420683693101056, |
| 209 5, 52521875, 12, 3379220508056640625, /* radix: 35 */ | 209 5, 52521875, 12, 3379220508056640625, /* radix: 35 */ |
| 210 5, 60466176, 11, 131621703842267136, | 210 5, 60466176, 11, 131621703842267136, |
| 211 ]; | 211 ]; |
| 212 } | 212 } |
| OLD | NEW |