OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #ifndef VM_RAW_OBJECT_H_ | 5 #ifndef VM_RAW_OBJECT_H_ |
6 #define VM_RAW_OBJECT_H_ | 6 #define VM_RAW_OBJECT_H_ |
7 | 7 |
8 #include "platform/assert.h" | 8 #include "platform/assert.h" |
9 #include "vm/globals.h" | 9 #include "vm/globals.h" |
10 #include "vm/token.h" | 10 #include "vm/token.h" |
(...skipping 1365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1376 friend class SnapshotReader; | 1376 friend class SnapshotReader; |
1377 }; | 1377 }; |
1378 | 1378 |
1379 | 1379 |
1380 class RawFloat32x4 : public RawInstance { | 1380 class RawFloat32x4 : public RawInstance { |
1381 RAW_HEAP_OBJECT_IMPLEMENTATION(Float32x4); | 1381 RAW_HEAP_OBJECT_IMPLEMENTATION(Float32x4); |
1382 | 1382 |
1383 float value_[4]; | 1383 float value_[4]; |
1384 | 1384 |
1385 friend class SnapshotReader; | 1385 friend class SnapshotReader; |
| 1386 public: |
| 1387 float x() const { return value_[0]; } |
| 1388 float y() const { return value_[1]; } |
| 1389 float z() const { return value_[2]; } |
| 1390 float w() const { return value_[3]; } |
1386 }; | 1391 }; |
1387 | 1392 |
1388 | 1393 |
1389 class RawUint32x4 : public RawInstance { | 1394 class RawUint32x4 : public RawInstance { |
1390 RAW_HEAP_OBJECT_IMPLEMENTATION(Uint32x4); | 1395 RAW_HEAP_OBJECT_IMPLEMENTATION(Uint32x4); |
1391 | 1396 |
1392 uint32_t value_[4]; | 1397 uint32_t value_[4]; |
1393 | 1398 |
1394 friend class SnapshotReader; | 1399 friend class SnapshotReader; |
| 1400 public: |
| 1401 uint32_t x() const { return value_[0]; } |
| 1402 uint32_t y() const { return value_[1]; } |
| 1403 uint32_t z() const { return value_[2]; } |
| 1404 uint32_t w() const { return value_[3]; } |
1395 }; | 1405 }; |
1396 | 1406 |
1397 | 1407 |
1398 // Define an aliases for intptr_t. | 1408 // Define an aliases for intptr_t. |
1399 #if defined(ARCH_IS_32_BIT) | 1409 #if defined(ARCH_IS_32_BIT) |
1400 #define RawIntPtrArray RawInt32Array | 1410 #define RawIntPtrArray RawInt32Array |
1401 #define IntPtrArray Int32Array | 1411 #define IntPtrArray Int32Array |
1402 #elif defined(ARCH_IS_64_BIT) | 1412 #elif defined(ARCH_IS_64_BIT) |
1403 #define RawIntPtrArray RawInt64Array | 1413 #define RawIntPtrArray RawInt64Array |
1404 #define IntPtrArray Int64Array | 1414 #define IntPtrArray Int64Array |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1518 | 1528 |
1519 // Variable length data follows here. | 1529 // Variable length data follows here. |
1520 uint64_t data_[0]; | 1530 uint64_t data_[0]; |
1521 }; | 1531 }; |
1522 | 1532 |
1523 | 1533 |
1524 class RawFloat32x4Array : public RawByteArray { | 1534 class RawFloat32x4Array : public RawByteArray { |
1525 RAW_HEAP_OBJECT_IMPLEMENTATION(Float32x4Array); | 1535 RAW_HEAP_OBJECT_IMPLEMENTATION(Float32x4Array); |
1526 | 1536 |
1527 // Variable length data follows here. | 1537 // Variable length data follows here. |
1528 simd_value_t data_[0]; | 1538 simd128_value_t data_[0]; |
1529 }; | 1539 }; |
1530 | 1540 |
1531 class RawFloat32Array : public RawByteArray { | 1541 class RawFloat32Array : public RawByteArray { |
1532 RAW_HEAP_OBJECT_IMPLEMENTATION(Float32Array); | 1542 RAW_HEAP_OBJECT_IMPLEMENTATION(Float32Array); |
1533 | 1543 |
1534 // Variable length data follows here. | 1544 // Variable length data follows here. |
1535 float data_[0]; | 1545 float data_[0]; |
1536 }; | 1546 }; |
1537 | 1547 |
1538 | 1548 |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1613 RAW_HEAP_OBJECT_IMPLEMENTATION(ExternalUint64Array); | 1623 RAW_HEAP_OBJECT_IMPLEMENTATION(ExternalUint64Array); |
1614 | 1624 |
1615 uint64_t* data_; | 1625 uint64_t* data_; |
1616 void* peer_; | 1626 void* peer_; |
1617 }; | 1627 }; |
1618 | 1628 |
1619 | 1629 |
1620 class RawExternalFloat32x4Array : public RawByteArray { | 1630 class RawExternalFloat32x4Array : public RawByteArray { |
1621 RAW_HEAP_OBJECT_IMPLEMENTATION(ExternalFloat32x4Array); | 1631 RAW_HEAP_OBJECT_IMPLEMENTATION(ExternalFloat32x4Array); |
1622 | 1632 |
1623 simd_value_t* data_; | 1633 simd128_value_t* data_; |
1624 void* peer_; | 1634 void* peer_; |
1625 }; | 1635 }; |
1626 | 1636 |
1627 | 1637 |
1628 class RawExternalFloat32Array : public RawByteArray { | 1638 class RawExternalFloat32Array : public RawByteArray { |
1629 RAW_HEAP_OBJECT_IMPLEMENTATION(ExternalFloat32Array); | 1639 RAW_HEAP_OBJECT_IMPLEMENTATION(ExternalFloat32Array); |
1630 | 1640 |
1631 float* data_; | 1641 float* data_; |
1632 void* peer_; | 1642 void* peer_; |
1633 }; | 1643 }; |
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1895 inline intptr_t RawObject::NumberOfTypedDataClasses() { | 1905 inline intptr_t RawObject::NumberOfTypedDataClasses() { |
1896 // Make sure this is updated when new TypedData types are added. | 1906 // Make sure this is updated when new TypedData types are added. |
1897 ASSERT(kExternalTypedDataInt8ArrayCid == kTypedDataInt8ArrayCid + 11); | 1907 ASSERT(kExternalTypedDataInt8ArrayCid == kTypedDataInt8ArrayCid + 11); |
1898 ASSERT(kNullCid == kExternalTypedDataInt8ArrayCid + 11); | 1908 ASSERT(kNullCid == kExternalTypedDataInt8ArrayCid + 11); |
1899 return (kNullCid - kTypedDataInt8ArrayCid); | 1909 return (kNullCid - kTypedDataInt8ArrayCid); |
1900 } | 1910 } |
1901 | 1911 |
1902 } // namespace dart | 1912 } // namespace dart |
1903 | 1913 |
1904 #endif // VM_RAW_OBJECT_H_ | 1914 #endif // VM_RAW_OBJECT_H_ |
OLD | NEW |