| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 // patch classes for Int8List ..... Float64List and ByteData implementations. | 5 // patch classes for Int8List ..... Float64List and ByteData implementations. |
| 6 | 6 |
| 7 import "dart:_internal"; | 7 import "dart:_internal"; |
| 8 import 'dart:math' show Random; | 8 import 'dart:math' show Random; |
| 9 | 9 |
| 10 patch class Int8List { | 10 patch class Int8List { |
| (...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 480 if (end == null) end = this.length; | 480 if (end == null) end = this.length; |
| 481 var length = end - start; | 481 var length = end - start; |
| 482 _rangeCheck(this.length, start, length); | 482 _rangeCheck(this.length, start, length); |
| 483 List result = _createList(length); | 483 List result = _createList(length); |
| 484 result.setRange(0, length, this, start); | 484 result.setRange(0, length, this, start); |
| 485 return result; | 485 return result; |
| 486 } | 486 } |
| 487 | 487 |
| 488 void setRange(int start, int end, Iterable from, [int skipCount = 0]) { | 488 void setRange(int start, int end, Iterable from, [int skipCount = 0]) { |
| 489 // Check ranges. | 489 // Check ranges. |
| 490 if (0 > start || start > end || end > length) { | 490 if ((start < 0) || (start > length)) { |
| 491 RangeError.checkValidRange(start, end, length); // Always throws. | 491 throw _newRangeError(start, length + 1); |
| 492 assert(false); | 492 } |
| 493 if ((end < 0) || (end > length)) { |
| 494 throw _newRangeError(end, length + 1); |
| 495 } |
| 496 if (start > end) { |
| 497 throw _newRangeError(start, end + 1); |
| 493 } | 498 } |
| 494 if (skipCount < 0) { | 499 if (skipCount < 0) { |
| 495 throw new ArgumentError(skipCount); | 500 throw new ArgumentError(skipCount); |
| 496 } | 501 } |
| 497 | 502 |
| 498 final count = end - start; | 503 final count = end - start; |
| 499 if ((from.length - skipCount) < count) { | 504 if ((from.length - skipCount) < count) { |
| 500 throw IterableElementError.tooFew(); | 505 throw IterableElementError.tooFew(); |
| 501 } | 506 } |
| 502 | 507 |
| (...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 930 | 935 |
| 931 factory _Int8Array(int length) { | 936 factory _Int8Array(int length) { |
| 932 return _new(length); | 937 return _new(length); |
| 933 } | 938 } |
| 934 | 939 |
| 935 | 940 |
| 936 // Method(s) implementing List interface. | 941 // Method(s) implementing List interface. |
| 937 | 942 |
| 938 int operator[](int index) { | 943 int operator[](int index) { |
| 939 if (index < 0 || index >= length) { | 944 if (index < 0 || index >= length) { |
| 940 throw new RangeError.index(index, this, "index"); | 945 throw _newRangeError(index, length); |
| 941 } | 946 } |
| 942 return _getInt8(index); | 947 return _getInt8(index); |
| 943 } | 948 } |
| 944 | 949 |
| 945 void operator[]=(int index, int value) { | 950 void operator[]=(int index, int value) { |
| 946 if (index < 0 || index >= length) { | 951 if (index < 0 || index >= length) { |
| 947 throw new RangeError.index(index, this, "index"); | 952 throw _newRangeError(index, length); |
| 948 } | 953 } |
| 949 _setInt8(index, _toInt8(value)); | 954 _setInt8(index, _toInt8(value)); |
| 950 } | 955 } |
| 951 | 956 |
| 952 | 957 |
| 953 // Method(s) implementing TypedData interface. | 958 // Method(s) implementing TypedData interface. |
| 954 | 959 |
| 955 int get elementSizeInBytes { | 960 int get elementSizeInBytes { |
| 956 return Int8List.BYTES_PER_ELEMENT; | 961 return Int8List.BYTES_PER_ELEMENT; |
| 957 } | 962 } |
| (...skipping 13 matching lines...) Expand all Loading... |
| 971 // Factory constructors. | 976 // Factory constructors. |
| 972 | 977 |
| 973 factory _Uint8Array(int length) { | 978 factory _Uint8Array(int length) { |
| 974 return _new(length); | 979 return _new(length); |
| 975 } | 980 } |
| 976 | 981 |
| 977 | 982 |
| 978 // Methods implementing List interface. | 983 // Methods implementing List interface. |
| 979 int operator[](int index) { | 984 int operator[](int index) { |
| 980 if (index < 0 || index >= length) { | 985 if (index < 0 || index >= length) { |
| 981 throw new RangeError.index(index, this, "index"); | 986 throw _newRangeError(index, length); |
| 982 } | 987 } |
| 983 return _getUint8(index); | 988 return _getUint8(index); |
| 984 } | 989 } |
| 985 | 990 |
| 986 void operator[]=(int index, int value) { | 991 void operator[]=(int index, int value) { |
| 987 if (index < 0 || index >= length) { | 992 if (index < 0 || index >= length) { |
| 988 throw new RangeError.index(index, this, "index"); | 993 throw _newRangeError(index, length); |
| 989 } | 994 } |
| 990 _setUint8(index, _toUint8(value)); | 995 _setUint8(index, _toUint8(value)); |
| 991 } | 996 } |
| 992 | 997 |
| 993 | 998 |
| 994 // Methods implementing TypedData interface. | 999 // Methods implementing TypedData interface. |
| 995 int get elementSizeInBytes { | 1000 int get elementSizeInBytes { |
| 996 return Uint8List.BYTES_PER_ELEMENT; | 1001 return Uint8List.BYTES_PER_ELEMENT; |
| 997 } | 1002 } |
| 998 | 1003 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 1011 // Factory constructors. | 1016 // Factory constructors. |
| 1012 | 1017 |
| 1013 factory _Uint8ClampedArray(int length) { | 1018 factory _Uint8ClampedArray(int length) { |
| 1014 return _new(length); | 1019 return _new(length); |
| 1015 } | 1020 } |
| 1016 | 1021 |
| 1017 // Methods implementing List interface. | 1022 // Methods implementing List interface. |
| 1018 | 1023 |
| 1019 int operator[](int index) { | 1024 int operator[](int index) { |
| 1020 if (index < 0 || index >= length) { | 1025 if (index < 0 || index >= length) { |
| 1021 throw new RangeError.index(index, this, "index"); | 1026 throw _newRangeError(index, length); |
| 1022 } | 1027 } |
| 1023 return _getUint8(index); | 1028 return _getUint8(index); |
| 1024 } | 1029 } |
| 1025 | 1030 |
| 1026 void operator[]=(int index, int value) { | 1031 void operator[]=(int index, int value) { |
| 1027 if (index < 0 || index >= length) { | 1032 if (index < 0 || index >= length) { |
| 1028 throw new RangeError.index(index, this, "index"); | 1033 throw _newRangeError(index, length); |
| 1029 } | 1034 } |
| 1030 _setUint8(index, _toClampedUint8(value)); | 1035 _setUint8(index, _toClampedUint8(value)); |
| 1031 } | 1036 } |
| 1032 | 1037 |
| 1033 | 1038 |
| 1034 // Methods implementing TypedData interface. | 1039 // Methods implementing TypedData interface. |
| 1035 int get elementSizeInBytes { | 1040 int get elementSizeInBytes { |
| 1036 return Uint8List.BYTES_PER_ELEMENT; | 1041 return Uint8List.BYTES_PER_ELEMENT; |
| 1037 } | 1042 } |
| 1038 | 1043 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 1053 | 1058 |
| 1054 factory _Int16Array(int length) { | 1059 factory _Int16Array(int length) { |
| 1055 return _new(length); | 1060 return _new(length); |
| 1056 } | 1061 } |
| 1057 | 1062 |
| 1058 | 1063 |
| 1059 // Method(s) implementing List interface. | 1064 // Method(s) implementing List interface. |
| 1060 | 1065 |
| 1061 int operator[](int index) { | 1066 int operator[](int index) { |
| 1062 if (index < 0 || index >= length) { | 1067 if (index < 0 || index >= length) { |
| 1063 throw new RangeError.index(index, this, "index"); | 1068 throw _newRangeError(index, length); |
| 1064 } | 1069 } |
| 1065 return _getIndexedInt16(index); | 1070 return _getIndexedInt16(index); |
| 1066 } | 1071 } |
| 1067 | 1072 |
| 1068 void operator[]=(int index, int value) { | 1073 void operator[]=(int index, int value) { |
| 1069 if (index < 0 || index >= length) { | 1074 if (index < 0 || index >= length) { |
| 1070 throw new RangeError.index(index, this, "index"); | 1075 throw _newRangeError(index, length); |
| 1071 } | 1076 } |
| 1072 _setIndexedInt16(index, _toInt16(value)); | 1077 _setIndexedInt16(index, _toInt16(value)); |
| 1073 } | 1078 } |
| 1074 | 1079 |
| 1075 void setRange(int start, int end, Iterable iterable, [int skipCount = 0]) { | 1080 void setRange(int start, int end, Iterable iterable, [int skipCount = 0]) { |
| 1076 if (ClassID.getID(iterable) == CodeUnits.cid) { | 1081 if (ClassID.getID(iterable) == CodeUnits.cid) { |
| 1077 end = RangeError.checkValidRange(start, end, this.length); | 1082 end = RangeError.checkValidRange(start, end, this.length); |
| 1078 int length = end - start; | 1083 int length = end - start; |
| 1079 int byteStart = this.offsetInBytes + start * Int16List.BYTES_PER_ELEMENT; | 1084 int byteStart = this.offsetInBytes + start * Int16List.BYTES_PER_ELEMENT; |
| 1080 _setCodeUnits(iterable, byteStart, length, skipCount); | 1085 _setCodeUnits(iterable, byteStart, length, skipCount); |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1113 | 1118 |
| 1114 factory _Uint16Array(int length) { | 1119 factory _Uint16Array(int length) { |
| 1115 return _new(length); | 1120 return _new(length); |
| 1116 } | 1121 } |
| 1117 | 1122 |
| 1118 | 1123 |
| 1119 // Method(s) implementing the List interface. | 1124 // Method(s) implementing the List interface. |
| 1120 | 1125 |
| 1121 int operator[](int index) { | 1126 int operator[](int index) { |
| 1122 if (index < 0 || index >= length) { | 1127 if (index < 0 || index >= length) { |
| 1123 throw new RangeError.index(index, this, "index"); | 1128 throw _newRangeError(index, length); |
| 1124 } | 1129 } |
| 1125 return _getIndexedUint16(index); | 1130 return _getIndexedUint16(index); |
| 1126 } | 1131 } |
| 1127 | 1132 |
| 1128 void operator[]=(int index, int value) { | 1133 void operator[]=(int index, int value) { |
| 1129 if (index < 0 || index >= length) { | 1134 if (index < 0 || index >= length) { |
| 1130 throw new RangeError.index(index, this, "index"); | 1135 throw _newRangeError(index, length); |
| 1131 } | 1136 } |
| 1132 _setIndexedUint16(index, _toUint16(value)); | 1137 _setIndexedUint16(index, _toUint16(value)); |
| 1133 } | 1138 } |
| 1134 | 1139 |
| 1135 void setRange(int start, int end, Iterable iterable, [int skipCount = 0]) { | 1140 void setRange(int start, int end, Iterable iterable, [int skipCount = 0]) { |
| 1136 if (ClassID.getID(iterable) == CodeUnits.cid) { | 1141 if (ClassID.getID(iterable) == CodeUnits.cid) { |
| 1137 end = RangeError.checkValidRange(start, end, this.length); | 1142 end = RangeError.checkValidRange(start, end, this.length); |
| 1138 int length = end - start; | 1143 int length = end - start; |
| 1139 int byteStart = this.offsetInBytes + start * Uint16List.BYTES_PER_ELEMENT; | 1144 int byteStart = this.offsetInBytes + start * Uint16List.BYTES_PER_ELEMENT; |
| 1140 _setCodeUnits(iterable, byteStart, length, skipCount); | 1145 _setCodeUnits(iterable, byteStart, length, skipCount); |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1173 | 1178 |
| 1174 factory _Int32Array(int length) { | 1179 factory _Int32Array(int length) { |
| 1175 return _new(length); | 1180 return _new(length); |
| 1176 } | 1181 } |
| 1177 | 1182 |
| 1178 | 1183 |
| 1179 // Method(s) implementing the List interface. | 1184 // Method(s) implementing the List interface. |
| 1180 | 1185 |
| 1181 int operator[](int index) { | 1186 int operator[](int index) { |
| 1182 if (index < 0 || index >= length) { | 1187 if (index < 0 || index >= length) { |
| 1183 throw new RangeError.index(index, this, "index"); | 1188 throw _newRangeError(index, length); |
| 1184 } | 1189 } |
| 1185 return _getIndexedInt32(index); | 1190 return _getIndexedInt32(index); |
| 1186 } | 1191 } |
| 1187 | 1192 |
| 1188 void operator[]=(int index, int value) { | 1193 void operator[]=(int index, int value) { |
| 1189 if (index < 0 || index >= length) { | 1194 if (index < 0 || index >= length) { |
| 1190 throw new RangeError.index(index, this, "index"); | 1195 throw _newRangeError(index, length); |
| 1191 } | 1196 } |
| 1192 _setIndexedInt32(index, _toInt32(value)); | 1197 _setIndexedInt32(index, _toInt32(value)); |
| 1193 } | 1198 } |
| 1194 | 1199 |
| 1195 | 1200 |
| 1196 // Method(s) implementing TypedData interface. | 1201 // Method(s) implementing TypedData interface. |
| 1197 | 1202 |
| 1198 int get elementSizeInBytes { | 1203 int get elementSizeInBytes { |
| 1199 return Int32List.BYTES_PER_ELEMENT; | 1204 return Int32List.BYTES_PER_ELEMENT; |
| 1200 } | 1205 } |
| (...skipping 22 matching lines...) Expand all Loading... |
| 1223 | 1228 |
| 1224 factory _Uint32Array(int length) { | 1229 factory _Uint32Array(int length) { |
| 1225 return _new(length); | 1230 return _new(length); |
| 1226 } | 1231 } |
| 1227 | 1232 |
| 1228 | 1233 |
| 1229 // Method(s) implementing the List interface. | 1234 // Method(s) implementing the List interface. |
| 1230 | 1235 |
| 1231 int operator[](int index) { | 1236 int operator[](int index) { |
| 1232 if (index < 0 || index >= length) { | 1237 if (index < 0 || index >= length) { |
| 1233 throw new RangeError.index(index, this, "index"); | 1238 throw _newRangeError(index, length); |
| 1234 } | 1239 } |
| 1235 return _getIndexedUint32(index); | 1240 return _getIndexedUint32(index); |
| 1236 } | 1241 } |
| 1237 | 1242 |
| 1238 void operator[]=(int index, int value) { | 1243 void operator[]=(int index, int value) { |
| 1239 if (index < 0 || index >= length) { | 1244 if (index < 0 || index >= length) { |
| 1240 throw new RangeError.index(index, this, "index"); | 1245 throw _newRangeError(index, length); |
| 1241 } | 1246 } |
| 1242 _setIndexedUint32(index, _toUint32(value)); | 1247 _setIndexedUint32(index, _toUint32(value)); |
| 1243 } | 1248 } |
| 1244 | 1249 |
| 1245 | 1250 |
| 1246 // Method(s) implementing the TypedData interface. | 1251 // Method(s) implementing the TypedData interface. |
| 1247 | 1252 |
| 1248 int get elementSizeInBytes { | 1253 int get elementSizeInBytes { |
| 1249 return Uint32List.BYTES_PER_ELEMENT; | 1254 return Uint32List.BYTES_PER_ELEMENT; |
| 1250 } | 1255 } |
| (...skipping 22 matching lines...) Expand all Loading... |
| 1273 | 1278 |
| 1274 factory _Int64Array(int length) { | 1279 factory _Int64Array(int length) { |
| 1275 return _new(length); | 1280 return _new(length); |
| 1276 } | 1281 } |
| 1277 | 1282 |
| 1278 | 1283 |
| 1279 // Method(s) implementing the List interface. | 1284 // Method(s) implementing the List interface. |
| 1280 | 1285 |
| 1281 int operator[](int index) { | 1286 int operator[](int index) { |
| 1282 if (index < 0 || index >= length) { | 1287 if (index < 0 || index >= length) { |
| 1283 throw new RangeError.index(index, this, "index"); | 1288 throw _newRangeError(index, length); |
| 1284 } | 1289 } |
| 1285 return _getIndexedInt64(index); | 1290 return _getIndexedInt64(index); |
| 1286 } | 1291 } |
| 1287 | 1292 |
| 1288 void operator[]=(int index, int value) { | 1293 void operator[]=(int index, int value) { |
| 1289 if (index < 0 || index >= length) { | 1294 if (index < 0 || index >= length) { |
| 1290 throw new RangeError.index(index, this, "index"); | 1295 throw _newRangeError(index, length); |
| 1291 } | 1296 } |
| 1292 _setIndexedInt64(index, _toInt64(value)); | 1297 _setIndexedInt64(index, _toInt64(value)); |
| 1293 } | 1298 } |
| 1294 | 1299 |
| 1295 | 1300 |
| 1296 // Method(s) implementing the TypedData interface. | 1301 // Method(s) implementing the TypedData interface. |
| 1297 | 1302 |
| 1298 int get elementSizeInBytes { | 1303 int get elementSizeInBytes { |
| 1299 return Int64List.BYTES_PER_ELEMENT; | 1304 return Int64List.BYTES_PER_ELEMENT; |
| 1300 } | 1305 } |
| (...skipping 22 matching lines...) Expand all Loading... |
| 1323 | 1328 |
| 1324 factory _Uint64Array(int length) { | 1329 factory _Uint64Array(int length) { |
| 1325 return _new(length); | 1330 return _new(length); |
| 1326 } | 1331 } |
| 1327 | 1332 |
| 1328 | 1333 |
| 1329 // Method(s) implementing the List interface. | 1334 // Method(s) implementing the List interface. |
| 1330 | 1335 |
| 1331 int operator[](int index) { | 1336 int operator[](int index) { |
| 1332 if (index < 0 || index >= length) { | 1337 if (index < 0 || index >= length) { |
| 1333 throw new RangeError.index(index, this, "index"); | 1338 throw _newRangeError(index, length); |
| 1334 } | 1339 } |
| 1335 return _getIndexedUint64(index); | 1340 return _getIndexedUint64(index); |
| 1336 } | 1341 } |
| 1337 | 1342 |
| 1338 void operator[]=(int index, int value) { | 1343 void operator[]=(int index, int value) { |
| 1339 if (index < 0 || index >= length) { | 1344 if (index < 0 || index >= length) { |
| 1340 throw new RangeError.index(index, this, "index"); | 1345 throw _newRangeError(index, length); |
| 1341 } | 1346 } |
| 1342 _setIndexedUint64(index, _toUint64(value)); | 1347 _setIndexedUint64(index, _toUint64(value)); |
| 1343 } | 1348 } |
| 1344 | 1349 |
| 1345 | 1350 |
| 1346 // Method(s) implementing the TypedData interface. | 1351 // Method(s) implementing the TypedData interface. |
| 1347 | 1352 |
| 1348 int get elementSizeInBytes { | 1353 int get elementSizeInBytes { |
| 1349 return Uint64List.BYTES_PER_ELEMENT; | 1354 return Uint64List.BYTES_PER_ELEMENT; |
| 1350 } | 1355 } |
| (...skipping 22 matching lines...) Expand all Loading... |
| 1373 | 1378 |
| 1374 factory _Float32Array(int length) { | 1379 factory _Float32Array(int length) { |
| 1375 return _new(length); | 1380 return _new(length); |
| 1376 } | 1381 } |
| 1377 | 1382 |
| 1378 | 1383 |
| 1379 // Method(s) implementing the List interface. | 1384 // Method(s) implementing the List interface. |
| 1380 | 1385 |
| 1381 double operator[](int index) { | 1386 double operator[](int index) { |
| 1382 if (index < 0 || index >= length) { | 1387 if (index < 0 || index >= length) { |
| 1383 throw new RangeError.index(index, this, "index"); | 1388 throw _newRangeError(index, length); |
| 1384 } | 1389 } |
| 1385 return _getIndexedFloat32(index); | 1390 return _getIndexedFloat32(index); |
| 1386 } | 1391 } |
| 1387 | 1392 |
| 1388 void operator[]=(int index, double value) { | 1393 void operator[]=(int index, double value) { |
| 1389 if (index < 0 || index >= length) { | 1394 if (index < 0 || index >= length) { |
| 1390 throw new RangeError.index(index, this, "index"); | 1395 throw _newRangeError(index, length); |
| 1391 } | 1396 } |
| 1392 _setIndexedFloat32(index, value); | 1397 _setIndexedFloat32(index, value); |
| 1393 } | 1398 } |
| 1394 | 1399 |
| 1395 | 1400 |
| 1396 // Method(s) implementing the TypedData interface. | 1401 // Method(s) implementing the TypedData interface. |
| 1397 | 1402 |
| 1398 int get elementSizeInBytes { | 1403 int get elementSizeInBytes { |
| 1399 return Float32List.BYTES_PER_ELEMENT; | 1404 return Float32List.BYTES_PER_ELEMENT; |
| 1400 } | 1405 } |
| (...skipping 22 matching lines...) Expand all Loading... |
| 1423 | 1428 |
| 1424 factory _Float64Array(int length) { | 1429 factory _Float64Array(int length) { |
| 1425 return _new(length); | 1430 return _new(length); |
| 1426 } | 1431 } |
| 1427 | 1432 |
| 1428 | 1433 |
| 1429 // Method(s) implementing the List interface. | 1434 // Method(s) implementing the List interface. |
| 1430 | 1435 |
| 1431 double operator[](int index) { | 1436 double operator[](int index) { |
| 1432 if (index < 0 || index >= length) { | 1437 if (index < 0 || index >= length) { |
| 1433 throw new RangeError.index(index, this, "index"); | 1438 throw _newRangeError(index, length); |
| 1434 } | 1439 } |
| 1435 return _getIndexedFloat64(index); | 1440 return _getIndexedFloat64(index); |
| 1436 } | 1441 } |
| 1437 | 1442 |
| 1438 void operator[]=(int index, double value) { | 1443 void operator[]=(int index, double value) { |
| 1439 if (index < 0 || index >= length) { | 1444 if (index < 0 || index >= length) { |
| 1440 throw new RangeError.index(index, this, "index"); | 1445 throw _newRangeError(index, length); |
| 1441 } | 1446 } |
| 1442 _setIndexedFloat64(index, value); | 1447 _setIndexedFloat64(index, value); |
| 1443 } | 1448 } |
| 1444 | 1449 |
| 1445 | 1450 |
| 1446 // Method(s) implementing the TypedData interface. | 1451 // Method(s) implementing the TypedData interface. |
| 1447 | 1452 |
| 1448 int get elementSizeInBytes { | 1453 int get elementSizeInBytes { |
| 1449 return Float64List.BYTES_PER_ELEMENT; | 1454 return Float64List.BYTES_PER_ELEMENT; |
| 1450 } | 1455 } |
| (...skipping 20 matching lines...) Expand all Loading... |
| 1471 class _Float32x4Array extends _TypedList with _Float32x4ListMixin implements Flo
at32x4List { | 1476 class _Float32x4Array extends _TypedList with _Float32x4ListMixin implements Flo
at32x4List { |
| 1472 // Factory constructors. | 1477 // Factory constructors. |
| 1473 | 1478 |
| 1474 factory _Float32x4Array(int length) { | 1479 factory _Float32x4Array(int length) { |
| 1475 return _new(length); | 1480 return _new(length); |
| 1476 } | 1481 } |
| 1477 | 1482 |
| 1478 | 1483 |
| 1479 Float32x4 operator[](int index) { | 1484 Float32x4 operator[](int index) { |
| 1480 if (index < 0 || index >= length) { | 1485 if (index < 0 || index >= length) { |
| 1481 throw new RangeError.index(index, this, "index"); | 1486 throw _newRangeError(index, length); |
| 1482 } | 1487 } |
| 1483 return _getIndexedFloat32x4(index); | 1488 return _getIndexedFloat32x4(index); |
| 1484 } | 1489 } |
| 1485 | 1490 |
| 1486 void operator[]=(int index, Float32x4 value) { | 1491 void operator[]=(int index, Float32x4 value) { |
| 1487 if (index < 0 || index >= length) { | 1492 if (index < 0 || index >= length) { |
| 1488 throw new RangeError.index(index, this, "index"); | 1493 throw _newRangeError(index, length); |
| 1489 } | 1494 } |
| 1490 _setIndexedFloat32x4(index, value); | 1495 _setIndexedFloat32x4(index, value); |
| 1491 } | 1496 } |
| 1492 | 1497 |
| 1493 | 1498 |
| 1494 // Method(s) implementing the TypedData interface. | 1499 // Method(s) implementing the TypedData interface. |
| 1495 | 1500 |
| 1496 int get elementSizeInBytes { | 1501 int get elementSizeInBytes { |
| 1497 return Float32x4List.BYTES_PER_ELEMENT; | 1502 return Float32x4List.BYTES_PER_ELEMENT; |
| 1498 } | 1503 } |
| (...skipping 20 matching lines...) Expand all Loading... |
| 1519 class _Int32x4Array extends _TypedList with _Int32x4ListMixin implements Int32x4
List { | 1524 class _Int32x4Array extends _TypedList with _Int32x4ListMixin implements Int32x4
List { |
| 1520 // Factory constructors. | 1525 // Factory constructors. |
| 1521 | 1526 |
| 1522 factory _Int32x4Array(int length) { | 1527 factory _Int32x4Array(int length) { |
| 1523 return _new(length); | 1528 return _new(length); |
| 1524 } | 1529 } |
| 1525 | 1530 |
| 1526 | 1531 |
| 1527 Int32x4 operator[](int index) { | 1532 Int32x4 operator[](int index) { |
| 1528 if (index < 0 || index >= length) { | 1533 if (index < 0 || index >= length) { |
| 1529 throw new RangeError.index(index, this, "index"); | 1534 throw _newRangeError(index, length); |
| 1530 } | 1535 } |
| 1531 return _getIndexedInt32x4(index); | 1536 return _getIndexedInt32x4(index); |
| 1532 } | 1537 } |
| 1533 | 1538 |
| 1534 void operator[]=(int index, Int32x4 value) { | 1539 void operator[]=(int index, Int32x4 value) { |
| 1535 if (index < 0 || index >= length) { | 1540 if (index < 0 || index >= length) { |
| 1536 throw new RangeError.index(index, this, "index"); | 1541 throw _newRangeError(index, length); |
| 1537 } | 1542 } |
| 1538 _setIndexedInt32x4(index, value); | 1543 _setIndexedInt32x4(index, value); |
| 1539 } | 1544 } |
| 1540 | 1545 |
| 1541 | 1546 |
| 1542 // Method(s) implementing the TypedData interface. | 1547 // Method(s) implementing the TypedData interface. |
| 1543 | 1548 |
| 1544 int get elementSizeInBytes { | 1549 int get elementSizeInBytes { |
| 1545 return Int32x4List.BYTES_PER_ELEMENT; | 1550 return Int32x4List.BYTES_PER_ELEMENT; |
| 1546 } | 1551 } |
| (...skipping 20 matching lines...) Expand all Loading... |
| 1567 class _Float64x2Array extends _TypedList with _Float64x2ListMixin implements Flo
at64x2List { | 1572 class _Float64x2Array extends _TypedList with _Float64x2ListMixin implements Flo
at64x2List { |
| 1568 // Factory constructors. | 1573 // Factory constructors. |
| 1569 | 1574 |
| 1570 factory _Float64x2Array(int length) { | 1575 factory _Float64x2Array(int length) { |
| 1571 return _new(length); | 1576 return _new(length); |
| 1572 } | 1577 } |
| 1573 | 1578 |
| 1574 | 1579 |
| 1575 Float64x2 operator[](int index) { | 1580 Float64x2 operator[](int index) { |
| 1576 if (index < 0 || index >= length) { | 1581 if (index < 0 || index >= length) { |
| 1577 throw new RangeError.index(index, this, "index"); | 1582 throw _newRangeError(index, length); |
| 1578 } | 1583 } |
| 1579 return _getIndexedFloat64x2(index); | 1584 return _getIndexedFloat64x2(index); |
| 1580 } | 1585 } |
| 1581 | 1586 |
| 1582 void operator[]=(int index, Float64x2 value) { | 1587 void operator[]=(int index, Float64x2 value) { |
| 1583 if (index < 0 || index >= length) { | 1588 if (index < 0 || index >= length) { |
| 1584 throw new RangeError.index(index, this, "index"); | 1589 throw _newRangeError(index, length); |
| 1585 } | 1590 } |
| 1586 _setIndexedFloat64x2(index, value); | 1591 _setIndexedFloat64x2(index, value); |
| 1587 } | 1592 } |
| 1588 | 1593 |
| 1589 | 1594 |
| 1590 // Method(s) implementing the TypedData interface. | 1595 // Method(s) implementing the TypedData interface. |
| 1591 | 1596 |
| 1592 int get elementSizeInBytes { | 1597 int get elementSizeInBytes { |
| 1593 return Float64x2List.BYTES_PER_ELEMENT; | 1598 return Float64x2List.BYTES_PER_ELEMENT; |
| 1594 } | 1599 } |
| (...skipping 21 matching lines...) Expand all Loading... |
| 1616 // Factory constructors. | 1621 // Factory constructors. |
| 1617 | 1622 |
| 1618 factory _ExternalInt8Array(int length) { | 1623 factory _ExternalInt8Array(int length) { |
| 1619 return _new(length); | 1624 return _new(length); |
| 1620 } | 1625 } |
| 1621 | 1626 |
| 1622 | 1627 |
| 1623 // Method(s) implementing the List interface. | 1628 // Method(s) implementing the List interface. |
| 1624 int operator[](int index) { | 1629 int operator[](int index) { |
| 1625 if (index < 0 || index >= length) { | 1630 if (index < 0 || index >= length) { |
| 1626 throw new RangeError.index(index, this, "index"); | 1631 throw _newRangeError(index, length); |
| 1627 } | 1632 } |
| 1628 return _getInt8(index); | 1633 return _getInt8(index); |
| 1629 } | 1634 } |
| 1630 | 1635 |
| 1631 void operator[]=(int index, int value) { | 1636 void operator[]=(int index, int value) { |
| 1632 if (index < 0 || index >= length) { | 1637 if (index < 0 || index >= length) { |
| 1633 throw new RangeError.index(index, this, "index"); | 1638 throw _newRangeError(index, length); |
| 1634 } | 1639 } |
| 1635 _setInt8(index, value); | 1640 _setInt8(index, value); |
| 1636 } | 1641 } |
| 1637 | 1642 |
| 1638 | 1643 |
| 1639 // Method(s) implementing the TypedData interface. | 1644 // Method(s) implementing the TypedData interface. |
| 1640 | 1645 |
| 1641 int get elementSizeInBytes { | 1646 int get elementSizeInBytes { |
| 1642 return Int8List.BYTES_PER_ELEMENT; | 1647 return Int8List.BYTES_PER_ELEMENT; |
| 1643 } | 1648 } |
| (...skipping 15 matching lines...) Expand all Loading... |
| 1659 | 1664 |
| 1660 factory _ExternalUint8Array(int length) { | 1665 factory _ExternalUint8Array(int length) { |
| 1661 return _new(length); | 1666 return _new(length); |
| 1662 } | 1667 } |
| 1663 | 1668 |
| 1664 | 1669 |
| 1665 // Method(s) implementing the List interface. | 1670 // Method(s) implementing the List interface. |
| 1666 | 1671 |
| 1667 int operator[](int index) { | 1672 int operator[](int index) { |
| 1668 if (index < 0 || index >= length) { | 1673 if (index < 0 || index >= length) { |
| 1669 throw new RangeError.index(index, this, "index"); | 1674 throw _newRangeError(index, length); |
| 1670 } | 1675 } |
| 1671 return _getUint8(index); | 1676 return _getUint8(index); |
| 1672 } | 1677 } |
| 1673 | 1678 |
| 1674 void operator[]=(int index, int value) { | 1679 void operator[]=(int index, int value) { |
| 1675 if (index < 0 || index >= length) { | 1680 if (index < 0 || index >= length) { |
| 1676 throw new RangeError.index(index, this, "index"); | 1681 throw _newRangeError(index, length); |
| 1677 } | 1682 } |
| 1678 _setUint8(index, _toUint8(value)); | 1683 _setUint8(index, _toUint8(value)); |
| 1679 } | 1684 } |
| 1680 | 1685 |
| 1681 | 1686 |
| 1682 // Method(s) implementing the TypedData interface. | 1687 // Method(s) implementing the TypedData interface. |
| 1683 | 1688 |
| 1684 int get elementSizeInBytes { | 1689 int get elementSizeInBytes { |
| 1685 return Uint8List.BYTES_PER_ELEMENT; | 1690 return Uint8List.BYTES_PER_ELEMENT; |
| 1686 } | 1691 } |
| (...skipping 14 matching lines...) Expand all Loading... |
| 1701 // Factory constructors. | 1706 // Factory constructors. |
| 1702 | 1707 |
| 1703 factory _ExternalUint8ClampedArray(int length) { | 1708 factory _ExternalUint8ClampedArray(int length) { |
| 1704 return _new(length); | 1709 return _new(length); |
| 1705 } | 1710 } |
| 1706 | 1711 |
| 1707 // Method(s) implementing the List interface. | 1712 // Method(s) implementing the List interface. |
| 1708 | 1713 |
| 1709 int operator[](int index) { | 1714 int operator[](int index) { |
| 1710 if (index < 0 || index >= length) { | 1715 if (index < 0 || index >= length) { |
| 1711 throw new RangeError.index(index, this, "index"); | 1716 throw _newRangeError(index, length); |
| 1712 } | 1717 } |
| 1713 return _getUint8(index); | 1718 return _getUint8(index); |
| 1714 } | 1719 } |
| 1715 | 1720 |
| 1716 void operator[]=(int index, int value) { | 1721 void operator[]=(int index, int value) { |
| 1717 if (index < 0 || index >= length) { | 1722 if (index < 0 || index >= length) { |
| 1718 throw new RangeError.index(index, this, "index"); | 1723 throw _newRangeError(index, length); |
| 1719 } | 1724 } |
| 1720 _setUint8(index, _toClampedUint8(value)); | 1725 _setUint8(index, _toClampedUint8(value)); |
| 1721 } | 1726 } |
| 1722 | 1727 |
| 1723 | 1728 |
| 1724 // Method(s) implementing the TypedData interface. | 1729 // Method(s) implementing the TypedData interface. |
| 1725 | 1730 |
| 1726 int get elementSizeInBytes { | 1731 int get elementSizeInBytes { |
| 1727 return Uint8List.BYTES_PER_ELEMENT; | 1732 return Uint8List.BYTES_PER_ELEMENT; |
| 1728 } | 1733 } |
| (...skipping 15 matching lines...) Expand all Loading... |
| 1744 | 1749 |
| 1745 factory _ExternalInt16Array(int length) { | 1750 factory _ExternalInt16Array(int length) { |
| 1746 return _new(length); | 1751 return _new(length); |
| 1747 } | 1752 } |
| 1748 | 1753 |
| 1749 | 1754 |
| 1750 // Method(s) implementing the List interface. | 1755 // Method(s) implementing the List interface. |
| 1751 | 1756 |
| 1752 int operator[](int index) { | 1757 int operator[](int index) { |
| 1753 if (index < 0 || index >= length) { | 1758 if (index < 0 || index >= length) { |
| 1754 throw new RangeError.index(index, this, "index"); | 1759 throw _newRangeError(index, length); |
| 1755 } | 1760 } |
| 1756 return _getIndexedInt16(index); | 1761 return _getIndexedInt16(index); |
| 1757 } | 1762 } |
| 1758 | 1763 |
| 1759 void operator[]=(int index, int value) { | 1764 void operator[]=(int index, int value) { |
| 1760 if (index < 0 || index >= length) { | 1765 if (index < 0 || index >= length) { |
| 1761 throw new RangeError.index(index, this, "index"); | 1766 throw _newRangeError(index, length); |
| 1762 } | 1767 } |
| 1763 _setIndexedInt16(index, _toInt16(value)); | 1768 _setIndexedInt16(index, _toInt16(value)); |
| 1764 } | 1769 } |
| 1765 | 1770 |
| 1766 | 1771 |
| 1767 // Method(s) implementing the TypedData interface. | 1772 // Method(s) implementing the TypedData interface. |
| 1768 | 1773 |
| 1769 int get elementSizeInBytes { | 1774 int get elementSizeInBytes { |
| 1770 return Int16List.BYTES_PER_ELEMENT; | 1775 return Int16List.BYTES_PER_ELEMENT; |
| 1771 } | 1776 } |
| (...skipping 23 matching lines...) Expand all Loading... |
| 1795 | 1800 |
| 1796 factory _ExternalUint16Array(int length) { | 1801 factory _ExternalUint16Array(int length) { |
| 1797 return _new(length); | 1802 return _new(length); |
| 1798 } | 1803 } |
| 1799 | 1804 |
| 1800 | 1805 |
| 1801 // Method(s) implementing the List interface. | 1806 // Method(s) implementing the List interface. |
| 1802 | 1807 |
| 1803 int operator[](int index) { | 1808 int operator[](int index) { |
| 1804 if (index < 0 || index >= length) { | 1809 if (index < 0 || index >= length) { |
| 1805 throw new RangeError.index(index, this, "index"); | 1810 throw _newRangeError(index, length); |
| 1806 } | 1811 } |
| 1807 return _getIndexedUint16(index); | 1812 return _getIndexedUint16(index); |
| 1808 } | 1813 } |
| 1809 | 1814 |
| 1810 void operator[]=(int index, int value) { | 1815 void operator[]=(int index, int value) { |
| 1811 if (index < 0 || index >= length) { | 1816 if (index < 0 || index >= length) { |
| 1812 throw new RangeError.index(index, this, "index"); | 1817 throw _newRangeError(index, length); |
| 1813 } | 1818 } |
| 1814 _setIndexedUint16(index, _toUint16(value)); | 1819 _setIndexedUint16(index, _toUint16(value)); |
| 1815 } | 1820 } |
| 1816 | 1821 |
| 1817 | 1822 |
| 1818 // Method(s) implementing the TypedData interface. | 1823 // Method(s) implementing the TypedData interface. |
| 1819 | 1824 |
| 1820 int get elementSizeInBytes { | 1825 int get elementSizeInBytes { |
| 1821 return Uint16List.BYTES_PER_ELEMENT; | 1826 return Uint16List.BYTES_PER_ELEMENT; |
| 1822 } | 1827 } |
| (...skipping 23 matching lines...) Expand all Loading... |
| 1846 | 1851 |
| 1847 factory _ExternalInt32Array(int length) { | 1852 factory _ExternalInt32Array(int length) { |
| 1848 return _new(length); | 1853 return _new(length); |
| 1849 } | 1854 } |
| 1850 | 1855 |
| 1851 | 1856 |
| 1852 // Method(s) implementing the List interface. | 1857 // Method(s) implementing the List interface. |
| 1853 | 1858 |
| 1854 int operator[](int index) { | 1859 int operator[](int index) { |
| 1855 if (index < 0 || index >= length) { | 1860 if (index < 0 || index >= length) { |
| 1856 throw new RangeError.index(index, this, "index"); | 1861 throw _newRangeError(index, length); |
| 1857 } | 1862 } |
| 1858 return _getIndexedInt32(index); | 1863 return _getIndexedInt32(index); |
| 1859 } | 1864 } |
| 1860 | 1865 |
| 1861 void operator[]=(int index, int value) { | 1866 void operator[]=(int index, int value) { |
| 1862 if (index < 0 || index >= length) { | 1867 if (index < 0 || index >= length) { |
| 1863 throw new RangeError.index(index, this, "index"); | 1868 throw _newRangeError(index, length); |
| 1864 } | 1869 } |
| 1865 _setIndexedInt32(index, _toInt32(value)); | 1870 _setIndexedInt32(index, _toInt32(value)); |
| 1866 } | 1871 } |
| 1867 | 1872 |
| 1868 | 1873 |
| 1869 // Method(s) implementing the TypedData interface. | 1874 // Method(s) implementing the TypedData interface. |
| 1870 | 1875 |
| 1871 int get elementSizeInBytes { | 1876 int get elementSizeInBytes { |
| 1872 return Int32List.BYTES_PER_ELEMENT; | 1877 return Int32List.BYTES_PER_ELEMENT; |
| 1873 } | 1878 } |
| (...skipping 23 matching lines...) Expand all Loading... |
| 1897 | 1902 |
| 1898 factory _ExternalUint32Array(int length) { | 1903 factory _ExternalUint32Array(int length) { |
| 1899 return _new(length); | 1904 return _new(length); |
| 1900 } | 1905 } |
| 1901 | 1906 |
| 1902 | 1907 |
| 1903 // Method(s) implementing the List interface. | 1908 // Method(s) implementing the List interface. |
| 1904 | 1909 |
| 1905 int operator[](int index) { | 1910 int operator[](int index) { |
| 1906 if (index < 0 || index >= length) { | 1911 if (index < 0 || index >= length) { |
| 1907 throw new RangeError.index(index, this, "index"); | 1912 throw _newRangeError(index, length); |
| 1908 } | 1913 } |
| 1909 return _getIndexedUint32(index); | 1914 return _getIndexedUint32(index); |
| 1910 } | 1915 } |
| 1911 | 1916 |
| 1912 void operator[]=(int index, int value) { | 1917 void operator[]=(int index, int value) { |
| 1913 if (index < 0 || index >= length) { | 1918 if (index < 0 || index >= length) { |
| 1914 throw new RangeError.index(index, this, "index"); | 1919 throw _newRangeError(index, length); |
| 1915 } | 1920 } |
| 1916 _setIndexedUint32(index, _toUint32(value)); | 1921 _setIndexedUint32(index, _toUint32(value)); |
| 1917 } | 1922 } |
| 1918 | 1923 |
| 1919 | 1924 |
| 1920 // Method(s) implementing the TypedData interface. | 1925 // Method(s) implementing the TypedData interface. |
| 1921 | 1926 |
| 1922 int get elementSizeInBytes { | 1927 int get elementSizeInBytes { |
| 1923 return Uint32List.BYTES_PER_ELEMENT; | 1928 return Uint32List.BYTES_PER_ELEMENT; |
| 1924 } | 1929 } |
| (...skipping 23 matching lines...) Expand all Loading... |
| 1948 | 1953 |
| 1949 factory _ExternalInt64Array(int length) { | 1954 factory _ExternalInt64Array(int length) { |
| 1950 return _new(length); | 1955 return _new(length); |
| 1951 } | 1956 } |
| 1952 | 1957 |
| 1953 | 1958 |
| 1954 // Method(s) implementing the List interface. | 1959 // Method(s) implementing the List interface. |
| 1955 | 1960 |
| 1956 int operator[](int index) { | 1961 int operator[](int index) { |
| 1957 if (index < 0 || index >= length) { | 1962 if (index < 0 || index >= length) { |
| 1958 throw new RangeError.index(index, this, "index"); | 1963 throw _newRangeError(index, length); |
| 1959 } | 1964 } |
| 1960 return _getIndexedInt64(index); | 1965 return _getIndexedInt64(index); |
| 1961 } | 1966 } |
| 1962 | 1967 |
| 1963 void operator[]=(int index, int value) { | 1968 void operator[]=(int index, int value) { |
| 1964 if (index < 0 || index >= length) { | 1969 if (index < 0 || index >= length) { |
| 1965 throw new RangeError.index(index, this, "index"); | 1970 throw _newRangeError(index, length); |
| 1966 } | 1971 } |
| 1967 _setIndexedInt64(index, _toInt64(value)); | 1972 _setIndexedInt64(index, _toInt64(value)); |
| 1968 } | 1973 } |
| 1969 | 1974 |
| 1970 | 1975 |
| 1971 // Method(s) implementing the TypedData interface. | 1976 // Method(s) implementing the TypedData interface. |
| 1972 | 1977 |
| 1973 int get elementSizeInBytes { | 1978 int get elementSizeInBytes { |
| 1974 return Int64List.BYTES_PER_ELEMENT; | 1979 return Int64List.BYTES_PER_ELEMENT; |
| 1975 } | 1980 } |
| (...skipping 23 matching lines...) Expand all Loading... |
| 1999 | 2004 |
| 2000 factory _ExternalUint64Array(int length) { | 2005 factory _ExternalUint64Array(int length) { |
| 2001 return _new(length); | 2006 return _new(length); |
| 2002 } | 2007 } |
| 2003 | 2008 |
| 2004 | 2009 |
| 2005 // Method(s) implementing the List interface. | 2010 // Method(s) implementing the List interface. |
| 2006 | 2011 |
| 2007 int operator[](int index) { | 2012 int operator[](int index) { |
| 2008 if (index < 0 || index >= length) { | 2013 if (index < 0 || index >= length) { |
| 2009 throw new RangeError.index(index, this, "index"); | 2014 throw _newRangeError(index, length); |
| 2010 } | 2015 } |
| 2011 return _getIndexedUint64(index); | 2016 return _getIndexedUint64(index); |
| 2012 } | 2017 } |
| 2013 | 2018 |
| 2014 void operator[]=(int index, int value) { | 2019 void operator[]=(int index, int value) { |
| 2015 if (index < 0 || index >= length) { | 2020 if (index < 0 || index >= length) { |
| 2016 throw new RangeError.index(index, this, "index"); | 2021 throw _newRangeError(index, length); |
| 2017 } | 2022 } |
| 2018 _setIndexedUint64(index, _toUint64(value)); | 2023 _setIndexedUint64(index, _toUint64(value)); |
| 2019 } | 2024 } |
| 2020 | 2025 |
| 2021 | 2026 |
| 2022 // Method(s) implementing the TypedData interface. | 2027 // Method(s) implementing the TypedData interface. |
| 2023 | 2028 |
| 2024 int get elementSizeInBytes { | 2029 int get elementSizeInBytes { |
| 2025 return Uint64List.BYTES_PER_ELEMENT; | 2030 return Uint64List.BYTES_PER_ELEMENT; |
| 2026 } | 2031 } |
| (...skipping 23 matching lines...) Expand all Loading... |
| 2050 | 2055 |
| 2051 factory _ExternalFloat32Array(int length) { | 2056 factory _ExternalFloat32Array(int length) { |
| 2052 return _new(length); | 2057 return _new(length); |
| 2053 } | 2058 } |
| 2054 | 2059 |
| 2055 | 2060 |
| 2056 // Method(s) implementing the List interface. | 2061 // Method(s) implementing the List interface. |
| 2057 | 2062 |
| 2058 double operator[](int index) { | 2063 double operator[](int index) { |
| 2059 if (index < 0 || index >= length) { | 2064 if (index < 0 || index >= length) { |
| 2060 throw new RangeError.index(index, this, "index"); | 2065 throw _newRangeError(index, length); |
| 2061 } | 2066 } |
| 2062 return _getIndexedFloat32(index); | 2067 return _getIndexedFloat32(index); |
| 2063 } | 2068 } |
| 2064 | 2069 |
| 2065 void operator[]=(int index, double value) { | 2070 void operator[]=(int index, double value) { |
| 2066 if (index < 0 || index >= length) { | 2071 if (index < 0 || index >= length) { |
| 2067 throw new RangeError.index(index, this, "index"); | 2072 throw _newRangeError(index, length); |
| 2068 } | 2073 } |
| 2069 _setIndexedFloat32(index, value); | 2074 _setIndexedFloat32(index, value); |
| 2070 } | 2075 } |
| 2071 | 2076 |
| 2072 | 2077 |
| 2073 // Method(s) implementing the TypedData interface. | 2078 // Method(s) implementing the TypedData interface. |
| 2074 | 2079 |
| 2075 int get elementSizeInBytes { | 2080 int get elementSizeInBytes { |
| 2076 return Float32List.BYTES_PER_ELEMENT; | 2081 return Float32List.BYTES_PER_ELEMENT; |
| 2077 } | 2082 } |
| (...skipping 23 matching lines...) Expand all Loading... |
| 2101 | 2106 |
| 2102 factory _ExternalFloat64Array(int length) { | 2107 factory _ExternalFloat64Array(int length) { |
| 2103 return _new(length); | 2108 return _new(length); |
| 2104 } | 2109 } |
| 2105 | 2110 |
| 2106 | 2111 |
| 2107 // Method(s) implementing the List interface. | 2112 // Method(s) implementing the List interface. |
| 2108 | 2113 |
| 2109 double operator[](int index) { | 2114 double operator[](int index) { |
| 2110 if (index < 0 || index >= length) { | 2115 if (index < 0 || index >= length) { |
| 2111 throw new RangeError.index(index, this, "index"); | 2116 throw _newRangeError(index, length); |
| 2112 } | 2117 } |
| 2113 return _getIndexedFloat64(index); | 2118 return _getIndexedFloat64(index); |
| 2114 } | 2119 } |
| 2115 | 2120 |
| 2116 void operator[]=(int index, double value) { | 2121 void operator[]=(int index, double value) { |
| 2117 if (index < 0 || index >= length) { | 2122 if (index < 0 || index >= length) { |
| 2118 throw new RangeError.index(index, this, "index"); | 2123 throw _newRangeError(index, length); |
| 2119 } | 2124 } |
| 2120 _setIndexedFloat64(index, value); | 2125 _setIndexedFloat64(index, value); |
| 2121 } | 2126 } |
| 2122 | 2127 |
| 2123 | 2128 |
| 2124 // Method(s) implementing the TypedData interface. | 2129 // Method(s) implementing the TypedData interface. |
| 2125 | 2130 |
| 2126 int get elementSizeInBytes { | 2131 int get elementSizeInBytes { |
| 2127 return Float64List.BYTES_PER_ELEMENT; | 2132 return Float64List.BYTES_PER_ELEMENT; |
| 2128 } | 2133 } |
| (...skipping 23 matching lines...) Expand all Loading... |
| 2152 | 2157 |
| 2153 factory _ExternalFloat32x4Array(int length) { | 2158 factory _ExternalFloat32x4Array(int length) { |
| 2154 return _new(length); | 2159 return _new(length); |
| 2155 } | 2160 } |
| 2156 | 2161 |
| 2157 | 2162 |
| 2158 // Method(s) implementing the List interface. | 2163 // Method(s) implementing the List interface. |
| 2159 | 2164 |
| 2160 Float32x4 operator[](int index) { | 2165 Float32x4 operator[](int index) { |
| 2161 if (index < 0 || index >= length) { | 2166 if (index < 0 || index >= length) { |
| 2162 throw new RangeError.index(index, this, "index"); | 2167 throw _newRangeError(index, length); |
| 2163 } | 2168 } |
| 2164 return _getIndexedFloat32x4(index); | 2169 return _getIndexedFloat32x4(index); |
| 2165 } | 2170 } |
| 2166 | 2171 |
| 2167 void operator[]=(int index, Float32x4 value) { | 2172 void operator[]=(int index, Float32x4 value) { |
| 2168 if (index < 0 || index >= length) { | 2173 if (index < 0 || index >= length) { |
| 2169 throw new RangeError.index(index, this, "index"); | 2174 throw _newRangeError(index, length); |
| 2170 } | 2175 } |
| 2171 _setIndexedFloat32x4(index, value); | 2176 _setIndexedFloat32x4(index, value); |
| 2172 } | 2177 } |
| 2173 | 2178 |
| 2174 | 2179 |
| 2175 // Method(s) implementing the TypedData interface. | 2180 // Method(s) implementing the TypedData interface. |
| 2176 | 2181 |
| 2177 int get elementSizeInBytes { | 2182 int get elementSizeInBytes { |
| 2178 return Float32x4List.BYTES_PER_ELEMENT; | 2183 return Float32x4List.BYTES_PER_ELEMENT; |
| 2179 } | 2184 } |
| (...skipping 23 matching lines...) Expand all Loading... |
| 2203 | 2208 |
| 2204 factory _ExternalInt32x4Array(int length) { | 2209 factory _ExternalInt32x4Array(int length) { |
| 2205 return _new(length); | 2210 return _new(length); |
| 2206 } | 2211 } |
| 2207 | 2212 |
| 2208 | 2213 |
| 2209 // Method(s) implementing the List interface. | 2214 // Method(s) implementing the List interface. |
| 2210 | 2215 |
| 2211 Int32x4 operator[](int index) { | 2216 Int32x4 operator[](int index) { |
| 2212 if (index < 0 || index >= length) { | 2217 if (index < 0 || index >= length) { |
| 2213 throw new RangeError.index(index, this, "index"); | 2218 throw _newRangeError(index, length); |
| 2214 } | 2219 } |
| 2215 return _getIndexedInt32x4(index); | 2220 return _getIndexedInt32x4(index); |
| 2216 } | 2221 } |
| 2217 | 2222 |
| 2218 void operator[]=(int index, Int32x4 value) { | 2223 void operator[]=(int index, Int32x4 value) { |
| 2219 if (index < 0 || index >= length) { | 2224 if (index < 0 || index >= length) { |
| 2220 throw new RangeError.index(index, this, "index"); | 2225 throw _newRangeError(index, length); |
| 2221 } | 2226 } |
| 2222 _setIndexedInt32x4(index, value); | 2227 _setIndexedInt32x4(index, value); |
| 2223 } | 2228 } |
| 2224 | 2229 |
| 2225 | 2230 |
| 2226 // Method(s) implementing the TypedData interface. | 2231 // Method(s) implementing the TypedData interface. |
| 2227 | 2232 |
| 2228 int get elementSizeInBytes { | 2233 int get elementSizeInBytes { |
| 2229 return Int32x4List.BYTES_PER_ELEMENT; | 2234 return Int32x4List.BYTES_PER_ELEMENT; |
| 2230 } | 2235 } |
| (...skipping 23 matching lines...) Expand all Loading... |
| 2254 | 2259 |
| 2255 factory _ExternalFloat64x2Array(int length) { | 2260 factory _ExternalFloat64x2Array(int length) { |
| 2256 return _new(length); | 2261 return _new(length); |
| 2257 } | 2262 } |
| 2258 | 2263 |
| 2259 | 2264 |
| 2260 // Method(s) implementing the List interface. | 2265 // Method(s) implementing the List interface. |
| 2261 | 2266 |
| 2262 Float64x2 operator[](int index) { | 2267 Float64x2 operator[](int index) { |
| 2263 if (index < 0 || index >= length) { | 2268 if (index < 0 || index >= length) { |
| 2264 throw new RangeError.index(index, this, "index"); | 2269 throw _newRangeError(index, length); |
| 2265 } | 2270 } |
| 2266 return _getIndexedFloat64x2(index); | 2271 return _getIndexedFloat64x2(index); |
| 2267 } | 2272 } |
| 2268 | 2273 |
| 2269 void operator[]=(int index, Float64x2 value) { | 2274 void operator[]=(int index, Float64x2 value) { |
| 2270 if (index < 0 || index >= length) { | 2275 if (index < 0 || index >= length) { |
| 2271 throw new RangeError.index(index, this, "index"); | 2276 throw _newRangeError(index, length); |
| 2272 } | 2277 } |
| 2273 _setIndexedFloat64x2(index, value); | 2278 _setIndexedFloat64x2(index, value); |
| 2274 } | 2279 } |
| 2275 | 2280 |
| 2276 | 2281 |
| 2277 // Method(s) implementing the TypedData interface. | 2282 // Method(s) implementing the TypedData interface. |
| 2278 | 2283 |
| 2279 int get elementSizeInBytes { | 2284 int get elementSizeInBytes { |
| 2280 return Float64x2List.BYTES_PER_ELEMENT; | 2285 return Float64x2List.BYTES_PER_ELEMENT; |
| 2281 } | 2286 } |
| (...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2582 _rangeCheck(buffer.lengthInBytes, | 2587 _rangeCheck(buffer.lengthInBytes, |
| 2583 _offsetInBytes, | 2588 _offsetInBytes, |
| 2584 length * Int8List.BYTES_PER_ELEMENT); | 2589 length * Int8List.BYTES_PER_ELEMENT); |
| 2585 } | 2590 } |
| 2586 | 2591 |
| 2587 | 2592 |
| 2588 // Method(s) implementing List interface. | 2593 // Method(s) implementing List interface. |
| 2589 | 2594 |
| 2590 int operator[](int index) { | 2595 int operator[](int index) { |
| 2591 if (index < 0 || index >= length) { | 2596 if (index < 0 || index >= length) { |
| 2592 throw new RangeError.index(index, this, "index"); | 2597 throw _newRangeError(index, length); |
| 2593 } | 2598 } |
| 2594 return _typedData._getInt8(offsetInBytes + | 2599 return _typedData._getInt8(offsetInBytes + |
| 2595 (index * Int8List.BYTES_PER_ELEMENT)); | 2600 (index * Int8List.BYTES_PER_ELEMENT)); |
| 2596 } | 2601 } |
| 2597 | 2602 |
| 2598 void operator[]=(int index, int value) { | 2603 void operator[]=(int index, int value) { |
| 2599 if (index < 0 || index >= length) { | 2604 if (index < 0 || index >= length) { |
| 2600 throw new RangeError.index(index, this, "index"); | 2605 throw _newRangeError(index, length); |
| 2601 } | 2606 } |
| 2602 _typedData._setInt8(offsetInBytes + (index * Int8List.BYTES_PER_ELEMENT), | 2607 _typedData._setInt8(offsetInBytes + (index * Int8List.BYTES_PER_ELEMENT), |
| 2603 _toInt8(value)); | 2608 _toInt8(value)); |
| 2604 } | 2609 } |
| 2605 | 2610 |
| 2606 | 2611 |
| 2607 // Method(s) implementing TypedData interface. | 2612 // Method(s) implementing TypedData interface. |
| 2608 | 2613 |
| 2609 int get elementSizeInBytes { | 2614 int get elementSizeInBytes { |
| 2610 return Int8List.BYTES_PER_ELEMENT; | 2615 return Int8List.BYTES_PER_ELEMENT; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 2629 _rangeCheck(buffer.lengthInBytes, | 2634 _rangeCheck(buffer.lengthInBytes, |
| 2630 _offsetInBytes, | 2635 _offsetInBytes, |
| 2631 length * Uint8List.BYTES_PER_ELEMENT); | 2636 length * Uint8List.BYTES_PER_ELEMENT); |
| 2632 } | 2637 } |
| 2633 | 2638 |
| 2634 | 2639 |
| 2635 // Method(s) implementing List interface. | 2640 // Method(s) implementing List interface. |
| 2636 | 2641 |
| 2637 int operator[](int index) { | 2642 int operator[](int index) { |
| 2638 if (index < 0 || index >= length) { | 2643 if (index < 0 || index >= length) { |
| 2639 throw new RangeError.index(index, this, "index"); | 2644 throw _newRangeError(index, length); |
| 2640 } | 2645 } |
| 2641 return _typedData._getUint8(offsetInBytes + | 2646 return _typedData._getUint8(offsetInBytes + |
| 2642 (index * Uint8List.BYTES_PER_ELEMENT)); | 2647 (index * Uint8List.BYTES_PER_ELEMENT)); |
| 2643 } | 2648 } |
| 2644 | 2649 |
| 2645 void operator[]=(int index, int value) { | 2650 void operator[]=(int index, int value) { |
| 2646 if (index < 0 || index >= length) { | 2651 if (index < 0 || index >= length) { |
| 2647 throw new RangeError.index(index, this, "index"); | 2652 throw _newRangeError(index, length); |
| 2648 } | 2653 } |
| 2649 _typedData._setUint8(offsetInBytes + (index * Uint8List.BYTES_PER_ELEMENT), | 2654 _typedData._setUint8(offsetInBytes + (index * Uint8List.BYTES_PER_ELEMENT), |
| 2650 _toUint8(value)); | 2655 _toUint8(value)); |
| 2651 } | 2656 } |
| 2652 | 2657 |
| 2653 | 2658 |
| 2654 // Method(s) implementing TypedData interface. | 2659 // Method(s) implementing TypedData interface. |
| 2655 | 2660 |
| 2656 int get elementSizeInBytes { | 2661 int get elementSizeInBytes { |
| 2657 return Uint8List.BYTES_PER_ELEMENT; | 2662 return Uint8List.BYTES_PER_ELEMENT; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 2677 _rangeCheck(buffer.lengthInBytes, | 2682 _rangeCheck(buffer.lengthInBytes, |
| 2678 offsetInBytes, | 2683 offsetInBytes, |
| 2679 length * Uint8List.BYTES_PER_ELEMENT); | 2684 length * Uint8List.BYTES_PER_ELEMENT); |
| 2680 } | 2685 } |
| 2681 | 2686 |
| 2682 | 2687 |
| 2683 // Method(s) implementing List interface. | 2688 // Method(s) implementing List interface. |
| 2684 | 2689 |
| 2685 int operator[](int index) { | 2690 int operator[](int index) { |
| 2686 if (index < 0 || index >= length) { | 2691 if (index < 0 || index >= length) { |
| 2687 throw new RangeError.index(index, this, "index"); | 2692 throw _newRangeError(index, length); |
| 2688 } | 2693 } |
| 2689 return _typedData._getUint8(offsetInBytes + | 2694 return _typedData._getUint8(offsetInBytes + |
| 2690 (index * Uint8List.BYTES_PER_ELEMENT)); | 2695 (index * Uint8List.BYTES_PER_ELEMENT)); |
| 2691 } | 2696 } |
| 2692 | 2697 |
| 2693 void operator[]=(int index, int value) { | 2698 void operator[]=(int index, int value) { |
| 2694 if (index < 0 || index >= length) { | 2699 if (index < 0 || index >= length) { |
| 2695 throw new RangeError.index(index, this, "index"); | 2700 throw _newRangeError(index, length); |
| 2696 } | 2701 } |
| 2697 _typedData._setUint8(offsetInBytes + (index * Uint8List.BYTES_PER_ELEMENT), | 2702 _typedData._setUint8(offsetInBytes + (index * Uint8List.BYTES_PER_ELEMENT), |
| 2698 _toClampedUint8(value)); | 2703 _toClampedUint8(value)); |
| 2699 } | 2704 } |
| 2700 | 2705 |
| 2701 | 2706 |
| 2702 // Method(s) implementing TypedData interface. | 2707 // Method(s) implementing TypedData interface. |
| 2703 | 2708 |
| 2704 int get elementSizeInBytes { | 2709 int get elementSizeInBytes { |
| 2705 return Uint8List.BYTES_PER_ELEMENT; | 2710 return Uint8List.BYTES_PER_ELEMENT; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 2725 offsetInBytes, | 2730 offsetInBytes, |
| 2726 length * Int16List.BYTES_PER_ELEMENT); | 2731 length * Int16List.BYTES_PER_ELEMENT); |
| 2727 _offsetAlignmentCheck(_offsetInBytes, Int16List.BYTES_PER_ELEMENT); | 2732 _offsetAlignmentCheck(_offsetInBytes, Int16List.BYTES_PER_ELEMENT); |
| 2728 } | 2733 } |
| 2729 | 2734 |
| 2730 | 2735 |
| 2731 // Method(s) implementing List interface. | 2736 // Method(s) implementing List interface. |
| 2732 | 2737 |
| 2733 int operator[](int index) { | 2738 int operator[](int index) { |
| 2734 if (index < 0 || index >= length) { | 2739 if (index < 0 || index >= length) { |
| 2735 throw new RangeError.index(index, this, "index"); | 2740 throw _newRangeError(index, length); |
| 2736 } | 2741 } |
| 2737 return _typedData._getInt16(offsetInBytes + | 2742 return _typedData._getInt16(offsetInBytes + |
| 2738 (index * Int16List.BYTES_PER_ELEMENT)); | 2743 (index * Int16List.BYTES_PER_ELEMENT)); |
| 2739 } | 2744 } |
| 2740 | 2745 |
| 2741 void operator[]=(int index, int value) { | 2746 void operator[]=(int index, int value) { |
| 2742 if (index < 0 || index >= length) { | 2747 if (index < 0 || index >= length) { |
| 2743 throw new RangeError.index(index, this, "index"); | 2748 throw _newRangeError(index, length); |
| 2744 } | 2749 } |
| 2745 _typedData._setInt16(offsetInBytes + (index * Int16List.BYTES_PER_ELEMENT), | 2750 _typedData._setInt16(offsetInBytes + (index * Int16List.BYTES_PER_ELEMENT), |
| 2746 _toInt16(value)); | 2751 _toInt16(value)); |
| 2747 } | 2752 } |
| 2748 | 2753 |
| 2749 void setRange(int start, int end, Iterable iterable, [int skipCount = 0]) { | 2754 void setRange(int start, int end, Iterable iterable, [int skipCount = 0]) { |
| 2750 if (ClassID.getID(iterable) == CodeUnits.cid) { | 2755 if (ClassID.getID(iterable) == CodeUnits.cid) { |
| 2751 end = RangeError.checkValidRange(start, end, this.length); | 2756 end = RangeError.checkValidRange(start, end, this.length); |
| 2752 int length = end - start; | 2757 int length = end - start; |
| 2753 int byteStart = this.offsetInBytes + start * Int16List.BYTES_PER_ELEMENT; | 2758 int byteStart = this.offsetInBytes + start * Int16List.BYTES_PER_ELEMENT; |
| (...skipping 29 matching lines...) Expand all Loading... |
| 2783 offsetInBytes, | 2788 offsetInBytes, |
| 2784 length * Uint16List.BYTES_PER_ELEMENT); | 2789 length * Uint16List.BYTES_PER_ELEMENT); |
| 2785 _offsetAlignmentCheck(_offsetInBytes, Uint16List.BYTES_PER_ELEMENT); | 2790 _offsetAlignmentCheck(_offsetInBytes, Uint16List.BYTES_PER_ELEMENT); |
| 2786 } | 2791 } |
| 2787 | 2792 |
| 2788 | 2793 |
| 2789 // Method(s) implementing List interface. | 2794 // Method(s) implementing List interface. |
| 2790 | 2795 |
| 2791 int operator[](int index) { | 2796 int operator[](int index) { |
| 2792 if (index < 0 || index >= length) { | 2797 if (index < 0 || index >= length) { |
| 2793 throw new RangeError.index(index, this, "index"); | 2798 throw _newRangeError(index, length); |
| 2794 } | 2799 } |
| 2795 return _typedData._getUint16(offsetInBytes + | 2800 return _typedData._getUint16(offsetInBytes + |
| 2796 (index * Uint16List.BYTES_PER_ELEMENT)); | 2801 (index * Uint16List.BYTES_PER_ELEMENT)); |
| 2797 } | 2802 } |
| 2798 | 2803 |
| 2799 void operator[]=(int index, int value) { | 2804 void operator[]=(int index, int value) { |
| 2800 if (index < 0 || index >= length) { | 2805 if (index < 0 || index >= length) { |
| 2801 throw new RangeError.index(index, this, "index"); | 2806 throw _newRangeError(index, length); |
| 2802 } | 2807 } |
| 2803 _typedData._setUint16(offsetInBytes + (index * Uint16List.BYTES_PER_ELEMENT)
, | 2808 _typedData._setUint16(offsetInBytes + (index * Uint16List.BYTES_PER_ELEMENT)
, |
| 2804 _toUint16(value)); | 2809 _toUint16(value)); |
| 2805 } | 2810 } |
| 2806 | 2811 |
| 2807 void setRange(int start, int end, Iterable iterable, [int skipCount = 0]) { | 2812 void setRange(int start, int end, Iterable iterable, [int skipCount = 0]) { |
| 2808 if (ClassID.getID(iterable) == CodeUnits.cid) { | 2813 if (ClassID.getID(iterable) == CodeUnits.cid) { |
| 2809 end = RangeError.checkValidRange(start, end, this.length); | 2814 end = RangeError.checkValidRange(start, end, this.length); |
| 2810 int length = end - start; | 2815 int length = end - start; |
| 2811 int byteStart = this.offsetInBytes + start * Uint16List.BYTES_PER_ELEMENT; | 2816 int byteStart = this.offsetInBytes + start * Uint16List.BYTES_PER_ELEMENT; |
| (...skipping 28 matching lines...) Expand all Loading... |
| 2840 offsetInBytes, | 2845 offsetInBytes, |
| 2841 length * Int32List.BYTES_PER_ELEMENT); | 2846 length * Int32List.BYTES_PER_ELEMENT); |
| 2842 _offsetAlignmentCheck(_offsetInBytes, Int32List.BYTES_PER_ELEMENT); | 2847 _offsetAlignmentCheck(_offsetInBytes, Int32List.BYTES_PER_ELEMENT); |
| 2843 } | 2848 } |
| 2844 | 2849 |
| 2845 | 2850 |
| 2846 // Method(s) implementing List interface. | 2851 // Method(s) implementing List interface. |
| 2847 | 2852 |
| 2848 int operator[](int index) { | 2853 int operator[](int index) { |
| 2849 if (index < 0 || index >= length) { | 2854 if (index < 0 || index >= length) { |
| 2850 throw new RangeError.index(index, this, "index"); | 2855 throw _newRangeError(index, length); |
| 2851 } | 2856 } |
| 2852 return _typedData._getInt32(offsetInBytes + | 2857 return _typedData._getInt32(offsetInBytes + |
| 2853 (index * Int32List.BYTES_PER_ELEMENT)); | 2858 (index * Int32List.BYTES_PER_ELEMENT)); |
| 2854 } | 2859 } |
| 2855 | 2860 |
| 2856 void operator[]=(int index, int value) { | 2861 void operator[]=(int index, int value) { |
| 2857 if (index < 0 || index >= length) { | 2862 if (index < 0 || index >= length) { |
| 2858 throw new RangeError.index(index, this, "index"); | 2863 throw _newRangeError(index, length); |
| 2859 } | 2864 } |
| 2860 _typedData._setInt32(offsetInBytes + (index * Int32List.BYTES_PER_ELEMENT), | 2865 _typedData._setInt32(offsetInBytes + (index * Int32List.BYTES_PER_ELEMENT), |
| 2861 _toInt32(value)); | 2866 _toInt32(value)); |
| 2862 } | 2867 } |
| 2863 | 2868 |
| 2864 | 2869 |
| 2865 // Method(s) implementing TypedData interface. | 2870 // Method(s) implementing TypedData interface. |
| 2866 | 2871 |
| 2867 int get elementSizeInBytes { | 2872 int get elementSizeInBytes { |
| 2868 return Int32List.BYTES_PER_ELEMENT; | 2873 return Int32List.BYTES_PER_ELEMENT; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 2888 offsetInBytes, | 2893 offsetInBytes, |
| 2889 length * Uint32List.BYTES_PER_ELEMENT); | 2894 length * Uint32List.BYTES_PER_ELEMENT); |
| 2890 _offsetAlignmentCheck(_offsetInBytes, Uint32List.BYTES_PER_ELEMENT); | 2895 _offsetAlignmentCheck(_offsetInBytes, Uint32List.BYTES_PER_ELEMENT); |
| 2891 } | 2896 } |
| 2892 | 2897 |
| 2893 | 2898 |
| 2894 // Method(s) implementing List interface. | 2899 // Method(s) implementing List interface. |
| 2895 | 2900 |
| 2896 int operator[](int index) { | 2901 int operator[](int index) { |
| 2897 if (index < 0 || index >= length) { | 2902 if (index < 0 || index >= length) { |
| 2898 throw new RangeError.index(index, this, "index"); | 2903 throw _newRangeError(index, length); |
| 2899 } | 2904 } |
| 2900 return _typedData._getUint32(offsetInBytes + | 2905 return _typedData._getUint32(offsetInBytes + |
| 2901 (index * Uint32List.BYTES_PER_ELEMENT)); | 2906 (index * Uint32List.BYTES_PER_ELEMENT)); |
| 2902 } | 2907 } |
| 2903 | 2908 |
| 2904 void operator[]=(int index, int value) { | 2909 void operator[]=(int index, int value) { |
| 2905 if (index < 0 || index >= length) { | 2910 if (index < 0 || index >= length) { |
| 2906 throw new RangeError.index(index, this, "index"); | 2911 throw _newRangeError(index, length); |
| 2907 } | 2912 } |
| 2908 _typedData._setUint32(offsetInBytes + (index * Uint32List.BYTES_PER_ELEMENT)
, | 2913 _typedData._setUint32(offsetInBytes + (index * Uint32List.BYTES_PER_ELEMENT)
, |
| 2909 _toUint32(value)); | 2914 _toUint32(value)); |
| 2910 } | 2915 } |
| 2911 | 2916 |
| 2912 | 2917 |
| 2913 // Method(s) implementing TypedData interface. | 2918 // Method(s) implementing TypedData interface. |
| 2914 | 2919 |
| 2915 int get elementSizeInBytes { | 2920 int get elementSizeInBytes { |
| 2916 return Uint32List.BYTES_PER_ELEMENT; | 2921 return Uint32List.BYTES_PER_ELEMENT; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 2936 offsetInBytes, | 2941 offsetInBytes, |
| 2937 length * Int64List.BYTES_PER_ELEMENT); | 2942 length * Int64List.BYTES_PER_ELEMENT); |
| 2938 _offsetAlignmentCheck(_offsetInBytes, Int64List.BYTES_PER_ELEMENT); | 2943 _offsetAlignmentCheck(_offsetInBytes, Int64List.BYTES_PER_ELEMENT); |
| 2939 } | 2944 } |
| 2940 | 2945 |
| 2941 | 2946 |
| 2942 // Method(s) implementing List interface. | 2947 // Method(s) implementing List interface. |
| 2943 | 2948 |
| 2944 int operator[](int index) { | 2949 int operator[](int index) { |
| 2945 if (index < 0 || index >= length) { | 2950 if (index < 0 || index >= length) { |
| 2946 throw new RangeError.index(index, this, "index"); | 2951 throw _newRangeError(index, length); |
| 2947 } | 2952 } |
| 2948 return _typedData._getInt64(offsetInBytes + | 2953 return _typedData._getInt64(offsetInBytes + |
| 2949 (index * Int64List.BYTES_PER_ELEMENT)); | 2954 (index * Int64List.BYTES_PER_ELEMENT)); |
| 2950 } | 2955 } |
| 2951 | 2956 |
| 2952 void operator[]=(int index, int value) { | 2957 void operator[]=(int index, int value) { |
| 2953 if (index < 0 || index >= length) { | 2958 if (index < 0 || index >= length) { |
| 2954 throw new RangeError.index(index, this, "index"); | 2959 throw _newRangeError(index, length); |
| 2955 } | 2960 } |
| 2956 _typedData._setInt64(offsetInBytes + (index * Int64List.BYTES_PER_ELEMENT), | 2961 _typedData._setInt64(offsetInBytes + (index * Int64List.BYTES_PER_ELEMENT), |
| 2957 _toInt64(value)); | 2962 _toInt64(value)); |
| 2958 } | 2963 } |
| 2959 | 2964 |
| 2960 | 2965 |
| 2961 // Method(s) implementing TypedData interface. | 2966 // Method(s) implementing TypedData interface. |
| 2962 | 2967 |
| 2963 int get elementSizeInBytes { | 2968 int get elementSizeInBytes { |
| 2964 return Int64List.BYTES_PER_ELEMENT; | 2969 return Int64List.BYTES_PER_ELEMENT; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 2984 offsetInBytes, | 2989 offsetInBytes, |
| 2985 length * Uint64List.BYTES_PER_ELEMENT); | 2990 length * Uint64List.BYTES_PER_ELEMENT); |
| 2986 _offsetAlignmentCheck(_offsetInBytes, Uint64List.BYTES_PER_ELEMENT); | 2991 _offsetAlignmentCheck(_offsetInBytes, Uint64List.BYTES_PER_ELEMENT); |
| 2987 } | 2992 } |
| 2988 | 2993 |
| 2989 | 2994 |
| 2990 // Method(s) implementing List interface. | 2995 // Method(s) implementing List interface. |
| 2991 | 2996 |
| 2992 int operator[](int index) { | 2997 int operator[](int index) { |
| 2993 if (index < 0 || index >= length) { | 2998 if (index < 0 || index >= length) { |
| 2994 throw new RangeError.index(index, this, "index"); | 2999 throw _newRangeError(index, length); |
| 2995 } | 3000 } |
| 2996 return _typedData._getUint64(offsetInBytes + | 3001 return _typedData._getUint64(offsetInBytes + |
| 2997 (index * Uint64List.BYTES_PER_ELEMENT)); | 3002 (index * Uint64List.BYTES_PER_ELEMENT)); |
| 2998 } | 3003 } |
| 2999 | 3004 |
| 3000 void operator[]=(int index, int value) { | 3005 void operator[]=(int index, int value) { |
| 3001 if (index < 0 || index >= length) { | 3006 if (index < 0 || index >= length) { |
| 3002 throw new RangeError.index(index, this, "index"); | 3007 throw _newRangeError(index, length); |
| 3003 } | 3008 } |
| 3004 _typedData._setUint64(offsetInBytes + (index * Uint64List.BYTES_PER_ELEMENT)
, | 3009 _typedData._setUint64(offsetInBytes + (index * Uint64List.BYTES_PER_ELEMENT)
, |
| 3005 _toUint64(value)); | 3010 _toUint64(value)); |
| 3006 } | 3011 } |
| 3007 | 3012 |
| 3008 | 3013 |
| 3009 // Method(s) implementing TypedData interface. | 3014 // Method(s) implementing TypedData interface. |
| 3010 | 3015 |
| 3011 int get elementSizeInBytes { | 3016 int get elementSizeInBytes { |
| 3012 return Uint64List.BYTES_PER_ELEMENT; | 3017 return Uint64List.BYTES_PER_ELEMENT; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 3032 offsetInBytes, | 3037 offsetInBytes, |
| 3033 length * Float32List.BYTES_PER_ELEMENT); | 3038 length * Float32List.BYTES_PER_ELEMENT); |
| 3034 _offsetAlignmentCheck(_offsetInBytes, Float32List.BYTES_PER_ELEMENT); | 3039 _offsetAlignmentCheck(_offsetInBytes, Float32List.BYTES_PER_ELEMENT); |
| 3035 } | 3040 } |
| 3036 | 3041 |
| 3037 | 3042 |
| 3038 // Method(s) implementing List interface. | 3043 // Method(s) implementing List interface. |
| 3039 | 3044 |
| 3040 double operator[](int index) { | 3045 double operator[](int index) { |
| 3041 if (index < 0 || index >= length) { | 3046 if (index < 0 || index >= length) { |
| 3042 throw new RangeError.index(index, this, "index"); | 3047 throw _newRangeError(index, length); |
| 3043 } | 3048 } |
| 3044 return _typedData._getFloat32(offsetInBytes + | 3049 return _typedData._getFloat32(offsetInBytes + |
| 3045 (index * Float32List.BYTES_PER_ELEMENT)); | 3050 (index * Float32List.BYTES_PER_ELEMENT)); |
| 3046 } | 3051 } |
| 3047 | 3052 |
| 3048 void operator[]=(int index, double value) { | 3053 void operator[]=(int index, double value) { |
| 3049 if (index < 0 || index >= length) { | 3054 if (index < 0 || index >= length) { |
| 3050 throw new RangeError.index(index, this, "index"); | 3055 throw _newRangeError(index, length); |
| 3051 } | 3056 } |
| 3052 _typedData._setFloat32(offsetInBytes + | 3057 _typedData._setFloat32(offsetInBytes + |
| 3053 (index * Float32List.BYTES_PER_ELEMENT), value); | 3058 (index * Float32List.BYTES_PER_ELEMENT), value); |
| 3054 } | 3059 } |
| 3055 | 3060 |
| 3056 | 3061 |
| 3057 // Method(s) implementing TypedData interface. | 3062 // Method(s) implementing TypedData interface. |
| 3058 | 3063 |
| 3059 int get elementSizeInBytes { | 3064 int get elementSizeInBytes { |
| 3060 return Float32List.BYTES_PER_ELEMENT; | 3065 return Float32List.BYTES_PER_ELEMENT; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 3080 offsetInBytes, | 3085 offsetInBytes, |
| 3081 length * Float64List.BYTES_PER_ELEMENT); | 3086 length * Float64List.BYTES_PER_ELEMENT); |
| 3082 _offsetAlignmentCheck(_offsetInBytes, Float64List.BYTES_PER_ELEMENT); | 3087 _offsetAlignmentCheck(_offsetInBytes, Float64List.BYTES_PER_ELEMENT); |
| 3083 } | 3088 } |
| 3084 | 3089 |
| 3085 | 3090 |
| 3086 // Method(s) implementing List interface. | 3091 // Method(s) implementing List interface. |
| 3087 | 3092 |
| 3088 double operator[](int index) { | 3093 double operator[](int index) { |
| 3089 if (index < 0 || index >= length) { | 3094 if (index < 0 || index >= length) { |
| 3090 throw new RangeError.index(index, this, "index"); | 3095 throw _newRangeError(index, length); |
| 3091 } | 3096 } |
| 3092 return _typedData._getFloat64(offsetInBytes + | 3097 return _typedData._getFloat64(offsetInBytes + |
| 3093 (index * Float64List.BYTES_PER_ELEMENT)); | 3098 (index * Float64List.BYTES_PER_ELEMENT)); |
| 3094 } | 3099 } |
| 3095 | 3100 |
| 3096 void operator[]=(int index, double value) { | 3101 void operator[]=(int index, double value) { |
| 3097 if (index < 0 || index >= length) { | 3102 if (index < 0 || index >= length) { |
| 3098 throw new RangeError.index(index, this, "index"); | 3103 throw _newRangeError(index, length); |
| 3099 } | 3104 } |
| 3100 _typedData._setFloat64(offsetInBytes + | 3105 _typedData._setFloat64(offsetInBytes + |
| 3101 (index * Float64List.BYTES_PER_ELEMENT), value); | 3106 (index * Float64List.BYTES_PER_ELEMENT), value); |
| 3102 } | 3107 } |
| 3103 | 3108 |
| 3104 | 3109 |
| 3105 // Method(s) implementing TypedData interface. | 3110 // Method(s) implementing TypedData interface. |
| 3106 | 3111 |
| 3107 int get elementSizeInBytes { | 3112 int get elementSizeInBytes { |
| 3108 return Float64List.BYTES_PER_ELEMENT; | 3113 return Float64List.BYTES_PER_ELEMENT; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 3128 offsetInBytes, | 3133 offsetInBytes, |
| 3129 length * Float32x4List.BYTES_PER_ELEMENT); | 3134 length * Float32x4List.BYTES_PER_ELEMENT); |
| 3130 _offsetAlignmentCheck(_offsetInBytes, Float32x4List.BYTES_PER_ELEMENT); | 3135 _offsetAlignmentCheck(_offsetInBytes, Float32x4List.BYTES_PER_ELEMENT); |
| 3131 } | 3136 } |
| 3132 | 3137 |
| 3133 | 3138 |
| 3134 // Method(s) implementing List interface. | 3139 // Method(s) implementing List interface. |
| 3135 | 3140 |
| 3136 Float32x4 operator[](int index) { | 3141 Float32x4 operator[](int index) { |
| 3137 if (index < 0 || index >= length) { | 3142 if (index < 0 || index >= length) { |
| 3138 throw new RangeError.index(index, this, "index"); | 3143 throw _newRangeError(index, length); |
| 3139 } | 3144 } |
| 3140 return _typedData._getFloat32x4(offsetInBytes + | 3145 return _typedData._getFloat32x4(offsetInBytes + |
| 3141 (index * Float32x4List.BYTES_PER_ELEMENT)); | 3146 (index * Float32x4List.BYTES_PER_ELEMENT)); |
| 3142 } | 3147 } |
| 3143 | 3148 |
| 3144 void operator[]=(int index, Float32x4 value) { | 3149 void operator[]=(int index, Float32x4 value) { |
| 3145 if (index < 0 || index >= length) { | 3150 if (index < 0 || index >= length) { |
| 3146 throw new RangeError.index(index, this, "index"); | 3151 throw _newRangeError(index, length); |
| 3147 } | 3152 } |
| 3148 _typedData._setFloat32x4(offsetInBytes + | 3153 _typedData._setFloat32x4(offsetInBytes + |
| 3149 (index * Float32x4List.BYTES_PER_ELEMENT), value); | 3154 (index * Float32x4List.BYTES_PER_ELEMENT), value); |
| 3150 } | 3155 } |
| 3151 | 3156 |
| 3152 | 3157 |
| 3153 // Method(s) implementing TypedData interface. | 3158 // Method(s) implementing TypedData interface. |
| 3154 | 3159 |
| 3155 int get elementSizeInBytes { | 3160 int get elementSizeInBytes { |
| 3156 return Float32x4List.BYTES_PER_ELEMENT; | 3161 return Float32x4List.BYTES_PER_ELEMENT; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 3176 offsetInBytes, | 3181 offsetInBytes, |
| 3177 length * Int32x4List.BYTES_PER_ELEMENT); | 3182 length * Int32x4List.BYTES_PER_ELEMENT); |
| 3178 _offsetAlignmentCheck(_offsetInBytes, Int32x4List.BYTES_PER_ELEMENT); | 3183 _offsetAlignmentCheck(_offsetInBytes, Int32x4List.BYTES_PER_ELEMENT); |
| 3179 } | 3184 } |
| 3180 | 3185 |
| 3181 | 3186 |
| 3182 // Method(s) implementing List interface. | 3187 // Method(s) implementing List interface. |
| 3183 | 3188 |
| 3184 Int32x4 operator[](int index) { | 3189 Int32x4 operator[](int index) { |
| 3185 if (index < 0 || index >= length) { | 3190 if (index < 0 || index >= length) { |
| 3186 throw new RangeError.index(index, this, "index"); | 3191 throw _newRangeError(index, length); |
| 3187 } | 3192 } |
| 3188 return _typedData._getInt32x4(offsetInBytes + | 3193 return _typedData._getInt32x4(offsetInBytes + |
| 3189 (index * Int32x4List.BYTES_PER_ELEMENT)); | 3194 (index * Int32x4List.BYTES_PER_ELEMENT)); |
| 3190 } | 3195 } |
| 3191 | 3196 |
| 3192 void operator[]=(int index, Int32x4 value) { | 3197 void operator[]=(int index, Int32x4 value) { |
| 3193 if (index < 0 || index >= length) { | 3198 if (index < 0 || index >= length) { |
| 3194 throw new RangeError.index(index, this, "index"); | 3199 throw _newRangeError(index, length); |
| 3195 } | 3200 } |
| 3196 _typedData._setInt32x4(offsetInBytes + | 3201 _typedData._setInt32x4(offsetInBytes + |
| 3197 (index * Int32x4List.BYTES_PER_ELEMENT), value); | 3202 (index * Int32x4List.BYTES_PER_ELEMENT), value); |
| 3198 } | 3203 } |
| 3199 | 3204 |
| 3200 | 3205 |
| 3201 // Method(s) implementing TypedData interface. | 3206 // Method(s) implementing TypedData interface. |
| 3202 | 3207 |
| 3203 int get elementSizeInBytes { | 3208 int get elementSizeInBytes { |
| 3204 return Int32x4List.BYTES_PER_ELEMENT; | 3209 return Int32x4List.BYTES_PER_ELEMENT; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 3224 offsetInBytes, | 3229 offsetInBytes, |
| 3225 length * Float64x2List.BYTES_PER_ELEMENT); | 3230 length * Float64x2List.BYTES_PER_ELEMENT); |
| 3226 _offsetAlignmentCheck(_offsetInBytes, Float64x2List.BYTES_PER_ELEMENT); | 3231 _offsetAlignmentCheck(_offsetInBytes, Float64x2List.BYTES_PER_ELEMENT); |
| 3227 } | 3232 } |
| 3228 | 3233 |
| 3229 | 3234 |
| 3230 // Method(s) implementing List interface. | 3235 // Method(s) implementing List interface. |
| 3231 | 3236 |
| 3232 Float64x2 operator[](int index) { | 3237 Float64x2 operator[](int index) { |
| 3233 if (index < 0 || index >= length) { | 3238 if (index < 0 || index >= length) { |
| 3234 throw new RangeError.index(index, this, "index"); | 3239 throw _newRangeError(index, length); |
| 3235 } | 3240 } |
| 3236 return _typedData._getFloat64x2(offsetInBytes + | 3241 return _typedData._getFloat64x2(offsetInBytes + |
| 3237 (index * Float64x2List.BYTES_PER_ELEMENT)); | 3242 (index * Float64x2List.BYTES_PER_ELEMENT)); |
| 3238 } | 3243 } |
| 3239 | 3244 |
| 3240 void operator[]=(int index, Float64x2 value) { | 3245 void operator[]=(int index, Float64x2 value) { |
| 3241 if (index < 0 || index >= length) { | 3246 if (index < 0 || index >= length) { |
| 3242 throw new RangeError.index(index, this, "index"); | 3247 throw _newRangeError(index, length); |
| 3243 } | 3248 } |
| 3244 _typedData._setFloat64x2(offsetInBytes + | 3249 _typedData._setFloat64x2(offsetInBytes + |
| 3245 (index * Float64x2List.BYTES_PER_ELEMENT), value); | 3250 (index * Float64x2List.BYTES_PER_ELEMENT), value); |
| 3246 } | 3251 } |
| 3247 | 3252 |
| 3248 | 3253 |
| 3249 // Method(s) implementing TypedData interface. | 3254 // Method(s) implementing TypedData interface. |
| 3250 | 3255 |
| 3251 int get elementSizeInBytes { | 3256 int get elementSizeInBytes { |
| 3252 return Float64x2List.BYTES_PER_ELEMENT; | 3257 return Float64x2List.BYTES_PER_ELEMENT; |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3285 } | 3290 } |
| 3286 | 3291 |
| 3287 int get elementSizeInBytes { | 3292 int get elementSizeInBytes { |
| 3288 return 1; | 3293 return 1; |
| 3289 } | 3294 } |
| 3290 | 3295 |
| 3291 // Method(s) implementing ByteData interface. | 3296 // Method(s) implementing ByteData interface. |
| 3292 | 3297 |
| 3293 int getInt8(int byteOffset) { | 3298 int getInt8(int byteOffset) { |
| 3294 if (byteOffset < 0 || byteOffset >= length) { | 3299 if (byteOffset < 0 || byteOffset >= length) { |
| 3295 throw new RangeError.index(byteOffset, this, "byteOffset"); | 3300 throw _newRangeError(byteOffset, length); |
| 3296 } | 3301 } |
| 3297 return _typedData._getInt8(_offset + byteOffset); | 3302 return _typedData._getInt8(_offset + byteOffset); |
| 3298 } | 3303 } |
| 3299 void setInt8(int byteOffset, int value) { | 3304 void setInt8(int byteOffset, int value) { |
| 3300 if (byteOffset < 0 || byteOffset >= length) { | 3305 if (byteOffset < 0 || byteOffset >= length) { |
| 3301 throw new RangeError.index(byteOffset, this, "byteOffset"); | 3306 throw _newRangeError(byteOffset, length); |
| 3302 } | 3307 } |
| 3303 _typedData._setInt8(_offset + byteOffset, value); | 3308 _typedData._setInt8(_offset + byteOffset, value); |
| 3304 } | 3309 } |
| 3305 | 3310 |
| 3306 int getUint8(int byteOffset) { | 3311 int getUint8(int byteOffset) { |
| 3307 if (byteOffset < 0 || byteOffset >= length) { | 3312 if (byteOffset < 0 || byteOffset >= length) { |
| 3308 throw new RangeError.index(byteOffset, this, "byteOffset"); | 3313 throw _newRangeError(byteOffset, length); |
| 3309 } | 3314 } |
| 3310 return _typedData._getUint8(_offset + byteOffset); | 3315 return _typedData._getUint8(_offset + byteOffset); |
| 3311 } | 3316 } |
| 3312 void setUint8(int byteOffset, int value) { | 3317 void setUint8(int byteOffset, int value) { |
| 3313 if (byteOffset < 0 || byteOffset >= length) { | 3318 if (byteOffset < 0 || byteOffset >= length) { |
| 3314 throw new RangeError.index(byteOffset, this, "byteOffset"); | 3319 throw _newRangeError(byteOffset, length); |
| 3315 } | 3320 } |
| 3316 _typedData._setUint8(_offset + byteOffset, value); | 3321 _typedData._setUint8(_offset + byteOffset, value); |
| 3317 } | 3322 } |
| 3318 | 3323 |
| 3319 int getInt16(int byteOffset, [Endianness endian = Endianness.BIG_ENDIAN]) { | 3324 int getInt16(int byteOffset, [Endianness endian = Endianness.BIG_ENDIAN]) { |
| 3320 if (byteOffset < 0 || byteOffset + 1 >= length) { | 3325 if (byteOffset < 0 || byteOffset + 1 >= length) { |
| 3321 throw new RangeError.range(byteOffset, 0, length - 2, "byteOffset"); | 3326 throw _newRangeError(byteOffset + 1, length); |
| 3322 } | 3327 } |
| 3323 var result = _typedData._getInt16(_offset + byteOffset); | 3328 var result = _typedData._getInt16(_offset + byteOffset); |
| 3324 if (identical(endian, Endianness.HOST_ENDIAN)) { | 3329 if (identical(endian, Endianness.HOST_ENDIAN)) { |
| 3325 return result; | 3330 return result; |
| 3326 } | 3331 } |
| 3327 return _byteSwap16(result).toSigned(16); | 3332 return _byteSwap16(result).toSigned(16); |
| 3328 } | 3333 } |
| 3329 void setInt16(int byteOffset, | 3334 void setInt16(int byteOffset, |
| 3330 int value, | 3335 int value, |
| 3331 [Endianness endian = Endianness.BIG_ENDIAN]) { | 3336 [Endianness endian = Endianness.BIG_ENDIAN]) { |
| 3332 if (byteOffset < 0 || byteOffset + 1 >= length) { | 3337 if (byteOffset < 0 || byteOffset + 1 >= length) { |
| 3333 throw new RangeError.range(byteOffset, 0, length - 2, "byteOffset"); | 3338 throw _newRangeError(byteOffset + 1, length); |
| 3334 } | 3339 } |
| 3335 _typedData._setInt16(_offset + byteOffset, | 3340 _typedData._setInt16(_offset + byteOffset, |
| 3336 identical(endian, Endianness.HOST_ENDIAN) ? value : _byteSwap16(value)); | 3341 identical(endian, Endianness.HOST_ENDIAN) ? value : _byteSwap16(value)); |
| 3337 } | 3342 } |
| 3338 | 3343 |
| 3339 int getUint16(int byteOffset, [Endianness endian = Endianness.BIG_ENDIAN]) { | 3344 int getUint16(int byteOffset, [Endianness endian = Endianness.BIG_ENDIAN]) { |
| 3340 if (byteOffset < 0 || byteOffset + 1 >= length) { | 3345 if (byteOffset < 0 || byteOffset + 1 >= length) { |
| 3341 throw new RangeError.range(byteOffset, 0, length - 2, "byteOffset"); | 3346 throw _newRangeError(byteOffset + 1, length); |
| 3342 } | 3347 } |
| 3343 var result = _typedData._getUint16(_offset + byteOffset); | 3348 var result = _typedData._getUint16(_offset + byteOffset); |
| 3344 if (identical(endian, Endianness.HOST_ENDIAN)) { | 3349 if (identical(endian, Endianness.HOST_ENDIAN)) { |
| 3345 return result; | 3350 return result; |
| 3346 } | 3351 } |
| 3347 return _byteSwap16(result); | 3352 return _byteSwap16(result); |
| 3348 } | 3353 } |
| 3349 void setUint16(int byteOffset, | 3354 void setUint16(int byteOffset, |
| 3350 int value, | 3355 int value, |
| 3351 [Endianness endian = Endianness.BIG_ENDIAN]) { | 3356 [Endianness endian = Endianness.BIG_ENDIAN]) { |
| 3352 if (byteOffset < 0 || byteOffset + 1 >= length) { | 3357 if (byteOffset < 0 || byteOffset + 1 >= length) { |
| 3353 throw new RangeError.range(byteOffset, 0, length - 2, "byteOffset"); | 3358 throw _newRangeError(byteOffset + 1, length); |
| 3354 } | 3359 } |
| 3355 _typedData._setUint16(_offset + byteOffset, | 3360 _typedData._setUint16(_offset + byteOffset, |
| 3356 identical(endian, Endianness.HOST_ENDIAN) ? value : _byteSwap16(value)); | 3361 identical(endian, Endianness.HOST_ENDIAN) ? value : _byteSwap16(value)); |
| 3357 } | 3362 } |
| 3358 | 3363 |
| 3359 int getInt32(int byteOffset, [Endianness endian = Endianness.BIG_ENDIAN]) { | 3364 int getInt32(int byteOffset, [Endianness endian = Endianness.BIG_ENDIAN]) { |
| 3360 if (byteOffset < 0 || byteOffset + 3 >= length) { | 3365 if (byteOffset < 0 || byteOffset + 3 >= length) { |
| 3361 throw new RangeError.range(byteOffset, 0, length - 4, "byteOffset"); | 3366 throw _newRangeError(byteOffset + 3, length); |
| 3362 } | 3367 } |
| 3363 var result = _typedData._getInt32(_offset + byteOffset); | 3368 var result = _typedData._getInt32(_offset + byteOffset); |
| 3364 if (identical(endian, Endianness.HOST_ENDIAN)) { | 3369 if (identical(endian, Endianness.HOST_ENDIAN)) { |
| 3365 return result; | 3370 return result; |
| 3366 } | 3371 } |
| 3367 return _byteSwap32(result).toSigned(32); | 3372 return _byteSwap32(result).toSigned(32); |
| 3368 } | 3373 } |
| 3369 void setInt32(int byteOffset, | 3374 void setInt32(int byteOffset, |
| 3370 int value, | 3375 int value, |
| 3371 [Endianness endian = Endianness.BIG_ENDIAN]) { | 3376 [Endianness endian = Endianness.BIG_ENDIAN]) { |
| 3372 if (byteOffset < 0 || byteOffset + 3 >= length) { | 3377 if (byteOffset < 0 || byteOffset + 3 >= length) { |
| 3373 throw new RangeError.range(byteOffset, 0, length - 4, "byteOffset"); | 3378 throw _newRangeError(byteOffset + 3, length); |
| 3374 } | 3379 } |
| 3375 _typedData._setInt32(_offset + byteOffset, | 3380 _typedData._setInt32(_offset + byteOffset, |
| 3376 identical(endian, Endianness.HOST_ENDIAN) ? value : _byteSwap32(value)); | 3381 identical(endian, Endianness.HOST_ENDIAN) ? value : _byteSwap32(value)); |
| 3377 } | 3382 } |
| 3378 | 3383 |
| 3379 int getUint32(int byteOffset, [Endianness endian = Endianness.BIG_ENDIAN]) { | 3384 int getUint32(int byteOffset, [Endianness endian = Endianness.BIG_ENDIAN]) { |
| 3380 if (byteOffset < 0 || byteOffset + 3 >= length) { | 3385 if (byteOffset < 0 || byteOffset + 3 >= length) { |
| 3381 throw new RangeError.range(byteOffset, 0, length - 4, "byteOffset"); | 3386 throw _newRangeError(byteOffset + 3, length); |
| 3382 } | 3387 } |
| 3383 var result = _typedData._getUint32(_offset + byteOffset); | 3388 var result = _typedData._getUint32(_offset + byteOffset); |
| 3384 if (identical(endian, Endianness.HOST_ENDIAN)) { | 3389 if (identical(endian, Endianness.HOST_ENDIAN)) { |
| 3385 return result; | 3390 return result; |
| 3386 } | 3391 } |
| 3387 return _byteSwap32(result); | 3392 return _byteSwap32(result); |
| 3388 } | 3393 } |
| 3389 void setUint32(int byteOffset, | 3394 void setUint32(int byteOffset, |
| 3390 int value, | 3395 int value, |
| 3391 [Endianness endian = Endianness.BIG_ENDIAN]) { | 3396 [Endianness endian = Endianness.BIG_ENDIAN]) { |
| 3392 if (byteOffset < 0 || byteOffset + 3 >= length) { | 3397 if (byteOffset < 0 || byteOffset + 3 >= length) { |
| 3393 throw new RangeError.range(byteOffset, 0, length - 4, "byteOffset"); | 3398 throw _newRangeError(byteOffset + 3, length); |
| 3394 } | 3399 } |
| 3395 _typedData._setUint32(_offset + byteOffset, | 3400 _typedData._setUint32(_offset + byteOffset, |
| 3396 identical(endian, Endianness.HOST_ENDIAN) ? value : _byteSwap32(value)); | 3401 identical(endian, Endianness.HOST_ENDIAN) ? value : _byteSwap32(value)); |
| 3397 } | 3402 } |
| 3398 | 3403 |
| 3399 int getInt64(int byteOffset, [Endianness endian = Endianness.BIG_ENDIAN]) { | 3404 int getInt64(int byteOffset, [Endianness endian = Endianness.BIG_ENDIAN]) { |
| 3400 if (byteOffset < 0 || byteOffset + 7 >= length) { | 3405 if (byteOffset < 0 || byteOffset + 7 >= length) { |
| 3401 throw new RangeError.range(byteOffset, 0, length - 8, "byteOffset"); | 3406 throw _newRangeError(byteOffset + 7, length); |
| 3402 } | 3407 } |
| 3403 var result = _typedData._getInt64(_offset + byteOffset); | 3408 var result = _typedData._getInt64(_offset + byteOffset); |
| 3404 if (identical(endian, Endianness.HOST_ENDIAN)) { | 3409 if (identical(endian, Endianness.HOST_ENDIAN)) { |
| 3405 return result; | 3410 return result; |
| 3406 } | 3411 } |
| 3407 return _byteSwap64(result).toSigned(64); | 3412 return _byteSwap64(result).toSigned(64); |
| 3408 } | 3413 } |
| 3409 void setInt64(int byteOffset, | 3414 void setInt64(int byteOffset, |
| 3410 int value, | 3415 int value, |
| 3411 [Endianness endian = Endianness.BIG_ENDIAN]) { | 3416 [Endianness endian = Endianness.BIG_ENDIAN]) { |
| 3412 if (byteOffset < 0 || byteOffset + 7 >= length) { | 3417 if (byteOffset < 0 || byteOffset + 7 >= length) { |
| 3413 throw new RangeError.range(byteOffset, 0, length - 8, "byteOffset"); | 3418 throw _newRangeError(byteOffset + 7, length); |
| 3414 } | 3419 } |
| 3415 _typedData._setInt64(_offset + byteOffset, | 3420 _typedData._setInt64(_offset + byteOffset, |
| 3416 identical(endian, Endianness.HOST_ENDIAN) ? value : _byteSwap64(value)); | 3421 identical(endian, Endianness.HOST_ENDIAN) ? value : _byteSwap64(value)); |
| 3417 } | 3422 } |
| 3418 | 3423 |
| 3419 int getUint64(int byteOffset, [Endianness endian = Endianness.BIG_ENDIAN]) { | 3424 int getUint64(int byteOffset, [Endianness endian = Endianness.BIG_ENDIAN]) { |
| 3420 if (byteOffset < 0 || byteOffset + 7 >= length) { | 3425 if (byteOffset < 0 || byteOffset + 7 >= length) { |
| 3421 throw new RangeError.range(byteOffset, 0, length - 8, "byteOffset"); | 3426 throw _newRangeError(byteOffset + 7, length); |
| 3422 } | 3427 } |
| 3423 var result = _typedData._getUint64(_offset + byteOffset); | 3428 var result = _typedData._getUint64(_offset + byteOffset); |
| 3424 if (identical(endian, Endianness.HOST_ENDIAN)) { | 3429 if (identical(endian, Endianness.HOST_ENDIAN)) { |
| 3425 return result; | 3430 return result; |
| 3426 } | 3431 } |
| 3427 return _byteSwap64(result); | 3432 return _byteSwap64(result); |
| 3428 } | 3433 } |
| 3429 void setUint64(int byteOffset, | 3434 void setUint64(int byteOffset, |
| 3430 int value, | 3435 int value, |
| 3431 [Endianness endian = Endianness.BIG_ENDIAN]) { | 3436 [Endianness endian = Endianness.BIG_ENDIAN]) { |
| 3432 if (byteOffset < 0 || byteOffset + 7 >= length) { | 3437 if (byteOffset < 0 || byteOffset + 7 >= length) { |
| 3433 throw new RangeError.range(byteOffset, 0, length - 8, "byteOffset"); | 3438 throw _newRangeError(byteOffset + 7, length); |
| 3434 } | 3439 } |
| 3435 _typedData._setUint64(_offset + byteOffset, | 3440 _typedData._setUint64(_offset + byteOffset, |
| 3436 identical(endian, Endianness.HOST_ENDIAN) ? value : _byteSwap64(value)); | 3441 identical(endian, Endianness.HOST_ENDIAN) ? value : _byteSwap64(value)); |
| 3437 } | 3442 } |
| 3438 | 3443 |
| 3439 double getFloat32(int byteOffset, | 3444 double getFloat32(int byteOffset, |
| 3440 [Endianness endian = Endianness.BIG_ENDIAN]) { | 3445 [Endianness endian = Endianness.BIG_ENDIAN]) { |
| 3441 if (byteOffset < 0 || byteOffset + 3 >= length) { | 3446 if (byteOffset < 0 || byteOffset + 3 >= length) { |
| 3442 throw new RangeError.range(byteOffset, 0, length - 4, "byteOffset"); | 3447 throw _newRangeError(byteOffset + 3, length); |
| 3443 } | 3448 } |
| 3444 if (identical(endian, Endianness.HOST_ENDIAN)) { | 3449 if (identical(endian, Endianness.HOST_ENDIAN)) { |
| 3445 return _typedData._getFloat32(_offset + byteOffset); | 3450 return _typedData._getFloat32(_offset + byteOffset); |
| 3446 } | 3451 } |
| 3447 _convU32[0] = _byteSwap32(_typedData._getUint32(_offset + byteOffset)); | 3452 _convU32[0] = _byteSwap32(_typedData._getUint32(_offset + byteOffset)); |
| 3448 return _convF32[0]; | 3453 return _convF32[0]; |
| 3449 } | 3454 } |
| 3450 void setFloat32(int byteOffset, | 3455 void setFloat32(int byteOffset, |
| 3451 double value, | 3456 double value, |
| 3452 [Endianness endian = Endianness.BIG_ENDIAN]) { | 3457 [Endianness endian = Endianness.BIG_ENDIAN]) { |
| 3453 if (byteOffset < 0 || byteOffset + 3 >= length) { | 3458 if (byteOffset < 0 || byteOffset + 3 >= length) { |
| 3454 throw new RangeError.range(byteOffset, 0, length - 4, "byteOffset"); | 3459 throw _newRangeError(byteOffset + 3, length); |
| 3455 } | 3460 } |
| 3456 if (identical(endian, Endianness.HOST_ENDIAN)) { | 3461 if (identical(endian, Endianness.HOST_ENDIAN)) { |
| 3457 _typedData._setFloat32(_offset + byteOffset, value); | 3462 _typedData._setFloat32(_offset + byteOffset, value); |
| 3458 return; | 3463 return; |
| 3459 } | 3464 } |
| 3460 _convF32[0] = value; | 3465 _convF32[0] = value; |
| 3461 _typedData._setUint32(_offset + byteOffset, _byteSwap32(_convU32[0])); | 3466 _typedData._setUint32(_offset + byteOffset, _byteSwap32(_convU32[0])); |
| 3462 } | 3467 } |
| 3463 | 3468 |
| 3464 double getFloat64(int byteOffset, | 3469 double getFloat64(int byteOffset, |
| 3465 [Endianness endian = Endianness.BIG_ENDIAN]) { | 3470 [Endianness endian = Endianness.BIG_ENDIAN]) { |
| 3466 if (byteOffset < 0 || byteOffset + 7 >= length) { | 3471 if (byteOffset < 0 || byteOffset + 7 >= length) { |
| 3467 throw new RangeError.range(byteOffset, 0, length - 8, "byteOffset"); | 3472 throw _newRangeError(byteOffset + 7, length); |
| 3468 } | 3473 } |
| 3469 if (identical(endian, Endianness.HOST_ENDIAN)) { | 3474 if (identical(endian, Endianness.HOST_ENDIAN)) { |
| 3470 return _typedData._getFloat64(_offset + byteOffset); | 3475 return _typedData._getFloat64(_offset + byteOffset); |
| 3471 } | 3476 } |
| 3472 _convU64[0] = _byteSwap64(_typedData._getUint64(_offset + byteOffset)); | 3477 _convU64[0] = _byteSwap64(_typedData._getUint64(_offset + byteOffset)); |
| 3473 return _convF64[0]; | 3478 return _convF64[0]; |
| 3474 } | 3479 } |
| 3475 void setFloat64(int byteOffset, | 3480 void setFloat64(int byteOffset, |
| 3476 double value, | 3481 double value, |
| 3477 [Endianness endian = Endianness.BIG_ENDIAN]) { | 3482 [Endianness endian = Endianness.BIG_ENDIAN]) { |
| 3478 if (byteOffset < 0 || byteOffset + 7 >= length) { | 3483 if (byteOffset < 0 || byteOffset + 7 >= length) { |
| 3479 throw new RangeError.range(byteOffset, 0, length - 8, "byteOffset"); | 3484 throw _newRangeError(byteOffset + 7, length); |
| 3480 } | 3485 } |
| 3481 if (identical(endian, Endianness.HOST_ENDIAN)) { | 3486 if (identical(endian, Endianness.HOST_ENDIAN)) { |
| 3482 _typedData._setFloat64(_offset + byteOffset, value); | 3487 _typedData._setFloat64(_offset + byteOffset, value); |
| 3483 return; | 3488 return; |
| 3484 } | 3489 } |
| 3485 _convF64[0] = value; | 3490 _convF64[0] = value; |
| 3486 _typedData._setUint64(_offset + byteOffset, _byteSwap64(_convU64[0])); | 3491 _typedData._setUint64(_offset + byteOffset, _byteSwap64(_convU64[0])); |
| 3487 } | 3492 } |
| 3488 | 3493 |
| 3489 Float32x4 getFloat32x4(int byteOffset, | 3494 Float32x4 getFloat32x4(int byteOffset, |
| 3490 [Endianness endian = Endianness.BIG_ENDIAN]) { | 3495 [Endianness endian = Endianness.BIG_ENDIAN]) { |
| 3491 if (byteOffset < 0 || byteOffset + 3 >= length) { | 3496 if (byteOffset < 0 || byteOffset + 3 >= length) { |
| 3492 throw new RangeError.range(byteOffset, 0, length - 4, "byteOffset"); | 3497 throw _newRangeError(byteOffset + 3, length); |
| 3493 } | 3498 } |
| 3494 // TODO(johnmccutchan) : Need to resolve this for endianity. | 3499 // TODO(johnmccutchan) : Need to resolve this for endianity. |
| 3495 return _typedData._getFloat32x4(_offset + byteOffset); | 3500 return _typedData._getFloat32x4(_offset + byteOffset); |
| 3496 } | 3501 } |
| 3497 void setFloat32x4(int byteOffset, | 3502 void setFloat32x4(int byteOffset, |
| 3498 Float32x4 value, | 3503 Float32x4 value, |
| 3499 [Endianness endian = Endianness.BIG_ENDIAN]) { | 3504 [Endianness endian = Endianness.BIG_ENDIAN]) { |
| 3500 if (byteOffset < 0 || byteOffset + 3 >= length) { | 3505 if (byteOffset < 0 || byteOffset + 3 >= length) { |
| 3501 throw new RangeError.range(byteOffset, 0, length - 4, "byteOffset"); | 3506 throw _newRangeError(byteOffset + 3, length); |
| 3502 } | 3507 } |
| 3503 // TODO(johnmccutchan) : Need to resolve this for endianity. | 3508 // TODO(johnmccutchan) : Need to resolve this for endianity. |
| 3504 _typedData._setFloat32x4(_offset + byteOffset, value); | 3509 _typedData._setFloat32x4(_offset + byteOffset, value); |
| 3505 | 3510 |
| 3506 } | 3511 } |
| 3507 | 3512 |
| 3508 final TypedData _typedData; | 3513 final TypedData _typedData; |
| 3509 final int _offset; | 3514 final int _offset; |
| 3510 final int length; | 3515 final int length; |
| 3511 } | 3516 } |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3609 } | 3614 } |
| 3610 } | 3615 } |
| 3611 | 3616 |
| 3612 | 3617 |
| 3613 int _defaultIfNull(object, value) { | 3618 int _defaultIfNull(object, value) { |
| 3614 if (object == null) { | 3619 if (object == null) { |
| 3615 return value; | 3620 return value; |
| 3616 } | 3621 } |
| 3617 return object; | 3622 return object; |
| 3618 } | 3623 } |
| 3624 |
| 3625 |
| 3626 _newRangeError(int index, int length) { |
| 3627 String message = "$index must be in the range [0..$length)"; |
| 3628 return new RangeError(message); |
| 3629 } |
| OLD | NEW |