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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 V(Float64x2) \ | 65 V(Float64x2) \ |
66 V(TypedData) \ | 66 V(TypedData) \ |
67 V(ExternalTypedData) \ | 67 V(ExternalTypedData) \ |
68 V(Capability) \ | 68 V(Capability) \ |
69 V(ReceivePort) \ | 69 V(ReceivePort) \ |
70 V(SendPort) \ | 70 V(SendPort) \ |
71 V(Stacktrace) \ | 71 V(Stacktrace) \ |
72 V(JSRegExp) \ | 72 V(JSRegExp) \ |
73 V(WeakProperty) \ | 73 V(WeakProperty) \ |
74 V(MirrorReference) \ | 74 V(MirrorReference) \ |
| 75 V(LinkedHashMap) \ |
75 V(UserTag) \ | 76 V(UserTag) \ |
76 | 77 |
77 #define CLASS_LIST_ARRAYS(V) \ | 78 #define CLASS_LIST_ARRAYS(V) \ |
78 V(Array) \ | 79 V(Array) \ |
79 V(ImmutableArray) \ | 80 V(ImmutableArray) \ |
80 | 81 |
81 #define CLASS_LIST_STRINGS(V) \ | 82 #define CLASS_LIST_STRINGS(V) \ |
82 V(String) \ | 83 V(String) \ |
83 V(OneByteString) \ | 84 V(OneByteString) \ |
84 V(TwoByteString) \ | 85 V(TwoByteString) \ |
(...skipping 1360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1445 // Variable length data follows here. | 1446 // Variable length data follows here. |
1446 RawObject** data() { OPEN_ARRAY_START(RawObject*, RawObject*); } | 1447 RawObject** data() { OPEN_ARRAY_START(RawObject*, RawObject*); } |
1447 RawObject** to(intptr_t length) { | 1448 RawObject** to(intptr_t length) { |
1448 return reinterpret_cast<RawObject**>(&ptr()->data()[length - 1]); | 1449 return reinterpret_cast<RawObject**>(&ptr()->data()[length - 1]); |
1449 } | 1450 } |
1450 | 1451 |
1451 friend class RawCode; | 1452 friend class RawCode; |
1452 friend class RawImmutableArray; | 1453 friend class RawImmutableArray; |
1453 friend class SnapshotReader; | 1454 friend class SnapshotReader; |
1454 friend class GrowableObjectArray; | 1455 friend class GrowableObjectArray; |
| 1456 friend class LinkedHashMap; |
1455 friend class Object; | 1457 friend class Object; |
1456 friend class ICData; // For high performance access. | 1458 friend class ICData; // For high performance access. |
1457 friend class SubtypeTestCache; // For high performance access. | 1459 friend class SubtypeTestCache; // For high performance access. |
1458 }; | 1460 }; |
1459 | 1461 |
1460 | 1462 |
1461 class RawImmutableArray : public RawArray { | 1463 class RawImmutableArray : public RawArray { |
1462 RAW_HEAP_OBJECT_IMPLEMENTATION(ImmutableArray); | 1464 RAW_HEAP_OBJECT_IMPLEMENTATION(ImmutableArray); |
1463 | 1465 |
1464 friend class SnapshotReader; | 1466 friend class SnapshotReader; |
(...skipping 10 matching lines...) Expand all Loading... |
1475 RawSmi* length_; | 1477 RawSmi* length_; |
1476 RawArray* data_; | 1478 RawArray* data_; |
1477 RawObject** to() { | 1479 RawObject** to() { |
1478 return reinterpret_cast<RawObject**>(&ptr()->data_); | 1480 return reinterpret_cast<RawObject**>(&ptr()->data_); |
1479 } | 1481 } |
1480 | 1482 |
1481 friend class SnapshotReader; | 1483 friend class SnapshotReader; |
1482 }; | 1484 }; |
1483 | 1485 |
1484 | 1486 |
| 1487 class RawLinkedHashMap : public RawInstance { |
| 1488 RAW_HEAP_OBJECT_IMPLEMENTATION(LinkedHashMap); |
| 1489 |
| 1490 RawObject** from() { |
| 1491 return reinterpret_cast<RawObject**>(&ptr()->type_arguments_); |
| 1492 } |
| 1493 RawTypeArguments* type_arguments_; |
| 1494 RawInstance* cme_mark_; |
| 1495 RawArray* data_; |
| 1496 RawObject** to() { |
| 1497 return reinterpret_cast<RawObject**>(&ptr()->data_); |
| 1498 } |
| 1499 |
| 1500 friend class SnapshotReader; |
| 1501 }; |
| 1502 |
| 1503 |
1485 class RawFloat32x4 : public RawInstance { | 1504 class RawFloat32x4 : public RawInstance { |
1486 RAW_HEAP_OBJECT_IMPLEMENTATION(Float32x4); | 1505 RAW_HEAP_OBJECT_IMPLEMENTATION(Float32x4); |
1487 | 1506 |
1488 float value_[4]; | 1507 float value_[4]; |
1489 | 1508 |
1490 friend class SnapshotReader; | 1509 friend class SnapshotReader; |
1491 public: | 1510 public: |
1492 float x() const { return value_[0]; } | 1511 float x() const { return value_[0]; } |
1493 float y() const { return value_[1]; } | 1512 float y() const { return value_[1]; } |
1494 float z() const { return value_[2]; } | 1513 float z() const { return value_[2]; } |
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1896 COMPILE_ASSERT(kTypedDataInt8ArrayViewCid == kTypedDataInt8ArrayCid + 14); | 1915 COMPILE_ASSERT(kTypedDataInt8ArrayViewCid == kTypedDataInt8ArrayCid + 14); |
1897 COMPILE_ASSERT(kExternalTypedDataInt8ArrayCid == | 1916 COMPILE_ASSERT(kExternalTypedDataInt8ArrayCid == |
1898 kTypedDataInt8ArrayViewCid + 15); | 1917 kTypedDataInt8ArrayViewCid + 15); |
1899 COMPILE_ASSERT(kNullCid == kExternalTypedDataInt8ArrayCid + 14); | 1918 COMPILE_ASSERT(kNullCid == kExternalTypedDataInt8ArrayCid + 14); |
1900 return (kNullCid - kTypedDataInt8ArrayCid); | 1919 return (kNullCid - kTypedDataInt8ArrayCid); |
1901 } | 1920 } |
1902 | 1921 |
1903 } // namespace dart | 1922 } // namespace dart |
1904 | 1923 |
1905 #endif // VM_RAW_OBJECT_H_ | 1924 #endif // VM_RAW_OBJECT_H_ |
OLD | NEW |