diff --git a/runtime/lib/typed_data.dart b/runtime/lib/typed_data.dart index 3abb630a81f..c4b532f289e 100644 --- a/runtime/lib/typed_data.dart +++ b/runtime/lib/typed_data.dart @@ -2,233 +2,84 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -// patch classes for Int8List ..... Float64List and ByteData implementations. +library dart.typed_data; import "dart:_internal"; +import "dart:collection" show ListBase; import 'dart:math' show Random; -patch class Int8List { - /* patch */ factory Int8List(int length) { - return new _Int8Array(length); - } +/** + * A typed view of a sequence of bytes. + */ +abstract class TypedData { + /** + * Returns the number of bytes in the representation of each element in this + * list. + */ + int get elementSizeInBytes; - /* patch */ factory Int8List.fromList(List elements) { - return new _Int8Array(elements.length) - ..setRange(0, elements.length, elements); - } + /** + * Returns the offset in bytes into the underlying byte buffer of this view. + */ + int get offsetInBytes; + + /** + * Returns the length of this view, in bytes. + */ + int get lengthInBytes; + + /** + * Returns the byte buffer associated with this object. + */ + ByteBuffer get buffer; } -patch class Uint8List { - /* patch */ factory Uint8List(int length) { - return new _Uint8Array(length); - } +/** + * Describes endianness to be used when accessing or updating a + * sequence of bytes. + */ +class Endianness { + const Endianness._(this._littleEndian); - /* patch */ factory Uint8List.fromList(List elements) { - return new _Uint8Array(elements.length) - ..setRange(0, elements.length, elements); - } + static const Endianness BIG_ENDIAN = const Endianness._(false); + static const Endianness LITTLE_ENDIAN = const Endianness._(true); + static final Endianness HOST_ENDIAN = + (new ByteData.view(new Uint16List.fromList([1]).buffer)).getInt8(0) == 1 ? + LITTLE_ENDIAN : BIG_ENDIAN; + + final bool _littleEndian; } -patch class Uint8ClampedList { - /* patch */ factory Uint8ClampedList(int length) { - return new _Uint8ClampedArray(length); - } - - /* patch */ factory Uint8ClampedList.fromList(List elements) { - return new _Uint8ClampedArray(elements.length) - ..setRange(0, elements.length, elements); - } -} - - -patch class Int16List { - /* patch */ factory Int16List(int length) { - return new _Int16Array(length); - } - - /* patch */ factory Int16List.fromList(List elements) { - return new _Int16Array(elements.length) - ..setRange(0, elements.length, elements); - } -} - - -patch class Uint16List { - /* patch */ factory Uint16List(int length) { - return new _Uint16Array(length); - } - - /* patch */ factory Uint16List.fromList(List elements) { - return new _Uint16Array(elements.length) - ..setRange(0, elements.length, elements); - } -} - - -patch class Int32List { - /* patch */ factory Int32List(int length) { - return new _Int32Array(length); - } - - /* patch */ factory Int32List.fromList(List elements) { - return new _Int32Array(elements.length) - ..setRange(0, elements.length, elements); - } -} - - -patch class Uint32List { - /* patch */ factory Uint32List(int length) { - return new _Uint32Array(length); - } - - /* patch */ factory Uint32List.fromList(List elements) { - return new _Uint32Array(elements.length) - ..setRange(0, elements.length, elements); - } -} - - -patch class Int64List { - /* patch */ factory Int64List(int length) { - return new _Int64Array(length); - } - - /* patch */ factory Int64List.fromList(List elements) { - return new _Int64Array(elements.length) - ..setRange(0, elements.length, elements); - } -} - - -patch class Uint64List { - /* patch */ factory Uint64List(int length) { - return new _Uint64Array(length); - } - - /* patch */ factory Uint64List.fromList(List elements) { - return new _Uint64Array(elements.length) - ..setRange(0, elements.length, elements); - } -} - - -patch class Float32List { - /* patch */ factory Float32List(int length) { - return new _Float32Array(length); - } - - /* patch */ factory Float32List.fromList(List elements) { - return new _Float32Array(elements.length) - ..setRange(0, elements.length, elements); - } -} - - -patch class Float64List { - /* patch */ factory Float64List(int length) { - return new _Float64Array(length); - } - - /* patch */ factory Float64List.fromList(List elements) { - return new _Float64Array(elements.length) - ..setRange(0, elements.length, elements); - } -} - - -patch class Float32x4List { - /* patch */ factory Float32x4List(int length) { - return new _Float32x4Array(length); - } - - /* patch */ factory Float32x4List.fromList(List elements) { - return new _Float32x4Array(elements.length) - ..setRange(0, elements.length, elements); - } -} - - -patch class Int32x4List { - /* patch */ factory Int32x4List(int length) { - return new _Int32x4Array(length); - } - - /* patch */ factory Int32x4List.fromList(List elements) { - return new _Int32x4Array(elements.length) - ..setRange(0, elements.length, elements); - } - -} - -patch class Float64x2List { - /* patch */ factory Float64x2List(int length) { - return new _Float64x2Array(length); - } - - /* patch */ factory Float64x2List.fromList(List elements) { - return new _Float64x2Array(elements.length) - ..setRange(0, elements.length, elements); - } -} - - -patch class Float32x4 { - /* patch */ factory Float32x4(double x, double y, double z, double w) { - return new _Float32x4(x, y, z, w); - } - /* patch */ factory Float32x4.splat(double v) { - return new _Float32x4.splat(v); - } - /* patch */ factory Float32x4.zero() { - return new _Float32x4.zero(); - } - /* patch */ factory Float32x4.fromInt32x4Bits(Int32x4 x) { - return new _Float32x4.fromInt32x4Bits(x); - } - /* patch */ factory Float32x4.fromFloat64x2(Float64x2 v) { - return new _Float32x4.fromFloat64x2(v); - } -} - - -patch class Int32x4 { - /* patch */ factory Int32x4(int x, int y, int z, int w) { - return new _Int32x4(x, y, z, w); - } - /* patch */ factory Int32x4.bool(bool x, bool y, bool z, bool w) { - return new _Int32x4.bool(x, y, z, w); - } - /* patch */ factory Int32x4.fromFloat32x4Bits(Float32x4 x) { - return new _Int32x4.fromFloat32x4Bits(x); - } -} - - -patch class Float64x2 { - /* patch */ factory Float64x2(double x, double y) { - return new _Float64x2(x, y); - } - - /* patch */ factory Float64x2.splat(double v) { - return new _Float64x2.splat(v); - } - - /* patch */ factory Float64x2.zero() { - return new _Float64x2.zero(); - } - - /* patch */ factory Float64x2.fromFloat32x4(Float32x4 v) { - return new _Float64x2.fromFloat32x4(v); - } -} - - -patch class ByteData { - /* patch */ factory ByteData(int length) { - var list = new _Uint8Array(length); +/** + * A fixed-length, random-access sequence of bytes that also provides random + * and unaligned access to the fixed-width integers and floating point + * numbers represented by those bytes. + * + * `ByteData` may be used to pack and unpack data from external sources + * (such as networks or files systems), and to process large quantities + * of numerical data more efficiently than would be possible + * with ordinary [List] implementations. + * `ByteData` can save space, by eliminating the need for object headers, + * and time, by eliminating the need for data copies. + * Finally, `ByteData` may be used to intentionally reinterpret the bytes + * representing one arithmetic type as another. + * For example this code fragment determine what 32-bit signed integer + * is represented by the bytes of a 32-bit floating point number: + * + * var buffer = new Uint8List(8).buffer; + * var bdata = new ByteData.view(buffer); + * bdata.setFloat32(0, 3.04); + * int huh = bdata.getInt32(0); + */ +class ByteData implements TypedData { + /** + * Creates a [ByteData] of the specified length (in elements), all of + * whose bytes are initially zero. + */ + factory ByteData(int length) { + var list = new Uint8List(length); return new _ByteDataView(list, 0, length); } @@ -236,6 +87,292 @@ patch class ByteData { factory ByteData._view(TypedData typedData, int offsetInBytes, int length) { return new _ByteDataView(typedData, offsetInBytes, length); } + + /** + * Creates an [ByteData] _view_ of the specified region in [buffer]. + * + * Changes in the [ByteData] will be visible in the byte + * buffer and vice versa. + * If the [offsetInBytes] index of the region is not specified, + * it defaults to zero (the first byte in the byte buffer). + * If the length is not specified, it defaults to `null`, + * which indicates that the view extends to the end of the byte buffer. + * + * Throws [RangeError] if [offsetInBytes] or [length] are negative, or + * if [offsetInBytes] + ([length] * elementSizeInBytes) is greater than + * the length of [buffer]. + */ + factory ByteData.view(ByteBuffer buffer, + [int offsetInBytes = 0, int length]) { + return buffer.asByteData(offsetInBytes, length); + } + + /** + * Returns the (possibly negative) integer represented by the byte at the + * specified [byteOffset] in this object, in two's complement binary + * representation. + * + * The return value will be between -128 and 127, inclusive. + * + * Throws [RangeError] if [byteOffset] is negative, or + * greater than or equal to the length of this object. + */ + int getInt8(int byteOffset); + + /** + * Sets the byte at the specified [byteOffset] in this object to the + * two's complement binary representation of the specified [value], which + * must fit in a single byte. + * + * In other words, [value] must be between -128 and 127, inclusive. + * + * Throws [RangeError] if [byteOffset] is negative, or + * greater than or equal to the length of this object. + */ + void setInt8(int byteOffset, int value); + + /** + * Returns the positive integer represented by the byte at the specified + * [byteOffset] in this object, in unsigned binary form. + * + * The return value will be between 0 and 255, inclusive. + * + * Throws [RangeError] if [byteOffset] is negative, or + * greater than or equal to the length of this object. + */ + int getUint8(int byteOffset); + + /** + * Sets the byte at the specified [byteOffset] in this object to the + * unsigned binary representation of the specified [value], which must fit + * in a single byte. + * + * In other words, [value] must be between 0 and 255, inclusive. + * + * Throws [RangeError] if [byteOffset] is negative, + * or greater than or equal to the length of this object. + */ + void setUint8(int byteOffset, int value); + + /** + * Returns the (possibly negative) integer represented by the two bytes at + * the specified [byteOffset] in this object, in two's complement binary + * form. + * + * The return value will be between 215 and 215 - 1, + * inclusive. + * + * Throws [RangeError] if [byteOffset] is negative, or + * `byteOffset + 2` is greater than the length of this object. + */ + int getInt16(int byteOffset, [Endianness endian = Endianness.BIG_ENDIAN]); + + /** + * Sets the two bytes starting at the specified [byteOffset] in this + * object to the two's complement binary representation of the specified + * [value], which must fit in two bytes. + * + * In other words, [value] must lie + * between 215 and 215 - 1, inclusive. + * + * Throws [RangeError] if [byteOffset] is negative, or + * `byteOffset + 2` is greater than the length of this object. + */ + void setInt16(int byteOffset, + int value, + [Endianness endian = Endianness.BIG_ENDIAN]); + + /** + * Returns the positive integer represented by the two bytes starting + * at the specified [byteOffset] in this object, in unsigned binary + * form. + * + * The return value will be between 0 and 216 - 1, inclusive. + * + * Throws [RangeError] if [byteOffset] is negative, or + * `byteOffset + 2` is greater than the length of this object. + */ + int getUint16(int byteOffset, [Endianness endian = Endianness.BIG_ENDIAN]); + + /** + * Sets the two bytes starting at the specified [byteOffset] in this object + * to the unsigned binary representation of the specified [value], + * which must fit in two bytes. + * + * In other words, [value] must be between + * 0 and 216 - 1, inclusive. + * + * Throws [RangeError] if [byteOffset] is negative, or + * `byteOffset + 2` is greater than the length of this object. + */ + void setUint16(int byteOffset, + int value, + [Endianness endian = Endianness.BIG_ENDIAN]); + + /** + * Returns the (possibly negative) integer represented by the four bytes at + * the specified [byteOffset] in this object, in two's complement binary + * form. + * + * The return value will be between 231 and 231 - 1, + * inclusive. + * + * Throws [RangeError] if [byteOffset] is negative, or + * `byteOffset + 4` is greater than the length of this object. + */ + int getInt32(int byteOffset, [Endianness endian = Endianness.BIG_ENDIAN]); + + /** + * Sets the four bytes starting at the specified [byteOffset] in this + * object to the two's complement binary representation of the specified + * [value], which must fit in four bytes. + * + * In other words, [value] must lie + * between 231 and 231 - 1, inclusive. + * + * Throws [RangeError] if [byteOffset] is negative, or + * `byteOffset + 4` is greater than the length of this object. + */ + void setInt32(int byteOffset, + int value, + [Endianness endian = Endianness.BIG_ENDIAN]); + + /** + * Returns the positive integer represented by the four bytes starting + * at the specified [byteOffset] in this object, in unsigned binary + * form. + * + * The return value will be between 0 and 232 - 1, inclusive. + * + * Throws [RangeError] if [byteOffset] is negative, or + * `byteOffset + 4` is greater than the length of this object. + */ + int getUint32(int byteOffset, [Endianness endian = Endianness.BIG_ENDIAN]); + + /** + * Sets the four bytes starting at the specified [byteOffset] in this object + * to the unsigned binary representation of the specified [value], + * which must fit in four bytes. + * + * In other words, [value] must be between + * 0 and 232 - 1, inclusive. + * + * Throws [RangeError] if [byteOffset] is negative, or + * `byteOffset + 4` is greater than the length of this object. + */ + void setUint32(int byteOffset, + int value, + [Endianness endian = Endianness.BIG_ENDIAN]); + + /** + * Returns the (possibly negative) integer represented by the eight bytes at + * the specified [byteOffset] in this object, in two's complement binary + * form. + * + * The return value will be between 263 and 263 - 1, + * inclusive. + * + * Throws [RangeError] if [byteOffset] is negative, or + * `byteOffset + 8` is greater than the length of this object. + */ + int getInt64(int byteOffset, [Endianness endian = Endianness.BIG_ENDIAN]); + + /** + * Sets the eight bytes starting at the specified [byteOffset] in this + * object to the two's complement binary representation of the specified + * [value], which must fit in eight bytes. + * + * In other words, [value] must lie + * between 263 and 263 - 1, inclusive. + * + * Throws [RangeError] if [byteOffset] is negative, or + * `byteOffset + 8` is greater than the length of this object. + */ + void setInt64(int byteOffset, + int value, + [Endianness endian = Endianness.BIG_ENDIAN]); + + /** + * Returns the positive integer represented by the eight bytes starting + * at the specified [byteOffset] in this object, in unsigned binary + * form. + * + * The return value will be between 0 and 264 - 1, inclusive. + * + * Throws [RangeError] if [byteOffset] is negative, or + * `byteOffset + 8` is greater than the length of this object. + */ + int getUint64(int byteOffset, [Endianness endian = Endianness.BIG_ENDIAN]); + + /** + * Sets the eight bytes starting at the specified [byteOffset] in this object + * to the unsigned binary representation of the specified [value], + * which must fit in eight bytes. + * + * In other words, [value] must be between + * 0 and 264 - 1, inclusive. + * + * Throws [RangeError] if [byteOffset] is negative, or + * `byteOffset + 8` is greater than the length of this object. + */ + void setUint64(int byteOffset, + int value, + [Endianness endian = Endianness.BIG_ENDIAN]); + + /** + * Returns the floating point number represented by the four bytes at + * the specified [byteOffset] in this object, in IEEE 754 + * single-precision binary floating-point format (binary32). + * + * Throws [RangeError] if [byteOffset] is negative, or + * `byteOffset + 4` is greater than the length of this object. + */ + double getFloat32(int byteOffset, + [Endianness endian = Endianness.BIG_ENDIAN]); + + /** + * Sets the four bytes starting at the specified [byteOffset] in this + * object to the IEEE 754 single-precision binary floating-point + * (binary32) representation of the specified [value]. + * + * **Note that this method can lose precision.** The input [value] is + * a 64-bit floating point value, which will be converted to 32-bit + * floating point value by IEEE 754 rounding rules before it is stored. + * If [value] cannot be represented exactly as a binary32, it will be + * converted to the nearest binary32 value. If two binary32 values are + * equally close, the one whose least significant bit is zero will be used. + * Note that finite (but large) values can be converted to infinity, and + * small non-zero values can be converted to zero. + * + * Throws [RangeError] if [byteOffset] is negative, or + * `byteOffset + 4` is greater than the length of this object. + */ + void setFloat32(int byteOffset, + double value, + [Endianness endian = Endianness.BIG_ENDIAN]); + + /** + * Returns the floating point number represented by the eight bytes at + * the specified [byteOffset] in this object, in IEEE 754 + * double-precision binary floating-point format (binary64). + * + * Throws [RangeError] if [byteOffset] is negative, or + * `byteOffset + 8` is greater than the length of this object. + */ + double getFloat64(int byteOffset, + [Endianness endian = Endianness.BIG_ENDIAN]); + + /** + * Sets the eight bytes starting at the specified [byteOffset] in this + * object to the IEEE 754 double-precision binary floating-point + * (binary64) representation of the specified [value]. + * + * Throws [RangeError] if [byteOffset] is negative, or + * `byteOffset + 8` is greater than the length of this object. + */ + void setFloat64(int byteOffset, + double value, + [Endianness endian = Endianness.BIG_ENDIAN]); } @@ -711,18 +848,18 @@ class _Float64x2ListMixin { } -class _ByteBuffer implements ByteBuffer { +class ByteBuffer { final _TypedList _data; - _ByteBuffer(this._data); + ByteBuffer(this._data); - factory _ByteBuffer._New(data) => new _ByteBuffer(data); + factory ByteBuffer._New(data) => new ByteBuffer(data); // Forward calls to _data. int get lengthInBytes => _data.lengthInBytes; int get hashCode => _data.hashCode; bool operator==(Object other) => - (other is _ByteBuffer) && identical(_data, other._data); + (other is ByteBuffer) && identical(_data, other._data); ByteData asByteData([int offsetInBytes = 0, int length]) { if (length == null) { @@ -852,7 +989,7 @@ abstract class _TypedList extends _TypedListBase { return length * elementSizeInBytes; } - ByteBuffer get buffer => new _ByteBuffer(this); + ByteBuffer get buffer => new ByteBuffer(this); // Methods implementing the collection interface. @@ -924,10 +1061,20 @@ abstract class _TypedList extends _TypedListBase { } -class _Int8Array extends _TypedList with _IntListMixin implements Int8List { +class Int8List extends _TypedList with _IntListMixin implements List, TypedData { // Factory constructors. - factory _Int8Array(int length) native "TypedData_Int8Array_new"; + factory Int8List(int length) native "TypedData_Int8Array_new"; + + factory Int8List.fromList(List elements) { + return new Int8List(elements.length) + ..setRange(0, elements.length, elements); + } + + factory Int8List.view(ByteBuffer buffer, + [int offsetInBytes = 0, int length]) { + return buffer.asInt8List(offsetInBytes, length); + } // Method(s) implementing List interface. @@ -945,6 +1092,7 @@ class _Int8Array extends _TypedList with _IntListMixin implements Int8List { _setInt8(index, _toInt8(value)); } + static const int BYTES_PER_ELEMENT = 1; // Method(s) implementing TypedData interface. @@ -955,16 +1103,26 @@ class _Int8Array extends _TypedList with _IntListMixin implements Int8List { // Internal utility methods. - _Int8Array _createList(int length) { - return new _Int8Array(length); + Int8List _createList(int length) { + return new Int8List(length); } } -class _Uint8Array extends _TypedList with _IntListMixin implements Uint8List { +class Uint8List extends _TypedList with _IntListMixin implements List, TypedData { // Factory constructors. - factory _Uint8Array(int length) native "TypedData_Uint8Array_new"; + factory Uint8List(int length) native "TypedData_Uint8Array_new"; + + factory Uint8List.fromList(List elements) { + return new Uint8List(elements.length) + ..setRange(0, elements.length, elements); + } + + factory Uint8List.view(ByteBuffer buffer, + [int offsetInBytes = 0, int length]) { + return buffer.asUint8List(offsetInBytes, length); + } // Methods implementing List interface. int operator[](int index) { @@ -981,6 +1139,7 @@ class _Uint8Array extends _TypedList with _IntListMixin implements Uint8List { _setUint8(index, _toUint8(value)); } + static const int BYTES_PER_ELEMENT = 1; // Methods implementing TypedData interface. int get elementSizeInBytes { @@ -990,16 +1149,26 @@ class _Uint8Array extends _TypedList with _IntListMixin implements Uint8List { // Internal utility methods. - _Uint8Array _createList(int length) { - return new _Uint8Array(length); + Uint8List _createList(int length) { + return new Uint8List(length); } } -class _Uint8ClampedArray extends _TypedList with _IntListMixin implements Uint8ClampedList { +class Uint8ClampedList extends _TypedList with _IntListMixin implements List, TypedData { // Factory constructors. - factory _Uint8ClampedArray(int length) native "TypedData_Uint8ClampedArray_new"; + factory Uint8ClampedList(int length) native "TypedData_Uint8ClampedArray_new"; + + factory Uint8ClampedList.fromList(List elements) { + return new Uint8ClampedList(elements.length) + ..setRange(0, elements.length, elements); + } + + factory Uint8ClampedList.view(ByteBuffer buffer, + [int offsetInBytes = 0, int length]) { + return buffer.asUint8ClampedList(offsetInBytes, length); + } // Methods implementing List interface. @@ -1017,6 +1186,7 @@ class _Uint8ClampedArray extends _TypedList with _IntListMixin implements Uint8C _setUint8(index, _toClampedUint8(value)); } + static const int BYTES_PER_ELEMENT = 1; // Methods implementing TypedData interface. int get elementSizeInBytes { @@ -1026,16 +1196,26 @@ class _Uint8ClampedArray extends _TypedList with _IntListMixin implements Uint8C // Internal utility methods. - _Uint8ClampedArray _createList(int length) { - return new _Uint8ClampedArray(length); + Uint8ClampedList _createList(int length) { + return new Uint8ClampedList(length); } } -class _Int16Array extends _TypedList with _IntListMixin implements Int16List { +class Int16List extends _TypedList with _IntListMixin implements List, TypedData { // Factory constructors. - factory _Int16Array(int length) native "TypedData_Int16Array_new"; + factory Int16List(int length) native "TypedData_Int16Array_new"; + + factory Int16List.fromList(List elements) { + return new Int16List(elements.length) + ..setRange(0, elements.length, elements); + } + + factory Int16List.view(ByteBuffer buffer, + [int offsetInBytes = 0, int length]) { + return buffer.asInt16List(offsetInBytes, length); + } // Method(s) implementing List interface. @@ -1065,6 +1245,7 @@ class _Int16Array extends _TypedList with _IntListMixin implements Int16List { } // Method(s) implementing TypedData interface. + static const int BYTES_PER_ELEMENT = 2; int get elementSizeInBytes { return Int16List.BYTES_PER_ELEMENT; @@ -1073,8 +1254,8 @@ class _Int16Array extends _TypedList with _IntListMixin implements Int16List { // Internal utility methods. - _Int16Array _createList(int length) { - return new _Int16Array(length); + Int16List _createList(int length) { + return new Int16List(length); } int _getIndexedInt16(int index) { @@ -1087,10 +1268,20 @@ class _Int16Array extends _TypedList with _IntListMixin implements Int16List { } -class _Uint16Array extends _TypedList with _IntListMixin implements Uint16List { +class Uint16List extends _TypedList with _IntListMixin implements List, TypedData { // Factory constructors. - factory _Uint16Array(int length) native "TypedData_Uint16Array_new"; + factory Uint16List(int length) native "TypedData_Uint16Array_new"; + + factory Uint16List.fromList(List elements) { + return new Uint16List(elements.length) + ..setRange(0, elements.length, elements); + } + + factory Uint16List.view(ByteBuffer buffer, + [int offsetInBytes = 0, int length]) { + return buffer.asUint16List(offsetInBytes, length); + } // Method(s) implementing the List interface. @@ -1120,6 +1311,7 @@ class _Uint16Array extends _TypedList with _IntListMixin implements Uint16List { } // Method(s) implementing the TypedData interface. + static const int BYTES_PER_ELEMENT = 2; int get elementSizeInBytes { return Uint16List.BYTES_PER_ELEMENT; @@ -1128,8 +1320,8 @@ class _Uint16Array extends _TypedList with _IntListMixin implements Uint16List { // Internal utility methods. - _Uint16Array _createList(int length) { - return new _Uint16Array(length); + Uint16List _createList(int length) { + return new Uint16List(length); } int _getIndexedUint16(int index) { @@ -1142,10 +1334,20 @@ class _Uint16Array extends _TypedList with _IntListMixin implements Uint16List { } -class _Int32Array extends _TypedList with _IntListMixin implements Int32List { +class Int32List extends _TypedList with _IntListMixin implements List, TypedData { // Factory constructors. - factory _Int32Array(int length) native "TypedData_Int32Array_new"; + factory Int32List(int length) native "TypedData_Int32Array_new"; + + factory Int32List.fromList(List elements) { + return new Int32List(elements.length) + ..setRange(0, elements.length, elements); + } + + factory Int32List.view(ByteBuffer buffer, + [int offsetInBytes = 0, int length]) { + return buffer.asInt32List(offsetInBytes, length); + } // Method(s) implementing the List interface. @@ -1165,6 +1367,7 @@ class _Int32Array extends _TypedList with _IntListMixin implements Int32List { // Method(s) implementing TypedData interface. + static const int BYTES_PER_ELEMENT = 4; int get elementSizeInBytes { return Int32List.BYTES_PER_ELEMENT; @@ -1173,8 +1376,8 @@ class _Int32Array extends _TypedList with _IntListMixin implements Int32List { // Internal utility methods. - _Int32Array _createList(int length) { - return new _Int32Array(length); + Int32List _createList(int length) { + return new Int32List(length); } int _getIndexedInt32(int index) { @@ -1188,10 +1391,20 @@ class _Int32Array extends _TypedList with _IntListMixin implements Int32List { } -class _Uint32Array extends _TypedList with _IntListMixin implements Uint32List { +class Uint32List extends _TypedList with _IntListMixin implements List, TypedData { // Factory constructors. - factory _Uint32Array(int length) native "TypedData_Uint32Array_new"; + factory Uint32List(int length) native "TypedData_Uint32Array_new"; + + factory Uint32List.fromList(List elements) { + return new Uint32List(elements.length) + ..setRange(0, elements.length, elements); + } + + factory Uint32List.view(ByteBuffer buffer, + [int offsetInBytes = 0, int length]) { + return buffer.asUint32List(offsetInBytes, length); + } // Method(s) implementing the List interface. @@ -1211,6 +1424,7 @@ class _Uint32Array extends _TypedList with _IntListMixin implements Uint32List { // Method(s) implementing the TypedData interface. + static const int BYTES_PER_ELEMENT = 4; int get elementSizeInBytes { return Uint32List.BYTES_PER_ELEMENT; @@ -1219,8 +1433,8 @@ class _Uint32Array extends _TypedList with _IntListMixin implements Uint32List { // Internal utility methods. - _Uint32Array _createList(int length) { - return new _Uint32Array(length); + Uint32List _createList(int length) { + return new Uint32List(length); } int _getIndexedUint32(int index) { @@ -1233,10 +1447,20 @@ class _Uint32Array extends _TypedList with _IntListMixin implements Uint32List { } -class _Int64Array extends _TypedList with _IntListMixin implements Int64List { +class Int64List extends _TypedList with _IntListMixin implements List, TypedData { // Factory constructors. - factory _Int64Array(int length) native "TypedData_Int64Array_new"; + factory Int64List(int length) native "TypedData_Int64Array_new"; + + factory Int64List.fromList(List elements) { + return new Int64List(elements.length) + ..setRange(0, elements.length, elements); + } + + factory Int64List.view(ByteBuffer buffer, + [int offsetInBytes = 0, int length]) { + return buffer.asInt64List(offsetInBytes, length); + } // Method(s) implementing the List interface. @@ -1256,6 +1480,7 @@ class _Int64Array extends _TypedList with _IntListMixin implements Int64List { // Method(s) implementing the TypedData interface. + static const int BYTES_PER_ELEMENT = 8; int get elementSizeInBytes { return Int64List.BYTES_PER_ELEMENT; @@ -1264,8 +1489,8 @@ class _Int64Array extends _TypedList with _IntListMixin implements Int64List { // Internal utility methods. - _Int64Array _createList(int length) { - return new _Int64Array(length); + Int64List _createList(int length) { + return new Int64List(length); } int _getIndexedInt64(int index) { @@ -1278,10 +1503,20 @@ class _Int64Array extends _TypedList with _IntListMixin implements Int64List { } -class _Uint64Array extends _TypedList with _IntListMixin implements Uint64List { +class Uint64List extends _TypedList with _IntListMixin implements List, TypedData { // Factory constructors. - factory _Uint64Array(int length) native "TypedData_Uint64Array_new"; + factory Uint64List(int length) native "TypedData_Uint64Array_new"; + + factory Uint64List.fromList(List elements) { + return new Uint64List(elements.length) + ..setRange(0, elements.length, elements); + } + + factory Uint64List.view(ByteBuffer buffer, + [int offsetInBytes = 0, int length]) { + return buffer.asUint64List(offsetInBytes, length); + } // Method(s) implementing the List interface. @@ -1301,6 +1536,7 @@ class _Uint64Array extends _TypedList with _IntListMixin implements Uint64List { // Method(s) implementing the TypedData interface. + static const int BYTES_PER_ELEMENT = 8; int get elementSizeInBytes { return Uint64List.BYTES_PER_ELEMENT; @@ -1309,8 +1545,8 @@ class _Uint64Array extends _TypedList with _IntListMixin implements Uint64List { // Internal utility methods. - _Uint64Array _createList(int length) { - return new _Uint64Array(length); + Uint64List _createList(int length) { + return new Uint64List(length); } int _getIndexedUint64(int index) { @@ -1323,10 +1559,20 @@ class _Uint64Array extends _TypedList with _IntListMixin implements Uint64List { } -class _Float32Array extends _TypedList with _DoubleListMixin implements Float32List { +class Float32List extends _TypedList with _DoubleListMixin implements List, TypedData { // Factory constructors. - factory _Float32Array(int length) native "TypedData_Float32Array_new"; + factory Float32List(int length) native "TypedData_Float32Array_new"; + + factory Float32List.fromList(List elements) { + return new Float32List(elements.length) + ..setRange(0, elements.length, elements); + } + + factory Float32List.view(ByteBuffer buffer, + [int offsetInBytes = 0, int length]) { + return buffer.asFloat32List(offsetInBytes, length); + } // Method(s) implementing the List interface. @@ -1346,6 +1592,7 @@ class _Float32Array extends _TypedList with _DoubleListMixin implements Float32L // Method(s) implementing the TypedData interface. + static const int BYTES_PER_ELEMENT = 4; int get elementSizeInBytes { return Float32List.BYTES_PER_ELEMENT; @@ -1354,8 +1601,8 @@ class _Float32Array extends _TypedList with _DoubleListMixin implements Float32L // Internal utility methods. - _Float32Array _createList(int length) { - return new _Float32Array(length); + Float32List _createList(int length) { + return new Float32List(length); } double _getIndexedFloat32(int index) { @@ -1368,10 +1615,20 @@ class _Float32Array extends _TypedList with _DoubleListMixin implements Float32L } -class _Float64Array extends _TypedList with _DoubleListMixin implements Float64List { +class Float64List extends _TypedList with _DoubleListMixin implements List, TypedData { // Factory constructors. - factory _Float64Array(int length) native "TypedData_Float64Array_new"; + factory Float64List(int length) native "TypedData_Float64Array_new"; + + factory Float64List.fromList(List elements) { + return new Float64List(elements.length) + ..setRange(0, elements.length, elements); + } + + factory Float64List.view(ByteBuffer buffer, + [int offsetInBytes = 0, int length]) { + return buffer.asFloat64List(offsetInBytes, length); + } // Method(s) implementing the List interface. @@ -1391,6 +1648,7 @@ class _Float64Array extends _TypedList with _DoubleListMixin implements Float64L // Method(s) implementing the TypedData interface. + static const int BYTES_PER_ELEMENT = 8; int get elementSizeInBytes { return Float64List.BYTES_PER_ELEMENT; @@ -1399,8 +1657,8 @@ class _Float64Array extends _TypedList with _DoubleListMixin implements Float64L // Internal utility methods. - _Float64Array _createList(int length) { - return new _Float64Array(length); + Float64List _createList(int length) { + return new Float64List(length); } double _getIndexedFloat64(int index) { @@ -1413,10 +1671,20 @@ class _Float64Array extends _TypedList with _DoubleListMixin implements Float64L } -class _Float32x4Array extends _TypedList with _Float32x4ListMixin implements Float32x4List { +class Float32x4List extends _TypedList with _Float32x4ListMixin implements List, TypedData { // Factory constructors. - factory _Float32x4Array(int length) native "TypedData_Float32x4Array_new"; + factory Float32x4List(int length) native "TypedData_Float32x4Array_new"; + + factory Float32x4List.fromList(List elements) { + return new Float32x4List(elements.length) + ..setRange(0, elements.length, elements); + } + + factory Float32x4List.view(ByteBuffer buffer, + [int offsetInBytes = 0, int length]) { + return buffer.asFloat32x4List(offsetInBytes, length); + } Float32x4 operator[](int index) { if (index < 0 || index >= length) { @@ -1434,6 +1702,7 @@ class _Float32x4Array extends _TypedList with _Float32x4ListMixin implements Flo // Method(s) implementing the TypedData interface. + static const int BYTES_PER_ELEMENT = 16; int get elementSizeInBytes { return Float32x4List.BYTES_PER_ELEMENT; @@ -1442,8 +1711,8 @@ class _Float32x4Array extends _TypedList with _Float32x4ListMixin implements Flo // Internal utility methods. - _Float32x4Array _createList(int length) { - return new _Float32x4Array(length); + Float32x4List _createList(int length) { + return new Float32x4List(length); } Float32x4 _getIndexedFloat32x4(int index) { @@ -1456,10 +1725,20 @@ class _Float32x4Array extends _TypedList with _Float32x4ListMixin implements Flo } -class _Int32x4Array extends _TypedList with _Int32x4ListMixin implements Int32x4List { +class Int32x4List extends _TypedList with _Int32x4ListMixin implements List, TypedData { // Factory constructors. - factory _Int32x4Array(int length) native "TypedData_Int32x4Array_new"; + factory Int32x4List(int length) native "TypedData_Int32x4Array_new"; + + factory Int32x4List.fromList(List elements) { + return new Int32x4List(elements.length) + ..setRange(0, elements.length, elements); + } + + factory Int32x4List.view(ByteBuffer buffer, + [int offsetInBytes = 0, int length]) { + return buffer.asInt32x4List(offsetInBytes, length); + } Int32x4 operator[](int index) { if (index < 0 || index >= length) { @@ -1477,6 +1756,7 @@ class _Int32x4Array extends _TypedList with _Int32x4ListMixin implements Int32x4 // Method(s) implementing the TypedData interface. + static const int BYTES_PER_ELEMENT = 16; int get elementSizeInBytes { return Int32x4List.BYTES_PER_ELEMENT; @@ -1485,8 +1765,8 @@ class _Int32x4Array extends _TypedList with _Int32x4ListMixin implements Int32x4 // Internal utility methods. - _Int32x4Array _createList(int length) { - return new _Int32x4Array(length); + Int32x4List _createList(int length) { + return new Int32x4List(length); } Int32x4 _getIndexedInt32x4(int index) { @@ -1499,10 +1779,20 @@ class _Int32x4Array extends _TypedList with _Int32x4ListMixin implements Int32x4 } -class _Float64x2Array extends _TypedList with _Float64x2ListMixin implements Float64x2List { +class Float64x2List extends _TypedList with _Float64x2ListMixin implements List, TypedData { // Factory constructors. - factory _Float64x2Array(int length) native "TypedData_Float64x2Array_new"; + factory Float64x2List(int length) native "TypedData_Float64x2Array_new"; + + factory Float64x2List.fromList(List elements) { + return new Float64x2List(elements.length) + ..setRange(0, elements.length, elements); + } + + factory Float64x2List.view(ByteBuffer buffer, + [int offsetInBytes = 0, int length]) { + return buffer.asFloat64x2List(offsetInBytes, length); + } Float64x2 operator[](int index) { if (index < 0 || index >= length) { @@ -1520,6 +1810,7 @@ class _Float64x2Array extends _TypedList with _Float64x2ListMixin implements Flo // Method(s) implementing the TypedData interface. + static const int BYTES_PER_ELEMENT = 16; int get elementSizeInBytes { return Float64x2List.BYTES_PER_ELEMENT; @@ -1528,8 +1819,8 @@ class _Float64x2Array extends _TypedList with _Float64x2ListMixin implements Flo // Internal utility methods. - _Float64x2Array _createList(int length) { - return new _Float64x2Array(length); + Float64x2List _createList(int length) { + return new Float64x2List(length); } Float64x2 _getIndexedFloat64x2(int index) { @@ -2147,14 +2438,14 @@ class _ExternalFloat64x2Array extends _TypedList with _Float64x2ListMixin implem } -class _Float32x4 implements Float32x4 { - factory _Float32x4(double x, double y, double z, double w) +class Float32x4 { + factory Float32x4(double x, double y, double z, double w) native "Float32x4_fromDoubles"; - factory _Float32x4.splat(double v) native "Float32x4_splat"; - factory _Float32x4.zero() native "Float32x4_zero"; - factory _Float32x4.fromInt32x4Bits(Int32x4 x) + factory Float32x4.splat(double v) native "Float32x4_splat"; + factory Float32x4.zero() native "Float32x4_zero"; + factory Float32x4.fromInt32x4Bits(Int32x4 x) native "Float32x4_fromInt32x4Bits"; - factory _Float32x4.fromFloat64x2(Float64x2 v) + factory Float32x4.fromFloat64x2(Float64x2 v) native "Float32x4_fromFloat64x2"; Float32x4 operator +(Float32x4 other) { return _add(other); @@ -2248,15 +2539,274 @@ class _Float32x4 implements Float32x4 { return _reciprocalSqrt(); } Float32x4 _reciprocalSqrt() native "Float32x4_reciprocalSqrt"; + + /// Mask passed to [shuffle] or [shuffleMix]. + static const int XXXX = 0x0; + static const int XXXY = 0x40; + static const int XXXZ = 0x80; + static const int XXXW = 0xC0; + static const int XXYX = 0x10; + static const int XXYY = 0x50; + static const int XXYZ = 0x90; + static const int XXYW = 0xD0; + static const int XXZX = 0x20; + static const int XXZY = 0x60; + static const int XXZZ = 0xA0; + static const int XXZW = 0xE0; + static const int XXWX = 0x30; + static const int XXWY = 0x70; + static const int XXWZ = 0xB0; + static const int XXWW = 0xF0; + static const int XYXX = 0x4; + static const int XYXY = 0x44; + static const int XYXZ = 0x84; + static const int XYXW = 0xC4; + static const int XYYX = 0x14; + static const int XYYY = 0x54; + static const int XYYZ = 0x94; + static const int XYYW = 0xD4; + static const int XYZX = 0x24; + static const int XYZY = 0x64; + static const int XYZZ = 0xA4; + static const int XYZW = 0xE4; + static const int XYWX = 0x34; + static const int XYWY = 0x74; + static const int XYWZ = 0xB4; + static const int XYWW = 0xF4; + static const int XZXX = 0x8; + static const int XZXY = 0x48; + static const int XZXZ = 0x88; + static const int XZXW = 0xC8; + static const int XZYX = 0x18; + static const int XZYY = 0x58; + static const int XZYZ = 0x98; + static const int XZYW = 0xD8; + static const int XZZX = 0x28; + static const int XZZY = 0x68; + static const int XZZZ = 0xA8; + static const int XZZW = 0xE8; + static const int XZWX = 0x38; + static const int XZWY = 0x78; + static const int XZWZ = 0xB8; + static const int XZWW = 0xF8; + static const int XWXX = 0xC; + static const int XWXY = 0x4C; + static const int XWXZ = 0x8C; + static const int XWXW = 0xCC; + static const int XWYX = 0x1C; + static const int XWYY = 0x5C; + static const int XWYZ = 0x9C; + static const int XWYW = 0xDC; + static const int XWZX = 0x2C; + static const int XWZY = 0x6C; + static const int XWZZ = 0xAC; + static const int XWZW = 0xEC; + static const int XWWX = 0x3C; + static const int XWWY = 0x7C; + static const int XWWZ = 0xBC; + static const int XWWW = 0xFC; + static const int YXXX = 0x1; + static const int YXXY = 0x41; + static const int YXXZ = 0x81; + static const int YXXW = 0xC1; + static const int YXYX = 0x11; + static const int YXYY = 0x51; + static const int YXYZ = 0x91; + static const int YXYW = 0xD1; + static const int YXZX = 0x21; + static const int YXZY = 0x61; + static const int YXZZ = 0xA1; + static const int YXZW = 0xE1; + static const int YXWX = 0x31; + static const int YXWY = 0x71; + static const int YXWZ = 0xB1; + static const int YXWW = 0xF1; + static const int YYXX = 0x5; + static const int YYXY = 0x45; + static const int YYXZ = 0x85; + static const int YYXW = 0xC5; + static const int YYYX = 0x15; + static const int YYYY = 0x55; + static const int YYYZ = 0x95; + static const int YYYW = 0xD5; + static const int YYZX = 0x25; + static const int YYZY = 0x65; + static const int YYZZ = 0xA5; + static const int YYZW = 0xE5; + static const int YYWX = 0x35; + static const int YYWY = 0x75; + static const int YYWZ = 0xB5; + static const int YYWW = 0xF5; + static const int YZXX = 0x9; + static const int YZXY = 0x49; + static const int YZXZ = 0x89; + static const int YZXW = 0xC9; + static const int YZYX = 0x19; + static const int YZYY = 0x59; + static const int YZYZ = 0x99; + static const int YZYW = 0xD9; + static const int YZZX = 0x29; + static const int YZZY = 0x69; + static const int YZZZ = 0xA9; + static const int YZZW = 0xE9; + static const int YZWX = 0x39; + static const int YZWY = 0x79; + static const int YZWZ = 0xB9; + static const int YZWW = 0xF9; + static const int YWXX = 0xD; + static const int YWXY = 0x4D; + static const int YWXZ = 0x8D; + static const int YWXW = 0xCD; + static const int YWYX = 0x1D; + static const int YWYY = 0x5D; + static const int YWYZ = 0x9D; + static const int YWYW = 0xDD; + static const int YWZX = 0x2D; + static const int YWZY = 0x6D; + static const int YWZZ = 0xAD; + static const int YWZW = 0xED; + static const int YWWX = 0x3D; + static const int YWWY = 0x7D; + static const int YWWZ = 0xBD; + static const int YWWW = 0xFD; + static const int ZXXX = 0x2; + static const int ZXXY = 0x42; + static const int ZXXZ = 0x82; + static const int ZXXW = 0xC2; + static const int ZXYX = 0x12; + static const int ZXYY = 0x52; + static const int ZXYZ = 0x92; + static const int ZXYW = 0xD2; + static const int ZXZX = 0x22; + static const int ZXZY = 0x62; + static const int ZXZZ = 0xA2; + static const int ZXZW = 0xE2; + static const int ZXWX = 0x32; + static const int ZXWY = 0x72; + static const int ZXWZ = 0xB2; + static const int ZXWW = 0xF2; + static const int ZYXX = 0x6; + static const int ZYXY = 0x46; + static const int ZYXZ = 0x86; + static const int ZYXW = 0xC6; + static const int ZYYX = 0x16; + static const int ZYYY = 0x56; + static const int ZYYZ = 0x96; + static const int ZYYW = 0xD6; + static const int ZYZX = 0x26; + static const int ZYZY = 0x66; + static const int ZYZZ = 0xA6; + static const int ZYZW = 0xE6; + static const int ZYWX = 0x36; + static const int ZYWY = 0x76; + static const int ZYWZ = 0xB6; + static const int ZYWW = 0xF6; + static const int ZZXX = 0xA; + static const int ZZXY = 0x4A; + static const int ZZXZ = 0x8A; + static const int ZZXW = 0xCA; + static const int ZZYX = 0x1A; + static const int ZZYY = 0x5A; + static const int ZZYZ = 0x9A; + static const int ZZYW = 0xDA; + static const int ZZZX = 0x2A; + static const int ZZZY = 0x6A; + static const int ZZZZ = 0xAA; + static const int ZZZW = 0xEA; + static const int ZZWX = 0x3A; + static const int ZZWY = 0x7A; + static const int ZZWZ = 0xBA; + static const int ZZWW = 0xFA; + static const int ZWXX = 0xE; + static const int ZWXY = 0x4E; + static const int ZWXZ = 0x8E; + static const int ZWXW = 0xCE; + static const int ZWYX = 0x1E; + static const int ZWYY = 0x5E; + static const int ZWYZ = 0x9E; + static const int ZWYW = 0xDE; + static const int ZWZX = 0x2E; + static const int ZWZY = 0x6E; + static const int ZWZZ = 0xAE; + static const int ZWZW = 0xEE; + static const int ZWWX = 0x3E; + static const int ZWWY = 0x7E; + static const int ZWWZ = 0xBE; + static const int ZWWW = 0xFE; + static const int WXXX = 0x3; + static const int WXXY = 0x43; + static const int WXXZ = 0x83; + static const int WXXW = 0xC3; + static const int WXYX = 0x13; + static const int WXYY = 0x53; + static const int WXYZ = 0x93; + static const int WXYW = 0xD3; + static const int WXZX = 0x23; + static const int WXZY = 0x63; + static const int WXZZ = 0xA3; + static const int WXZW = 0xE3; + static const int WXWX = 0x33; + static const int WXWY = 0x73; + static const int WXWZ = 0xB3; + static const int WXWW = 0xF3; + static const int WYXX = 0x7; + static const int WYXY = 0x47; + static const int WYXZ = 0x87; + static const int WYXW = 0xC7; + static const int WYYX = 0x17; + static const int WYYY = 0x57; + static const int WYYZ = 0x97; + static const int WYYW = 0xD7; + static const int WYZX = 0x27; + static const int WYZY = 0x67; + static const int WYZZ = 0xA7; + static const int WYZW = 0xE7; + static const int WYWX = 0x37; + static const int WYWY = 0x77; + static const int WYWZ = 0xB7; + static const int WYWW = 0xF7; + static const int WZXX = 0xB; + static const int WZXY = 0x4B; + static const int WZXZ = 0x8B; + static const int WZXW = 0xCB; + static const int WZYX = 0x1B; + static const int WZYY = 0x5B; + static const int WZYZ = 0x9B; + static const int WZYW = 0xDB; + static const int WZZX = 0x2B; + static const int WZZY = 0x6B; + static const int WZZZ = 0xAB; + static const int WZZW = 0xEB; + static const int WZWX = 0x3B; + static const int WZWY = 0x7B; + static const int WZWZ = 0xBB; + static const int WZWW = 0xFB; + static const int WWXX = 0xF; + static const int WWXY = 0x4F; + static const int WWXZ = 0x8F; + static const int WWXW = 0xCF; + static const int WWYX = 0x1F; + static const int WWYY = 0x5F; + static const int WWYZ = 0x9F; + static const int WWYW = 0xDF; + static const int WWZX = 0x2F; + static const int WWZY = 0x6F; + static const int WWZZ = 0xAF; + static const int WWZW = 0xEF; + static const int WWWX = 0x3F; + static const int WWWY = 0x7F; + static const int WWWZ = 0xBF; + static const int WWWW = 0xFF; + } -class _Int32x4 implements Int32x4 { - factory _Int32x4(int x, int y, int z, int w) +class Int32x4 { + factory Int32x4(int x, int y, int z, int w) native "Int32x4_fromInts"; - factory _Int32x4.bool(bool x, bool y, bool z, bool w) + factory Int32x4.bool(bool x, bool y, bool z, bool w) native "Int32x4_fromBools"; - factory _Int32x4.fromFloat32x4Bits(Float32x4 x) + factory Int32x4.fromFloat32x4Bits(Float32x4 x) native "Int32x4_fromFloat32x4Bits"; Int32x4 operator |(Int32x4 other) { return _or(other); @@ -2304,14 +2854,273 @@ class _Int32x4 implements Int32x4 { Float32x4 _select(Float32x4 trueValue, Float32x4 falseValue) native "Int32x4_select"; + + /// Mask passed to [shuffle] or [shuffleMix]. + static const int XXXX = 0x0; + static const int XXXY = 0x40; + static const int XXXZ = 0x80; + static const int XXXW = 0xC0; + static const int XXYX = 0x10; + static const int XXYY = 0x50; + static const int XXYZ = 0x90; + static const int XXYW = 0xD0; + static const int XXZX = 0x20; + static const int XXZY = 0x60; + static const int XXZZ = 0xA0; + static const int XXZW = 0xE0; + static const int XXWX = 0x30; + static const int XXWY = 0x70; + static const int XXWZ = 0xB0; + static const int XXWW = 0xF0; + static const int XYXX = 0x4; + static const int XYXY = 0x44; + static const int XYXZ = 0x84; + static const int XYXW = 0xC4; + static const int XYYX = 0x14; + static const int XYYY = 0x54; + static const int XYYZ = 0x94; + static const int XYYW = 0xD4; + static const int XYZX = 0x24; + static const int XYZY = 0x64; + static const int XYZZ = 0xA4; + static const int XYZW = 0xE4; + static const int XYWX = 0x34; + static const int XYWY = 0x74; + static const int XYWZ = 0xB4; + static const int XYWW = 0xF4; + static const int XZXX = 0x8; + static const int XZXY = 0x48; + static const int XZXZ = 0x88; + static const int XZXW = 0xC8; + static const int XZYX = 0x18; + static const int XZYY = 0x58; + static const int XZYZ = 0x98; + static const int XZYW = 0xD8; + static const int XZZX = 0x28; + static const int XZZY = 0x68; + static const int XZZZ = 0xA8; + static const int XZZW = 0xE8; + static const int XZWX = 0x38; + static const int XZWY = 0x78; + static const int XZWZ = 0xB8; + static const int XZWW = 0xF8; + static const int XWXX = 0xC; + static const int XWXY = 0x4C; + static const int XWXZ = 0x8C; + static const int XWXW = 0xCC; + static const int XWYX = 0x1C; + static const int XWYY = 0x5C; + static const int XWYZ = 0x9C; + static const int XWYW = 0xDC; + static const int XWZX = 0x2C; + static const int XWZY = 0x6C; + static const int XWZZ = 0xAC; + static const int XWZW = 0xEC; + static const int XWWX = 0x3C; + static const int XWWY = 0x7C; + static const int XWWZ = 0xBC; + static const int XWWW = 0xFC; + static const int YXXX = 0x1; + static const int YXXY = 0x41; + static const int YXXZ = 0x81; + static const int YXXW = 0xC1; + static const int YXYX = 0x11; + static const int YXYY = 0x51; + static const int YXYZ = 0x91; + static const int YXYW = 0xD1; + static const int YXZX = 0x21; + static const int YXZY = 0x61; + static const int YXZZ = 0xA1; + static const int YXZW = 0xE1; + static const int YXWX = 0x31; + static const int YXWY = 0x71; + static const int YXWZ = 0xB1; + static const int YXWW = 0xF1; + static const int YYXX = 0x5; + static const int YYXY = 0x45; + static const int YYXZ = 0x85; + static const int YYXW = 0xC5; + static const int YYYX = 0x15; + static const int YYYY = 0x55; + static const int YYYZ = 0x95; + static const int YYYW = 0xD5; + static const int YYZX = 0x25; + static const int YYZY = 0x65; + static const int YYZZ = 0xA5; + static const int YYZW = 0xE5; + static const int YYWX = 0x35; + static const int YYWY = 0x75; + static const int YYWZ = 0xB5; + static const int YYWW = 0xF5; + static const int YZXX = 0x9; + static const int YZXY = 0x49; + static const int YZXZ = 0x89; + static const int YZXW = 0xC9; + static const int YZYX = 0x19; + static const int YZYY = 0x59; + static const int YZYZ = 0x99; + static const int YZYW = 0xD9; + static const int YZZX = 0x29; + static const int YZZY = 0x69; + static const int YZZZ = 0xA9; + static const int YZZW = 0xE9; + static const int YZWX = 0x39; + static const int YZWY = 0x79; + static const int YZWZ = 0xB9; + static const int YZWW = 0xF9; + static const int YWXX = 0xD; + static const int YWXY = 0x4D; + static const int YWXZ = 0x8D; + static const int YWXW = 0xCD; + static const int YWYX = 0x1D; + static const int YWYY = 0x5D; + static const int YWYZ = 0x9D; + static const int YWYW = 0xDD; + static const int YWZX = 0x2D; + static const int YWZY = 0x6D; + static const int YWZZ = 0xAD; + static const int YWZW = 0xED; + static const int YWWX = 0x3D; + static const int YWWY = 0x7D; + static const int YWWZ = 0xBD; + static const int YWWW = 0xFD; + static const int ZXXX = 0x2; + static const int ZXXY = 0x42; + static const int ZXXZ = 0x82; + static const int ZXXW = 0xC2; + static const int ZXYX = 0x12; + static const int ZXYY = 0x52; + static const int ZXYZ = 0x92; + static const int ZXYW = 0xD2; + static const int ZXZX = 0x22; + static const int ZXZY = 0x62; + static const int ZXZZ = 0xA2; + static const int ZXZW = 0xE2; + static const int ZXWX = 0x32; + static const int ZXWY = 0x72; + static const int ZXWZ = 0xB2; + static const int ZXWW = 0xF2; + static const int ZYXX = 0x6; + static const int ZYXY = 0x46; + static const int ZYXZ = 0x86; + static const int ZYXW = 0xC6; + static const int ZYYX = 0x16; + static const int ZYYY = 0x56; + static const int ZYYZ = 0x96; + static const int ZYYW = 0xD6; + static const int ZYZX = 0x26; + static const int ZYZY = 0x66; + static const int ZYZZ = 0xA6; + static const int ZYZW = 0xE6; + static const int ZYWX = 0x36; + static const int ZYWY = 0x76; + static const int ZYWZ = 0xB6; + static const int ZYWW = 0xF6; + static const int ZZXX = 0xA; + static const int ZZXY = 0x4A; + static const int ZZXZ = 0x8A; + static const int ZZXW = 0xCA; + static const int ZZYX = 0x1A; + static const int ZZYY = 0x5A; + static const int ZZYZ = 0x9A; + static const int ZZYW = 0xDA; + static const int ZZZX = 0x2A; + static const int ZZZY = 0x6A; + static const int ZZZZ = 0xAA; + static const int ZZZW = 0xEA; + static const int ZZWX = 0x3A; + static const int ZZWY = 0x7A; + static const int ZZWZ = 0xBA; + static const int ZZWW = 0xFA; + static const int ZWXX = 0xE; + static const int ZWXY = 0x4E; + static const int ZWXZ = 0x8E; + static const int ZWXW = 0xCE; + static const int ZWYX = 0x1E; + static const int ZWYY = 0x5E; + static const int ZWYZ = 0x9E; + static const int ZWYW = 0xDE; + static const int ZWZX = 0x2E; + static const int ZWZY = 0x6E; + static const int ZWZZ = 0xAE; + static const int ZWZW = 0xEE; + static const int ZWWX = 0x3E; + static const int ZWWY = 0x7E; + static const int ZWWZ = 0xBE; + static const int ZWWW = 0xFE; + static const int WXXX = 0x3; + static const int WXXY = 0x43; + static const int WXXZ = 0x83; + static const int WXXW = 0xC3; + static const int WXYX = 0x13; + static const int WXYY = 0x53; + static const int WXYZ = 0x93; + static const int WXYW = 0xD3; + static const int WXZX = 0x23; + static const int WXZY = 0x63; + static const int WXZZ = 0xA3; + static const int WXZW = 0xE3; + static const int WXWX = 0x33; + static const int WXWY = 0x73; + static const int WXWZ = 0xB3; + static const int WXWW = 0xF3; + static const int WYXX = 0x7; + static const int WYXY = 0x47; + static const int WYXZ = 0x87; + static const int WYXW = 0xC7; + static const int WYYX = 0x17; + static const int WYYY = 0x57; + static const int WYYZ = 0x97; + static const int WYYW = 0xD7; + static const int WYZX = 0x27; + static const int WYZY = 0x67; + static const int WYZZ = 0xA7; + static const int WYZW = 0xE7; + static const int WYWX = 0x37; + static const int WYWY = 0x77; + static const int WYWZ = 0xB7; + static const int WYWW = 0xF7; + static const int WZXX = 0xB; + static const int WZXY = 0x4B; + static const int WZXZ = 0x8B; + static const int WZXW = 0xCB; + static const int WZYX = 0x1B; + static const int WZYY = 0x5B; + static const int WZYZ = 0x9B; + static const int WZYW = 0xDB; + static const int WZZX = 0x2B; + static const int WZZY = 0x6B; + static const int WZZZ = 0xAB; + static const int WZZW = 0xEB; + static const int WZWX = 0x3B; + static const int WZWY = 0x7B; + static const int WZWZ = 0xBB; + static const int WZWW = 0xFB; + static const int WWXX = 0xF; + static const int WWXY = 0x4F; + static const int WWXZ = 0x8F; + static const int WWXW = 0xCF; + static const int WWYX = 0x1F; + static const int WWYY = 0x5F; + static const int WWYZ = 0x9F; + static const int WWYW = 0xDF; + static const int WWZX = 0x2F; + static const int WWZY = 0x6F; + static const int WWZZ = 0xAF; + static const int WWZW = 0xEF; + static const int WWWX = 0x3F; + static const int WWWY = 0x7F; + static const int WWWZ = 0xBF; + static const int WWWW = 0xFF; + } -class _Float64x2 implements Float64x2 { - factory _Float64x2(double x, double y) native "Float64x2_fromDoubles"; - factory _Float64x2.splat(double v) native "Float64x2_splat"; - factory _Float64x2.zero() native "Float64x2_zero"; - factory _Float64x2.fromFloat32x4(Float32x4 v) native "Float64x2_fromFloat32x4"; +class Float64x2 { + factory Float64x2(double x, double y) native "Float64x2_fromDoubles"; + factory Float64x2.splat(double v) native "Float64x2_splat"; + factory Float64x2.zero() native "Float64x2_zero"; + factory Float64x2.fromFloat32x4(Float32x4 v) native "Float64x2_fromFloat32x4"; Float64x2 operator +(Float64x2 other) { return _add(other); @@ -2397,7 +3206,7 @@ class _TypedListIterator implements Iterator { class _TypedListView extends _TypedListBase implements TypedData { - _TypedListView(_ByteBuffer _buffer, int _offset, int _length) + _TypedListView(ByteBuffer _buffer, int _offset, int _length) : _typedData = _buffer._data, offsetInBytes = _offset, length = _length { diff --git a/runtime/observatory/tests/service/get_object_rpc_test.dart b/runtime/observatory/tests/service/get_object_rpc_test.dart index a98c53598ea..2f45f3acba9 100644 --- a/runtime/observatory/tests/service/get_object_rpc_test.dart +++ b/runtime/observatory/tests/service/get_object_rpc_test.dart @@ -441,7 +441,7 @@ var tests = [ expect(result['id'], startsWith('objects/')); expect(result['valueAsString'], isNull); expect(result['class']['type'], equals('@Class')); - expect(result['class']['name'], equals('_Uint8Array')); + expect(result['class']['name'], equals('Uint8List')); expect(result['size'], isPositive); expect(result['fields'], isEmpty); expect(result['length'], equals(3)); @@ -467,7 +467,7 @@ var tests = [ expect(result['id'], startsWith('objects/')); expect(result['valueAsString'], isNull); expect(result['class']['type'], equals('@Class')); - expect(result['class']['name'], equals('_Uint8Array')); + expect(result['class']['name'], equals('Uint8List')); expect(result['size'], isPositive); expect(result['fields'], isEmpty); expect(result['length'], equals(3)); @@ -494,7 +494,7 @@ var tests = [ expect(result['id'], startsWith('objects/')); expect(result['valueAsString'], isNull); expect(result['class']['type'], equals('@Class')); - expect(result['class']['name'], equals('_Uint8Array')); + expect(result['class']['name'], equals('Uint8List')); expect(result['size'], isPositive); expect(result['fields'], isEmpty); expect(result['length'], equals(3)); @@ -521,7 +521,7 @@ var tests = [ expect(result['id'], startsWith('objects/')); expect(result['valueAsString'], isNull); expect(result['class']['type'], equals('@Class')); - expect(result['class']['name'], equals('_Uint8Array')); + expect(result['class']['name'], equals('Uint8List')); expect(result['size'], isPositive); expect(result['fields'], isEmpty); expect(result['length'], equals(3)); @@ -544,7 +544,7 @@ var tests = [ expect(result['id'], startsWith('objects/')); expect(result['valueAsString'], isNull); expect(result['class']['type'], equals('@Class')); - expect(result['class']['name'], equals('_Uint64Array')); + expect(result['class']['name'], equals('Uint64List')); expect(result['size'], isPositive); expect(result['fields'], isEmpty); expect(result['length'], equals(3)); @@ -570,7 +570,7 @@ var tests = [ expect(result['id'], startsWith('objects/')); expect(result['valueAsString'], isNull); expect(result['class']['type'], equals('@Class')); - expect(result['class']['name'], equals('_Uint64Array')); + expect(result['class']['name'], equals('Uint64List')); expect(result['size'], isPositive); expect(result['fields'], isEmpty); expect(result['length'], equals(3)); @@ -597,7 +597,7 @@ var tests = [ expect(result['id'], startsWith('objects/')); expect(result['valueAsString'], isNull); expect(result['class']['type'], equals('@Class')); - expect(result['class']['name'], equals('_Uint64Array')); + expect(result['class']['name'], equals('Uint64List')); expect(result['size'], isPositive); expect(result['fields'], isEmpty); expect(result['length'], equals(3)); @@ -624,7 +624,7 @@ var tests = [ expect(result['id'], startsWith('objects/')); expect(result['valueAsString'], isNull); expect(result['class']['type'], equals('@Class')); - expect(result['class']['name'], equals('_Uint64Array')); + expect(result['class']['name'], equals('Uint64List')); expect(result['size'], isPositive); expect(result['fields'], isEmpty); expect(result['length'], equals(3)); diff --git a/runtime/vm/bootstrap.cc b/runtime/vm/bootstrap.cc index f093bfc54c9..f9f418be79e 100644 --- a/runtime/vm/bootstrap.cc +++ b/runtime/vm/bootstrap.cc @@ -82,7 +82,7 @@ static bootstrap_lib_props bootstrap_libraries[] = { INIT_LIBRARY(ObjectStore::kTypedData, typed_data, Bootstrap::typed_data_source_paths_, - Bootstrap::typed_data_patch_paths_), + NULL), INIT_LIBRARY(ObjectStore::kVMService, _vmservice, Bootstrap::_vmservice_source_paths_, diff --git a/runtime/vm/dart_api_impl.cc b/runtime/vm/dart_api_impl.cc index 9d7cf01afe5..cb540bc058b 100644 --- a/runtime/vm/dart_api_impl.cc +++ b/runtime/vm/dart_api_impl.cc @@ -3493,8 +3493,8 @@ DART_EXPORT Dart_Handle Dart_NewByteBuffer(Dart_Handle typed_data) { } Object& result = Object::Handle(Z); result = GetByteBufferConstructor(T, - Symbols::_ByteBuffer(), - Symbols::_ByteBufferDot_New(), + Symbols::ByteBuffer(), + Symbols::ByteBufferDot_New(), 1); ASSERT(!result.IsNull()); ASSERT(result.IsFunction()); diff --git a/runtime/vm/method_recognizer.h b/runtime/vm/method_recognizer.h index 1292b842463..b17d91d8f11 100644 --- a/runtime/vm/method_recognizer.h +++ b/runtime/vm/method_recognizer.h @@ -62,87 +62,87 @@ namespace dart { V(::, min, MathMin, 1115051548) \ V(::, max, MathMax, 1410473322) \ V(::, _doublePow, MathDoublePow, 562154128) \ - V(Float32x4, Float32x4., Float32x4Constructor, 1849420944) \ - V(Float32x4, Float32x4.zero, Float32x4Zero, 762161262) \ - V(Float32x4, Float32x4.splat, Float32x4Splat, 255855286) \ - V(Float32x4, Float32x4.fromInt32x4Bits, Float32x4FromInt32x4Bits, 1718571366)\ - V(Float32x4, Float32x4.fromFloat64x2, Float32x4FromFloat64x2, 1458098858) \ - V(_Float32x4, shuffle, Float32x4Shuffle, 2015957023) \ - V(_Float32x4, shuffleMix, Float32x4ShuffleMix, 1099087979) \ - V(_Float32x4, get:signMask, Float32x4GetSignMask, 487049875) \ - V(_Float32x4, _cmpequal, Float32x4Equal, 1069901308) \ - V(_Float32x4, _cmpgt, Float32x4GreaterThan, 2112381651) \ - V(_Float32x4, _cmpgte, Float32x4GreaterThanOrEqual, 1088241265) \ - V(_Float32x4, _cmplt, Float32x4LessThan, 2001171012) \ - V(_Float32x4, _cmplte, Float32x4LessThanOrEqual, 1568686387) \ - V(_Float32x4, _cmpnequal, Float32x4NotEqual, 1833412828) \ - V(_Float32x4, _min, Float32x4Min, 1194113943) \ - V(_Float32x4, _max, Float32x4Max, 1876936155) \ - V(_Float32x4, _scale, Float32x4Scale, 1176743640) \ - V(_Float32x4, _sqrt, Float32x4Sqrt, 526238610) \ - V(_Float32x4, _reciprocalSqrt, Float32x4ReciprocalSqrt, 860560177) \ - V(_Float32x4, _reciprocal, Float32x4Reciprocal, 1703468100) \ - V(_Float32x4, _negate, Float32x4Negate, 1409902640) \ - V(_Float32x4, _abs, Float32x4Absolute, 2116840471) \ - V(_Float32x4, _clamp, Float32x4Clamp, 1789892357) \ - V(_Float32x4, withX, Float32x4WithX, 1311992575) \ - V(_Float32x4, withY, Float32x4WithY, 175290640) \ - V(_Float32x4, withZ, Float32x4WithZ, 837367384) \ - V(_Float32x4, withW, Float32x4WithW, 1625145605) \ - V(Float64x2, Float64x2., Float64x2Constructor, 1428850802) \ - V(Float64x2, Float64x2.zero, Float64x2Zero, 29170676) \ - V(Float64x2, Float64x2.splat, Float64x2Splat, 1077183856) \ - V(Float64x2, Float64x2.fromFloat32x4, Float64x2FromFloat32x4, 1752000980) \ - V(_Float64x2, get:x, Float64x2GetX, 1488958362) \ - V(_Float64x2, get:y, Float64x2GetY, 1022688506) \ - V(_Float64x2, _negate, Float64x2Negate, 960840275) \ - V(_Float64x2, abs, Float64x2Abs, 52403783) \ - V(_Float64x2, sqrt, Float64x2Sqrt, 2012680669) \ - V(_Float64x2, get:signMask, Float64x2GetSignMask, 668856717) \ - V(_Float64x2, scale, Float64x2Scale, 646122081) \ - V(_Float64x2, withX, Float64x2WithX, 489409269) \ - V(_Float64x2, withY, Float64x2WithY, 943642284) \ - V(_Float64x2, min, Float64x2Min, 685235702) \ - V(_Float64x2, max, Float64x2Max, 198659675) \ - V(Int32x4, Int32x4., Int32x4Constructor, 80862812) \ - V(Int32x4, Int32x4.bool, Int32x4BoolConstructor, 1949580252) \ - V(Int32x4, Int32x4.fromFloat32x4Bits, Int32x4FromFloat32x4Bits, 1611205288) \ - V(_Int32x4, get:flagX, Int32x4GetFlagX, 1446544324) \ - V(_Int32x4, get:flagY, Int32x4GetFlagY, 1148149370) \ - V(_Int32x4, get:flagZ, Int32x4GetFlagZ, 550901369) \ - V(_Int32x4, get:flagW, Int32x4GetFlagW, 1346664620) \ - V(_Int32x4, get:signMask, Int32x4GetSignMask, 740215269) \ - V(_Int32x4, shuffle, Int32x4Shuffle, 549194518) \ - V(_Int32x4, shuffleMix, Int32x4ShuffleMix, 1550866145) \ - V(_Int32x4, select, Int32x4Select, 614943686) \ - V(_Int32x4, withFlagX, Int32x4WithFlagX, 250974159) \ - V(_Int32x4, withFlagY, Int32x4WithFlagY, 1686481348) \ - V(_Int32x4, withFlagZ, Int32x4WithFlagZ, 645582330) \ - V(_Int32x4, withFlagW, Int32x4WithFlagW, 878364277) \ - V(_Float32Array, [], Float32ArrayGetIndexed, 1002307136) \ - V(_Float32Array, []=, Float32ArraySetIndexed, 279546769) \ - V(_Int8Array, [], Int8ArrayGetIndexed, 1141846285) \ - V(_Int8Array, []=, Int8ArraySetIndexed, 1486839324) \ - V(_Uint8ClampedArray, [], Uint8ClampedArrayGetIndexed, 513704632) \ - V(_Uint8ClampedArray, []=, Uint8ClampedArraySetIndexed, 1015846567) \ + V(Float32x4, Float32x4., Float32x4Constructor, 93751705) \ + V(Float32x4, Float32x4.zero, Float32x4Zero, 1193954374) \ + V(Float32x4, Float32x4.splat, Float32x4Splat, 12296613) \ + V(Float32x4, Float32x4.fromInt32x4Bits, Float32x4FromInt32x4Bits, 1188039061)\ + V(Float32x4, Float32x4.fromFloat64x2, Float32x4FromFloat64x2, 1750763218) \ + V(Float32x4, shuffle, Float32x4Shuffle, 2015957023) \ + V(Float32x4, shuffleMix, Float32x4ShuffleMix, 1099087979) \ + V(Float32x4, get:signMask, Float32x4GetSignMask, 487049875) \ + V(Float32x4, _cmpequal, Float32x4Equal, 1069901308) \ + V(Float32x4, _cmpgt, Float32x4GreaterThan, 2112381651) \ + V(Float32x4, _cmpgte, Float32x4GreaterThanOrEqual, 1088241265) \ + V(Float32x4, _cmplt, Float32x4LessThan, 2001171012) \ + V(Float32x4, _cmplte, Float32x4LessThanOrEqual, 1568686387) \ + V(Float32x4, _cmpnequal, Float32x4NotEqual, 1833412828) \ + V(Float32x4, _min, Float32x4Min, 1194113943) \ + V(Float32x4, _max, Float32x4Max, 1876936155) \ + V(Float32x4, _scale, Float32x4Scale, 1176743640) \ + V(Float32x4, _sqrt, Float32x4Sqrt, 526238610) \ + V(Float32x4, _reciprocalSqrt, Float32x4ReciprocalSqrt, 860560177) \ + V(Float32x4, _reciprocal, Float32x4Reciprocal, 1703468100) \ + V(Float32x4, _negate, Float32x4Negate, 1409902640) \ + V(Float32x4, _abs, Float32x4Absolute, 2116840471) \ + V(Float32x4, _clamp, Float32x4Clamp, 1789892357) \ + V(Float32x4, withX, Float32x4WithX, 1311992575) \ + V(Float32x4, withY, Float32x4WithY, 175290640) \ + V(Float32x4, withZ, Float32x4WithZ, 837367384) \ + V(Float32x4, withW, Float32x4WithW, 1625145605) \ + V(Float64x2, Float64x2., Float64x2Constructor, 423355933) \ + V(Float64x2, Float64x2.zero, Float64x2Zero, 2066666975) \ + V(Float64x2, Float64x2.splat, Float64x2Splat, 716962994) \ + V(Float64x2, Float64x2.fromFloat32x4, Float64x2FromFloat32x4, 792974246) \ + V(Float64x2, get:x, Float64x2GetX, 1488958362) \ + V(Float64x2, get:y, Float64x2GetY, 1022688506) \ + V(Float64x2, _negate, Float64x2Negate, 960840275) \ + V(Float64x2, abs, Float64x2Abs, 52403783) \ + V(Float64x2, sqrt, Float64x2Sqrt, 2012680669) \ + V(Float64x2, get:signMask, Float64x2GetSignMask, 668856717) \ + V(Float64x2, scale, Float64x2Scale, 646122081) \ + V(Float64x2, withX, Float64x2WithX, 489409269) \ + V(Float64x2, withY, Float64x2WithY, 943642284) \ + V(Float64x2, min, Float64x2Min, 685235702) \ + V(Float64x2, max, Float64x2Max, 198659675) \ + V(Int32x4, Int32x4., Int32x4Constructor, 649173415) \ + V(Int32x4, Int32x4.bool, Int32x4BoolConstructor, 458597857) \ + V(Int32x4, Int32x4.fromFloat32x4Bits, Int32x4FromFloat32x4Bits, 2122470988) \ + V(Int32x4, get:flagX, Int32x4GetFlagX, 1446544324) \ + V(Int32x4, get:flagY, Int32x4GetFlagY, 1148149370) \ + V(Int32x4, get:flagZ, Int32x4GetFlagZ, 550901369) \ + V(Int32x4, get:flagW, Int32x4GetFlagW, 1346664620) \ + V(Int32x4, get:signMask, Int32x4GetSignMask, 740215269) \ + V(Int32x4, shuffle, Int32x4Shuffle, 549194518) \ + V(Int32x4, shuffleMix, Int32x4ShuffleMix, 1550866145) \ + V(Int32x4, select, Int32x4Select, 614943686) \ + V(Int32x4, withFlagX, Int32x4WithFlagX, 250974159) \ + V(Int32x4, withFlagY, Int32x4WithFlagY, 1686481348) \ + V(Int32x4, withFlagZ, Int32x4WithFlagZ, 645582330) \ + V(Int32x4, withFlagW, Int32x4WithFlagW, 878364277) \ + V(Float32List, [], Float32ArrayGetIndexed, 1002307136) \ + V(Float32List, []=, Float32ArraySetIndexed, 279546769) \ + V(Int8List, [], Int8ArrayGetIndexed, 1141846285) \ + V(Int8List, []=, Int8ArraySetIndexed, 1486839324) \ + V(Uint8ClampedList, [], Uint8ClampedArrayGetIndexed, 513704632) \ + V(Uint8ClampedList, []=, Uint8ClampedArraySetIndexed, 1015846567) \ V(_ExternalUint8ClampedArray, [], ExternalUint8ClampedArrayGetIndexed, \ 513704632) \ V(_ExternalUint8ClampedArray, []=, ExternalUint8ClampedArraySetIndexed, \ 1015846567) \ - V(_Int16Array, [], Int16ArrayGetIndexed, 1826359619) \ - V(_Int16Array, []=, Int16ArraySetIndexed, 1108689116) \ - V(_Uint16Array, [], Uint16ArrayGetIndexed, 118958722) \ - V(_Uint16Array, []=, Uint16ArraySetIndexed, 658824450) \ - V(_Int32Array, [], Int32ArrayGetIndexed, 681203163) \ - V(_Int32Array, []=, Int32ArraySetIndexed, 1786886245) \ - V(_Int64Array, [], Int64ArrayGetIndexed, 1883155004) \ - V(_Int64Array, []=, Int64ArraySetIndexed, 905815059) \ - V(_Float32x4Array, [], Float32x4ArrayGetIndexed, 694822356) \ - V(_Float32x4Array, []=, Float32x4ArraySetIndexed, 1166109127) \ - V(_Int32x4Array, [], Int32x4ArrayGetIndexed, 668249259) \ - V(_Int32x4Array, []=, Int32x4ArraySetIndexed, 654739449) \ - V(_Float64x2Array, [], Float64x2ArrayGetIndexed, 196472005) \ - V(_Float64x2Array, []=, Float64x2ArraySetIndexed, 1421858500) \ + V(Int16List, [], Int16ArrayGetIndexed, 1826359619) \ + V(Int16List, []=, Int16ArraySetIndexed, 1108689116) \ + V(Uint16List, [], Uint16ArrayGetIndexed, 118958722) \ + V(Uint16List, []=, Uint16ArraySetIndexed, 658824450) \ + V(Int32List, [], Int32ArrayGetIndexed, 681203163) \ + V(Int32List, []=, Int32ArraySetIndexed, 1786886245) \ + V(Int64List, [], Int64ArrayGetIndexed, 1883155004) \ + V(Int64List, []=, Int64ArraySetIndexed, 905815059) \ + V(Float32x4List, [], Float32x4ArrayGetIndexed, 694822356) \ + V(Float32x4List, []=, Float32x4ArraySetIndexed, 1166109127) \ + V(Int32x4List, [], Int32x4ArrayGetIndexed, 668249259) \ + V(Int32x4List, []=, Int32x4ArraySetIndexed, 654739449) \ + V(Float64x2List, [], Float64x2ArrayGetIndexed, 196472005) \ + V(Float64x2List, []=, Float64x2ArraySetIndexed, 1421858500) \ V(_Bigint, get:_neg, Bigint_getNeg, 1681019799) \ V(_Bigint, get:_used, Bigint_getUsed, 1439136438) \ V(_Bigint, get:_digits, Bigint_getDigits, 769722770) \ @@ -245,38 +245,38 @@ namespace dart { #define TYPED_DATA_LIB_INTRINSIC_LIST(V) \ - V(_Int8Array, ., TypedData_Int8Array_factory, 1058992179) \ - V(_Uint8Array, ., TypedData_Uint8Array_factory, 1807546986) \ - V(_Uint8ClampedArray, ., TypedData_Uint8ClampedArray_factory, 548459853) \ - V(_Int16Array, ., TypedData_Int16Array_factory, 1796211480) \ - V(_Uint16Array, ., TypedData_Uint16Array_factory, 1960868166) \ - V(_Int32Array, ., TypedData_Int32Array_factory, 372258367) \ - V(_Uint32Array, ., TypedData_Uint32Array_factory, 1446612721) \ - V(_Int64Array, ., TypedData_Int64Array_factory, 964028713) \ - V(_Uint64Array, ., TypedData_Uint64Array_factory, 721823156) \ - V(_Float32Array, ., TypedData_Float32Array_factory, 392399264) \ - V(_Float64Array, ., TypedData_Float64Array_factory, 42503976) \ - V(_Float32x4Array, ., TypedData_Float32x4Array_factory, 1960198693) \ - V(_Int32x4Array, ., TypedData_Int32x4Array_factory, 1433742555) \ - V(_Float64x2Array, ., TypedData_Float64x2Array_factory, 165463437) \ + V(Int8List, ., TypedData_Int8Array_factory, 779569635) \ + V(Uint8List, ., TypedData_Uint8Array_factory, 1790399545) \ + V(Uint8ClampedList, ., TypedData_Uint8ClampedArray_factory, 405875159) \ + V(Int16List, ., TypedData_Int16Array_factory, 347431914) \ + V(Uint16List, ., TypedData_Uint16Array_factory, 121990116) \ + V(Int32List, ., TypedData_Int32Array_factory, 1540657744) \ + V(Uint32List, ., TypedData_Uint32Array_factory, 1012511652) \ + V(Int64List, ., TypedData_Int64Array_factory, 1473796807) \ + V(Uint64List, ., TypedData_Uint64Array_factory, 738799620) \ + V(Float32List, ., TypedData_Float32Array_factory, 1938690635) \ + V(Float64List, ., TypedData_Float64Array_factory, 1344005361) \ + V(Float32x4List, ., TypedData_Float32x4Array_factory, 2055067416) \ + V(Int32x4List, ., TypedData_Int32x4Array_factory, 504220232) \ + V(Float64x2List, ., TypedData_Float64x2Array_factory, 416019673) \ #define GRAPH_TYPED_DATA_INTRINSICS_LIST(V) \ - V(_Uint8Array, [], Uint8ArrayGetIndexed, 513704632) \ - V(_Uint8Array, []=, Uint8ArraySetIndexed, 2123520783) \ + V(Uint8List, [], Uint8ArrayGetIndexed, 513704632) \ + V(Uint8List, []=, Uint8ArraySetIndexed, 2123520783) \ V(_ExternalUint8Array, [], ExternalUint8ArrayGetIndexed, 513704632) \ V(_ExternalUint8Array, []=, ExternalUint8ArraySetIndexed, 2123520783) \ - V(_Uint32Array, [], Uint32ArrayGetIndexed, 1179675338) \ - V(_Uint32Array, []=, Uint32ArraySetIndexed, 1455695417) \ - V(_Float64Array, []=, Float64ArraySetIndexed, 1929239576) \ - V(_Float64Array, [], Float64ArrayGetIndexed, 816943529) \ + V(Uint32List, [], Uint32ArrayGetIndexed, 1179675338) \ + V(Uint32List, []=, Uint32ArraySetIndexed, 1455695417) \ + V(Float64List, []=, Float64ArraySetIndexed, 1929239576) \ + V(Float64List, [], Float64ArrayGetIndexed, 816943529) \ V(_TypedList, get:length, TypedDataLength, 546364442) \ - V(_Float32x4, get:x, Float32x4ShuffleX, 1674625343) \ - V(_Float32x4, get:y, Float32x4ShuffleY, 540293915) \ - V(_Float32x4, get:z, Float32x4ShuffleZ, 320347578) \ - V(_Float32x4, get:w, Float32x4ShuffleW, 1770606624) \ - V(_Float32x4, _mul, Float32x4Mul, 861549065) \ - V(_Float32x4, _sub, Float32x4Sub, 460363214) \ - V(_Float32x4, _add, Float32x4Add, 1487592255) \ + V(Float32x4, get:x, Float32x4ShuffleX, 1674625343) \ + V(Float32x4, get:y, Float32x4ShuffleY, 540293915) \ + V(Float32x4, get:z, Float32x4ShuffleZ, 320347578) \ + V(Float32x4, get:w, Float32x4ShuffleW, 1770606624) \ + V(Float32x4, _mul, Float32x4Mul, 861549065) \ + V(Float32x4, _sub, Float32x4Sub, 460363214) \ + V(Float32x4, _add, Float32x4Add, 1487592255) \ #define GRAPH_CORE_INTRINSICS_LIST(V) \ V(_List, get:length, ObjectArrayLength, 630471378) \ @@ -343,24 +343,24 @@ namespace dart { V(_ImmutableList, [], ImmutableArrayGetIndexed, 360400496) \ V(_GrowableList, [], GrowableArrayGetIndexed, 1957529650) \ V(_GrowableList, []=, GrowableArraySetIndexed, 225246870) \ - V(_Float32Array, [], Float32ArrayGetIndexed, 1002307136) \ - V(_Float32Array, []=, Float32ArraySetIndexed, 279546769) \ - V(_Float64Array, [], Float64ArrayGetIndexed, 816943529) \ - V(_Float64Array, []=, Float64ArraySetIndexed, 1929239576) \ - V(_Int8Array, [], Int8ArrayGetIndexed, 1141846285) \ - V(_Int8Array, []=, Int8ArraySetIndexed, 1486839324) \ - V(_Uint8Array, [], Uint8ArrayGetIndexed, 513704632) \ - V(_Uint8Array, []=, Uint8ArraySetIndexed, 2123520783) \ - V(_Uint8ClampedArray, [], Uint8ClampedArrayGetIndexed, 513704632) \ - V(_Uint8ClampedArray, []=, Uint8ClampedArraySetIndexed, 1015846567) \ - V(_Uint16Array, [], Uint16ArrayGetIndexed, 118958722) \ - V(_Uint16Array, []=, Uint16ArraySetIndexed, 658824450) \ - V(_Int16Array, [], Int16ArrayGetIndexed, 1826359619) \ - V(_Int16Array, []=, Int16ArraySetIndexed, 1108689116) \ - V(_Int32Array, [], Int32ArrayGetIndexed, 681203163) \ - V(_Int32Array, []=, Int32ArraySetIndexed, 1786886245) \ - V(_Int64Array, [], Int64ArrayGetIndexed, 1883155004) \ - V(_Int64Array, []=, Int64ArraySetIndexed, 905815059) \ + V(Float32List, [], Float32ArrayGetIndexed, 1002307136) \ + V(Float32List, []=, Float32ArraySetIndexed, 279546769) \ + V(Float64List, [], Float64ArrayGetIndexed, 816943529) \ + V(Float64List, []=, Float64ArraySetIndexed, 1929239576) \ + V(Int8List, [], Int8ArrayGetIndexed, 1141846285) \ + V(Int8List, []=, Int8ArraySetIndexed, 1486839324) \ + V(Uint8List, [], Uint8ArrayGetIndexed, 513704632) \ + V(Uint8List, []=, Uint8ArraySetIndexed, 2123520783) \ + V(Uint8ClampedList, [], Uint8ClampedArrayGetIndexed, 513704632) \ + V(Uint8ClampedList, []=, Uint8ClampedArraySetIndexed, 1015846567) \ + V(Uint16List, [], Uint16ArrayGetIndexed, 118958722) \ + V(Uint16List, []=, Uint16ArraySetIndexed, 658824450) \ + V(Int16List, [], Int16ArrayGetIndexed, 1826359619) \ + V(Int16List, []=, Int16ArraySetIndexed, 1108689116) \ + V(Int32List, [], Int32ArrayGetIndexed, 681203163) \ + V(Int32List, []=, Int32ArraySetIndexed, 1786886245) \ + V(Int64List, [], Int64ArrayGetIndexed, 1883155004) \ + V(Int64List, []=, Int64ArraySetIndexed, 905815059) \ V(_Uint8ArrayView, [], Uint8ArrayViewGetIndexed, 215420949) \ V(_Uint8ArrayView, []=, Uint8ArrayViewSetIndexed, 1138146450) \ V(_Int8ArrayView, [], Int8ArrayViewGetIndexed, 1003520035) \ @@ -412,20 +412,6 @@ namespace dart { V(_HashVMBase, set:_hashMask, LinkedHashMap_setHashMask, 340628211) \ V(_HashVMBase, get:_deletedKeys, LinkedHashMap_getDeletedKeys, 1340385546) \ V(_HashVMBase, set:_deletedKeys, LinkedHashMap_setDeletedKeys, 638315987) \ - V(Uint8List, ., Uint8ListFactory, 1885328419) \ - V(Int8List, ., Int8ListFactory, 551286096) \ - V(Uint16List, ., Uint16ListFactory, 2018994846) \ - V(Int16List, ., Int16ListFactory, 1934285336) \ - V(Uint32List, ., Uint32ListFactory, 990865607) \ - V(Int32List, ., Int32ListFactory, 2017670015) \ - V(Uint64List, ., Uint64ListFactory, 1593070032) \ - V(Int64List, ., Int64ListFactory, 1071205588) \ - V(Float32List, ., Float32ListFactory, 1015272745) \ - V(Float64List, ., Float64ListFactory, 626315429) \ - V(Int32x4List, ., Int32x4ListFactory, 1693091079) \ - V(Float32x4List, ., Float32x4ListFactory, 585154381) \ - V(Float64x2List, ., Float64x2ListFactory, 874435184) - // A list of core function that should never be inlined. #define INLINE_BLACK_LIST(V) \ @@ -474,7 +460,7 @@ class MethodRecognizer : public AllStatic { enum Kind { kUnknown, #define DEFINE_ENUM_LIST(class_name, function_name, enum_name, fp) k##enum_name, -RECOGNIZED_LIST(DEFINE_ENUM_LIST) + RECOGNIZED_LIST(DEFINE_ENUM_LIST) #undef DEFINE_ENUM_LIST kNumRecognizedMethods }; @@ -504,18 +490,18 @@ RECOGNIZED_LIST(DEFINE_ENUM_LIST) V(_ListFactory, kArrayCid, 184405219) \ V(_GrowableListWithData, kGrowableObjectArrayCid, 131424500) \ V(_GrowableListFactory, kGrowableObjectArrayCid, 664918385) \ - V(_Int8ArrayFactory, kTypedDataInt8ArrayCid, 1058992179) \ - V(_Uint8ArrayFactory, kTypedDataUint8ArrayCid, 1807546986) \ - V(_Uint8ClampedArrayFactory, kTypedDataUint8ClampedArrayCid, 548459853) \ - V(_Int16ArrayFactory, kTypedDataInt16ArrayCid, 1796211480) \ - V(_Uint16ArrayFactory, kTypedDataUint16ArrayCid, 1960868166) \ - V(_Int32ArrayFactory, kTypedDataInt32ArrayCid, 372258367) \ - V(_Uint32ArrayFactory, kTypedDataUint32ArrayCid, 1446612721) \ - V(_Int64ArrayFactory, kTypedDataInt64ArrayCid, 964028713) \ - V(_Uint64ArrayFactory, kTypedDataUint64ArrayCid, 721823156) \ - V(_Float64ArrayFactory, kTypedDataFloat64ArrayCid, 42503976) \ - V(_Float32ArrayFactory, kTypedDataFloat32ArrayCid, 392399264) \ - V(_Float32x4ArrayFactory, kTypedDataFloat32x4ArrayCid, 1960198693) \ + V(_Int8ArrayFactory, kTypedDataInt8ArrayCid, 779569635) \ + V(_Uint8ArrayFactory, kTypedDataUint8ArrayCid, 1790399545) \ + V(_Uint8ClampedArrayFactory, kTypedDataUint8ClampedArrayCid, 405875159) \ + V(_Int16ArrayFactory, kTypedDataInt16ArrayCid, 347431914) \ + V(_Uint16ArrayFactory, kTypedDataUint16ArrayCid, 121990116) \ + V(_Int32ArrayFactory, kTypedDataInt32ArrayCid, 1540657744) \ + V(_Uint32ArrayFactory, kTypedDataUint32ArrayCid, 1012511652) \ + V(_Int64ArrayFactory, kTypedDataInt64ArrayCid, 1473796807) \ + V(_Uint64ArrayFactory, kTypedDataUint64ArrayCid, 738799620) \ + V(_Float64ArrayFactory, kTypedDataFloat64ArrayCid, 1344005361) \ + V(_Float32ArrayFactory, kTypedDataFloat32ArrayCid, 1938690635) \ + V(_Float32x4ArrayFactory, kTypedDataFloat32x4ArrayCid, 2055067416) \ // Class that recognizes factories and returns corresponding result cid. diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc index 08ae43c9bb2..d2ceb636311 100644 --- a/runtime/vm/object.cc +++ b/runtime/vm/object.cc @@ -1438,10 +1438,10 @@ NOT_IN_PRODUCT( ASSERT(!lib.IsNull()); ASSERT(lib.raw() == Library::TypedDataLibrary()); #define REGISTER_TYPED_DATA_CLASS(clazz) \ - cls = Class::NewTypedDataClass(kTypedData##clazz##Cid); \ - RegisterPrivateClass(cls, Symbols::_##clazz(), lib); \ + cls = Class::NewTypedDataClass(kTypedData##clazz##ArrayCid); \ + RegisterClass(cls, Symbols::clazz##List(), lib); \ - CLASS_LIST_TYPED_DATA(REGISTER_TYPED_DATA_CLASS); + DART_CLASS_LIST_TYPED_DATA(REGISTER_TYPED_DATA_CLASS); #undef REGISTER_TYPED_DATA_CLASS #define REGISTER_TYPED_DATA_VIEW_CLASS(clazz) \ cls = Class::NewTypedDataViewClass(kTypedData##clazz##ViewCid); \ @@ -1460,46 +1460,39 @@ NOT_IN_PRODUCT( cls = Class::New(kByteBufferCid); cls.set_instance_size(0); cls.set_next_field_offset(-kWordSize); - RegisterPrivateClass(cls, Symbols::_ByteBuffer(), lib); + RegisterClass(cls, Symbols::ByteBuffer(), lib); pending_classes.Add(cls); CLASS_LIST_TYPED_DATA(REGISTER_EXT_TYPED_DATA_CLASS); #undef REGISTER_EXT_TYPED_DATA_CLASS // Register Float32x4 and Int32x4 in the object store. cls = Class::New(); - object_store->set_float32x4_class(cls); - RegisterPrivateClass(cls, Symbols::_Float32x4(), lib); - cls = Class::New(); - object_store->set_int32x4_class(cls); - RegisterPrivateClass(cls, Symbols::_Int32x4(), lib); - cls = Class::New(); - object_store->set_float64x2_class(cls); - RegisterPrivateClass(cls, Symbols::_Float64x2(), lib); - - cls = Class::New(kIllegalCid); RegisterClass(cls, Symbols::Float32x4(), lib); cls.set_num_type_arguments(0); cls.set_num_own_type_arguments(0); cls.set_is_prefinalized(); pending_classes.Add(cls); + object_store->set_float32x4_class(cls); type = Type::NewNonParameterizedType(cls); object_store->set_float32x4_type(type); - cls = Class::New(kIllegalCid); + cls = Class::New(); RegisterClass(cls, Symbols::Int32x4(), lib); cls.set_num_type_arguments(0); cls.set_num_own_type_arguments(0); cls.set_is_prefinalized(); pending_classes.Add(cls); + object_store->set_int32x4_class(cls); type = Type::NewNonParameterizedType(cls); object_store->set_int32x4_type(type); - cls = Class::New(kIllegalCid); + cls = Class::New(); RegisterClass(cls, Symbols::Float64x2(), lib); cls.set_num_type_arguments(0); cls.set_num_own_type_arguments(0); cls.set_is_prefinalized(); pending_classes.Add(cls); + object_store->set_float64x2_class(cls); type = Type::NewNonParameterizedType(cls); object_store->set_float64x2_type(type); @@ -7052,7 +7045,6 @@ bool Function::CheckSourceFingerprint(const char* prefix, int32_t fp) const { // This output can be copied into a file, then used with sed // to replace the old values. // sed -i .bak -f /tmp/newkeys runtime/vm/method_recognizer.h - // sed -i .bak -f /tmp/newkeys runtime/vm/flow_graph_builder.h THR_Print("s/V(%s, %d)/V(%s, %d)/\n", prefix, fp, prefix, SourceFingerprint()); } else { diff --git a/runtime/vm/precompiler.cc b/runtime/vm/precompiler.cc index e91e0ccee00..67ba031c8b3 100644 --- a/runtime/vm/precompiler.cc +++ b/runtime/vm/precompiler.cc @@ -313,7 +313,7 @@ void Precompiler::AddRoots(Dart_QualifiedFunctionName embedder_entry_points[]) { { "dart:isolate", "_SendPortImpl", "send" }, { "dart:typed_data", "ByteData", "ByteData." }, { "dart:typed_data", "ByteData", "ByteData._view" }, - { "dart:typed_data", "_ByteBuffer", "_ByteBuffer._New" }, + { "dart:typed_data", "ByteBuffer", "ByteBuffer._New" }, { "dart:_vmservice", "::", "_registerIsolate" }, { "dart:_vmservice", "::", "boot" }, { "dart:developer", "Metrics", "_printMetrics" }, diff --git a/runtime/vm/profiler_test.cc b/runtime/vm/profiler_test.cc index eff7f03d6c3..d923897ba6b 100644 --- a/runtime/vm/profiler_test.cc +++ b/runtime/vm/profiler_test.cc @@ -958,7 +958,7 @@ TEST_CASE(Profiler_TypedArrayAllocation) { Library::Handle(isolate->object_store()->typed_data_library()); const Class& float32_list_class = - Class::Handle(GetClass(typed_data_library, "_Float32Array")); + Class::Handle(GetClass(typed_data_library, "Float32List")); EXPECT(!float32_list_class.IsNull()); Dart_Handle result = Dart_Invoke(lib, NewString("foo"), 0, NULL); @@ -990,8 +990,6 @@ TEST_CASE(Profiler_TypedArrayAllocation) { walker.Reset(Profile::kExclusiveCode); EXPECT(walker.Down()); - EXPECT_STREQ("_Float32Array._Float32Array", walker.CurrentName()); - EXPECT(walker.Down()); EXPECT_STREQ("Float32List.Float32List", walker.CurrentName()); EXPECT(walker.Down()); EXPECT_STREQ("foo", walker.CurrentName()); diff --git a/runtime/vm/raw_object.h b/runtime/vm/raw_object.h index f438fc9366d..6f33280dd30 100644 --- a/runtime/vm/raw_object.h +++ b/runtime/vm/raw_object.h @@ -108,6 +108,22 @@ namespace dart { V(Int32x4Array) \ V(Float64x2Array) \ +#define DART_CLASS_LIST_TYPED_DATA(V) \ + V(Int8) \ + V(Uint8) \ + V(Uint8Clamped) \ + V(Int16) \ + V(Uint16) \ + V(Int32) \ + V(Uint32) \ + V(Int64) \ + V(Uint64) \ + V(Float32) \ + V(Float64) \ + V(Float32x4) \ + V(Int32x4) \ + V(Float64x2) + #define CLASS_LIST_FOR_HANDLES(V) \ CLASS_LIST_NO_OBJECT_NOR_STRING_NOR_ARRAY(V) \ V(Array) \ diff --git a/runtime/vm/symbols.h b/runtime/vm/symbols.h index 5b31bef7565..f15e1386a92 100644 --- a/runtime/vm/symbols.h +++ b/runtime/vm/symbols.h @@ -206,9 +206,6 @@ class ObjectPointerVisitor; V(Object, "Object") \ V(Int, "int") \ V(Double, "double") \ - V(_Float32x4, "_Float32x4") \ - V(_Float64x2, "_Float64x2") \ - V(_Int32x4, "_Int32x4") \ V(Float32x4, "Float32x4") \ V(Float64x2, "Float64x2") \ V(Int32x4, "Int32x4") \ @@ -226,34 +223,20 @@ class ObjectPointerVisitor; V(Float64x2List, "Float64x2List") \ V(Float32List, "Float32List") \ V(Float64List, "Float64List") \ - V(_Int8Array, "_Int8Array") \ - V(_Int8ArrayFactory, "_Int8Array.") \ - V(_Uint8Array, "_Uint8Array") \ - V(_Uint8ArrayFactory, "_Uint8Array.") \ - V(_Uint8ClampedArray, "_Uint8ClampedArray") \ - V(_Uint8ClampedArrayFactory, "_Uint8ClampedArray.") \ - V(_Int16Array, "_Int16Array") \ - V(_Int16ArrayFactory, "_Int16Array.") \ - V(_Uint16Array, "_Uint16Array") \ - V(_Uint16ArrayFactory, "_Uint16Array.") \ - V(_Int32Array, "_Int32Array") \ - V(_Int32ArrayFactory, "_Int32Array.") \ - V(_Uint32Array, "_Uint32Array") \ - V(_Uint32ArrayFactory, "_Uint32Array.") \ - V(_Int64Array, "_Int64Array") \ - V(_Int64ArrayFactory, "_Int64Array.") \ - V(_Uint64Array, "_Uint64Array") \ - V(_Uint64ArrayFactory, "_Uint64Array.") \ - V(_Float32x4Array, "_Float32x4Array") \ - V(_Float32x4ArrayFactory, "_Float32x4Array.") \ - V(_Int32x4Array, "_Int32x4Array") \ - V(_Int32x4ArrayFactory, "_Int32x4Array.") \ - V(_Float64x2Array, "_Float64x2Array") \ - V(_Float64x2ArrayFactory, "_Float64x2Array.") \ - V(_Float32Array, "_Float32Array") \ - V(_Float32ArrayFactory, "_Float32Array.") \ - V(_Float64Array, "_Float64Array") \ - V(_Float64ArrayFactory, "_Float64Array.") \ + V(_Int8ArrayFactory, "Int8List.") \ + V(_Uint8ArrayFactory, "Uint8List.") \ + V(_Uint8ClampedArrayFactory, "Uint8ClampedList.") \ + V(_Int16ArrayFactory, "Int16List.") \ + V(_Uint16ArrayFactory, "Uint16List.") \ + V(_Int32ArrayFactory, "Int32List.") \ + V(_Uint32ArrayFactory, "Uint32List.") \ + V(_Int64ArrayFactory, "Int64List.") \ + V(_Uint64ArrayFactory, "Uint64List.") \ + V(_Float32x4ArrayFactory, "Float32x4List.") \ + V(_Int32x4ArrayFactory, "Int32x4List.") \ + V(_Float64x2ArrayFactory, "Float64x2List.") \ + V(_Float32ArrayFactory, "Float32List.") \ + V(_Float64ArrayFactory, "Float64List.") \ V(_Int8ArrayView, "_Int8ArrayView") \ V(_Uint8ArrayView, "_Uint8ArrayView") \ V(_Uint8ClampedArrayView, "_Uint8ClampedArrayView") \ @@ -286,8 +269,8 @@ class ObjectPointerVisitor; V(ByteDataDot, "ByteData.") \ V(ByteDataDot_view, "ByteData._view") \ V(_ByteDataView, "_ByteDataView") \ - V(_ByteBuffer, "_ByteBuffer") \ - V(_ByteBufferDot_New, "_ByteBuffer._New") \ + V(ByteBuffer, "ByteBuffer") \ + V(ByteBufferDot_New, "ByteBuffer._New") \ V(_WeakProperty, "_WeakProperty") \ V(_MirrorReference, "_MirrorReference") \ V(InvocationMirror, "_InvocationMirror") \ diff --git a/runtime/vm/vm.gypi b/runtime/vm/vm.gypi index 0f857b39d22..a08a1b8bb5a 100644 --- a/runtime/vm/vm.gypi +++ b/runtime/vm/vm.gypi @@ -30,7 +30,6 @@ 'snapshot_test_in_dat_file': 'snapshot_test_in.dat', 'snapshot_test_dart_file': 'snapshot_test.dart', 'typed_data_cc_file': '<(gen_source_dir)/typed_data_gen.cc', - 'typed_data_patch_cc_file': '<(gen_source_dir)/typed_data_patch_gen.cc', 'vmservice_cc_file': '<(gen_source_dir)/vmservice_gen.cc', 'vmservice_patch_cc_file': '<(gen_source_dir)/vmservice_patch_gen.cc', }, @@ -234,7 +233,6 @@ 'generate_mirrors_patch_cc_file#host', 'generate_profiler_cc_file#host', 'generate_typed_data_cc_file#host', - 'generate_typed_data_patch_cc_file#host', 'generate_vmservice_cc_file#host', 'generate_vmservice_patch_cc_file#host', ], @@ -273,7 +271,6 @@ '<(mirrors_patch_cc_file)', '<(profiler_cc_file)', '<(typed_data_cc_file)', - '<(typed_data_patch_cc_file)', '<(vmservice_cc_file)', '<(vmservice_patch_cc_file)', ], @@ -974,8 +971,8 @@ 'type': 'none', 'toolsets':['host'], 'includes': [ - # Load the shared library sources. - '../../sdk/lib/typed_data/typed_data_sources.gypi', + # Load the runtime implementation sources. + '../lib/typed_data_sources.gypi', ], 'sources/': [ # Exclude all .[cc|h] files. @@ -1009,46 +1006,6 @@ }, ] }, - { - 'target_name': 'generate_typed_data_patch_cc_file', - 'type': 'none', - 'toolsets':['host'], - 'includes': [ - # Load the runtime implementation sources. - '../lib/typed_data_sources.gypi', - ], - 'sources/': [ - # Exclude all .[cc|h] files. - # This is only here for reference. Excludes happen after - # variable expansion, so the script has to do its own - # exclude processing of the sources being passed. - ['exclude', '\\.cc|h$'], - ], - 'actions': [ - { - 'action_name': 'generate_typed_data_patch_cc', - 'inputs': [ - '../tools/gen_library_src_paths.py', - '<(libgen_in_cc_file)', - '<@(_sources)', - ], - 'outputs': [ - '<(typed_data_patch_cc_file)', - ], - 'action': [ - 'python', - 'tools/gen_library_src_paths.py', - '--output', '<(typed_data_patch_cc_file)', - '--input_cc', '<(libgen_in_cc_file)', - '--include', 'vm/bootstrap.h', - '--var_name', 'dart::Bootstrap::typed_data_patch_paths_', - '--library_name', 'dart:typed_data', - '<@(_sources)', - ], - 'message': 'Generating ''<(typed_data_patch_cc_file)'' file.' - }, - ] - }, { 'target_name': 'generate_profiler_cc_file', 'type': 'none',