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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 V(Number) \ | 54 V(Number) \ |
55 V(Integer) \ | 55 V(Integer) \ |
56 V(Smi) \ | 56 V(Smi) \ |
57 V(Mint) \ | 57 V(Mint) \ |
58 V(Bigint) \ | 58 V(Bigint) \ |
59 V(Double) \ | 59 V(Double) \ |
60 V(Bool) \ | 60 V(Bool) \ |
61 V(Array) \ | 61 V(Array) \ |
62 V(ImmutableArray) \ | 62 V(ImmutableArray) \ |
63 V(GrowableObjectArray) \ | 63 V(GrowableObjectArray) \ |
| 64 V(Simd128Float32) \ |
| 65 V(Simd128Mask) \ |
64 V(ByteArray) \ | 66 V(ByteArray) \ |
65 V(Int8Array) \ | 67 V(Int8Array) \ |
66 V(Uint8Array) \ | 68 V(Uint8Array) \ |
67 V(Uint8ClampedArray) \ | 69 V(Uint8ClampedArray) \ |
68 V(Int16Array) \ | 70 V(Int16Array) \ |
69 V(Uint16Array) \ | 71 V(Uint16Array) \ |
70 V(Int32Array) \ | 72 V(Int32Array) \ |
71 V(Uint32Array) \ | 73 V(Uint32Array) \ |
72 V(Int64Array) \ | 74 V(Int64Array) \ |
73 V(Uint64Array) \ | 75 V(Uint64Array) \ |
| 76 V(Simd128Float32Array) \ |
74 V(Float32Array) \ | 77 V(Float32Array) \ |
75 V(Float64Array) \ | 78 V(Float64Array) \ |
76 V(ExternalInt8Array) \ | 79 V(ExternalInt8Array) \ |
77 V(ExternalUint8Array) \ | 80 V(ExternalUint8Array) \ |
78 V(ExternalUint8ClampedArray) \ | 81 V(ExternalUint8ClampedArray) \ |
79 V(ExternalInt16Array) \ | 82 V(ExternalInt16Array) \ |
80 V(ExternalUint16Array) \ | 83 V(ExternalUint16Array) \ |
81 V(ExternalInt32Array) \ | 84 V(ExternalInt32Array) \ |
82 V(ExternalUint32Array) \ | 85 V(ExternalUint32Array) \ |
83 V(ExternalInt64Array) \ | 86 V(ExternalInt64Array) \ |
84 V(ExternalUint64Array) \ | 87 V(ExternalUint64Array) \ |
| 88 V(ExternalSimd128Float32Array) \ |
85 V(ExternalFloat32Array) \ | 89 V(ExternalFloat32Array) \ |
86 V(ExternalFloat64Array) \ | 90 V(ExternalFloat64Array) \ |
87 V(Stacktrace) \ | 91 V(Stacktrace) \ |
88 V(JSRegExp) \ | 92 V(JSRegExp) \ |
89 V(WeakProperty) \ | 93 V(WeakProperty) \ |
90 V(DartFunction) \ | 94 V(DartFunction) \ |
91 | 95 |
92 #define CLASS_LIST_STRINGS(V) \ | 96 #define CLASS_LIST_STRINGS(V) \ |
93 V(String) \ | 97 V(String) \ |
94 V(OneByteString) \ | 98 V(OneByteString) \ |
(...skipping 1199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1294 RawSmi* length_; | 1298 RawSmi* length_; |
1295 RawArray* data_; | 1299 RawArray* data_; |
1296 RawObject** to() { | 1300 RawObject** to() { |
1297 return reinterpret_cast<RawObject**>(&ptr()->data_); | 1301 return reinterpret_cast<RawObject**>(&ptr()->data_); |
1298 } | 1302 } |
1299 | 1303 |
1300 friend class SnapshotReader; | 1304 friend class SnapshotReader; |
1301 }; | 1305 }; |
1302 | 1306 |
1303 | 1307 |
| 1308 class RawSimd128Float32 : public RawInstance { |
| 1309 RAW_HEAP_OBJECT_IMPLEMENTATION(Simd128Float32); |
| 1310 |
| 1311 float value_[4]; |
| 1312 |
| 1313 friend class SnapshotReader; |
| 1314 }; |
| 1315 |
| 1316 |
| 1317 class RawSimd128Mask : public RawInstance { |
| 1318 RAW_HEAP_OBJECT_IMPLEMENTATION(Simd128Mask); |
| 1319 |
| 1320 uint32_t value_[4]; |
| 1321 |
| 1322 friend class SnapshotReader; |
| 1323 }; |
| 1324 |
| 1325 |
1304 // Define an aliases for intptr_t. | 1326 // Define an aliases for intptr_t. |
1305 #if defined(ARCH_IS_32_BIT) | 1327 #if defined(ARCH_IS_32_BIT) |
1306 #define RawIntPtrArray RawInt32Array | 1328 #define RawIntPtrArray RawInt32Array |
1307 #define IntPtrArray Int32Array | 1329 #define IntPtrArray Int32Array |
1308 #elif defined(ARCH_IS_64_BIT) | 1330 #elif defined(ARCH_IS_64_BIT) |
1309 #define RawIntPtrArray RawInt64Array | 1331 #define RawIntPtrArray RawInt64Array |
1310 #define IntPtrArray Int64Array | 1332 #define IntPtrArray Int64Array |
1311 #else | 1333 #else |
1312 #error Architecture is not 32-bit or 64-bit. | 1334 #error Architecture is not 32-bit or 64-bit. |
1313 #endif // ARCH_IS_32_BIT | 1335 #endif // ARCH_IS_32_BIT |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1394 | 1416 |
1395 | 1417 |
1396 class RawUint64Array : public RawByteArray { | 1418 class RawUint64Array : public RawByteArray { |
1397 RAW_HEAP_OBJECT_IMPLEMENTATION(Uint64Array); | 1419 RAW_HEAP_OBJECT_IMPLEMENTATION(Uint64Array); |
1398 | 1420 |
1399 // Variable length data follows here. | 1421 // Variable length data follows here. |
1400 uint64_t data_[0]; | 1422 uint64_t data_[0]; |
1401 }; | 1423 }; |
1402 | 1424 |
1403 | 1425 |
| 1426 class RawSimd128Float32Array : public RawByteArray { |
| 1427 RAW_HEAP_OBJECT_IMPLEMENTATION(Simd128Float32Array); |
| 1428 |
| 1429 // Variable length data follows here. |
| 1430 simd_value_t data_[0]; |
| 1431 }; |
| 1432 |
1404 class RawFloat32Array : public RawByteArray { | 1433 class RawFloat32Array : public RawByteArray { |
1405 RAW_HEAP_OBJECT_IMPLEMENTATION(Float32Array); | 1434 RAW_HEAP_OBJECT_IMPLEMENTATION(Float32Array); |
1406 | 1435 |
1407 // Variable length data follows here. | 1436 // Variable length data follows here. |
1408 float data_[0]; | 1437 float data_[0]; |
1409 }; | 1438 }; |
1410 | 1439 |
1411 | 1440 |
1412 class RawFloat64Array : public RawByteArray { | 1441 class RawFloat64Array : public RawByteArray { |
1413 RAW_HEAP_OBJECT_IMPLEMENTATION(Float64Array); | 1442 RAW_HEAP_OBJECT_IMPLEMENTATION(Float64Array); |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1483 | 1512 |
1484 | 1513 |
1485 class RawExternalUint64Array : public RawByteArray { | 1514 class RawExternalUint64Array : public RawByteArray { |
1486 RAW_HEAP_OBJECT_IMPLEMENTATION(ExternalUint64Array); | 1515 RAW_HEAP_OBJECT_IMPLEMENTATION(ExternalUint64Array); |
1487 | 1516 |
1488 uint64_t* data_; | 1517 uint64_t* data_; |
1489 void* peer_; | 1518 void* peer_; |
1490 }; | 1519 }; |
1491 | 1520 |
1492 | 1521 |
| 1522 class RawExternalSimd128Float32Array : public RawByteArray { |
| 1523 RAW_HEAP_OBJECT_IMPLEMENTATION(ExternalSimd128Float32Array); |
| 1524 |
| 1525 simd_value_t* data_; |
| 1526 void* peer_; |
| 1527 }; |
| 1528 |
| 1529 |
1493 class RawExternalFloat32Array : public RawByteArray { | 1530 class RawExternalFloat32Array : public RawByteArray { |
1494 RAW_HEAP_OBJECT_IMPLEMENTATION(ExternalFloat32Array); | 1531 RAW_HEAP_OBJECT_IMPLEMENTATION(ExternalFloat32Array); |
1495 | 1532 |
1496 float* data_; | 1533 float* data_; |
1497 void* peer_; | 1534 void* peer_; |
1498 }; | 1535 }; |
1499 | 1536 |
1500 | 1537 |
1501 class RawExternalFloat64Array : public RawByteArray { | 1538 class RawExternalFloat64Array : public RawByteArray { |
1502 RAW_HEAP_OBJECT_IMPLEMENTATION(ExternalFloat64Array); | 1539 RAW_HEAP_OBJECT_IMPLEMENTATION(ExternalFloat64Array); |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1699 kExternalUint64ArrayCid == kExternalInt8ArrayCid + 8 && | 1736 kExternalUint64ArrayCid == kExternalInt8ArrayCid + 8 && |
1700 kExternalFloat32ArrayCid == kExternalInt8ArrayCid + 9 && | 1737 kExternalFloat32ArrayCid == kExternalInt8ArrayCid + 9 && |
1701 kExternalFloat64ArrayCid == kExternalInt8ArrayCid + 10 && | 1738 kExternalFloat64ArrayCid == kExternalInt8ArrayCid + 10 && |
1702 kStacktraceCid == kExternalInt8ArrayCid + 11); | 1739 kStacktraceCid == kExternalInt8ArrayCid + 11); |
1703 return (index >= kExternalInt8ArrayCid && index <= kExternalFloat64ArrayCid); | 1740 return (index >= kExternalInt8ArrayCid && index <= kExternalFloat64ArrayCid); |
1704 } | 1741 } |
1705 | 1742 |
1706 } // namespace dart | 1743 } // namespace dart |
1707 | 1744 |
1708 #endif // VM_RAW_OBJECT_H_ | 1745 #endif // VM_RAW_OBJECT_H_ |
OLD | NEW |