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 1406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1491 // Variable length data follows here. | 1492 // Variable length data follows here. |
1492 RawObject** data() { OPEN_ARRAY_START(RawObject*, RawObject*); } | 1493 RawObject** data() { OPEN_ARRAY_START(RawObject*, RawObject*); } |
1493 RawObject** to(intptr_t length) { | 1494 RawObject** to(intptr_t length) { |
1494 return reinterpret_cast<RawObject**>(&ptr()->data()[length - 1]); | 1495 return reinterpret_cast<RawObject**>(&ptr()->data()[length - 1]); |
1495 } | 1496 } |
1496 | 1497 |
1497 friend class RawCode; | 1498 friend class RawCode; |
1498 friend class RawImmutableArray; | 1499 friend class RawImmutableArray; |
1499 friend class SnapshotReader; | 1500 friend class SnapshotReader; |
1500 friend class GrowableObjectArray; | 1501 friend class GrowableObjectArray; |
| 1502 friend class LinkedHashMap; |
1501 friend class Object; | 1503 friend class Object; |
1502 friend class ICData; // For high performance access. | 1504 friend class ICData; // For high performance access. |
1503 friend class SubtypeTestCache; // For high performance access. | 1505 friend class SubtypeTestCache; // For high performance access. |
1504 }; | 1506 }; |
1505 | 1507 |
1506 | 1508 |
1507 class RawImmutableArray : public RawArray { | 1509 class RawImmutableArray : public RawArray { |
1508 RAW_HEAP_OBJECT_IMPLEMENTATION(ImmutableArray); | 1510 RAW_HEAP_OBJECT_IMPLEMENTATION(ImmutableArray); |
1509 | 1511 |
1510 friend class SnapshotReader; | 1512 friend class SnapshotReader; |
(...skipping 10 matching lines...) Expand all Loading... |
1521 RawSmi* length_; | 1523 RawSmi* length_; |
1522 RawArray* data_; | 1524 RawArray* data_; |
1523 RawObject** to() { | 1525 RawObject** to() { |
1524 return reinterpret_cast<RawObject**>(&ptr()->data_); | 1526 return reinterpret_cast<RawObject**>(&ptr()->data_); |
1525 } | 1527 } |
1526 | 1528 |
1527 friend class SnapshotReader; | 1529 friend class SnapshotReader; |
1528 }; | 1530 }; |
1529 | 1531 |
1530 | 1532 |
| 1533 class RawLinkedHashMap : public RawInstance { |
| 1534 RAW_HEAP_OBJECT_IMPLEMENTATION(LinkedHashMap); |
| 1535 |
| 1536 RawObject** from() { |
| 1537 return reinterpret_cast<RawObject**>(&ptr()->type_arguments_); |
| 1538 } |
| 1539 RawTypeArguments* type_arguments_; |
| 1540 RawInstance* cme_mark_; |
| 1541 RawArray* data_; |
| 1542 RawObject** to() { |
| 1543 return reinterpret_cast<RawObject**>(&ptr()->data_); |
| 1544 } |
| 1545 |
| 1546 friend class SnapshotReader; |
| 1547 }; |
| 1548 |
| 1549 |
1531 class RawFloat32x4 : public RawInstance { | 1550 class RawFloat32x4 : public RawInstance { |
1532 RAW_HEAP_OBJECT_IMPLEMENTATION(Float32x4); | 1551 RAW_HEAP_OBJECT_IMPLEMENTATION(Float32x4); |
1533 | 1552 |
1534 float value_[4]; | 1553 float value_[4]; |
1535 | 1554 |
1536 friend class SnapshotReader; | 1555 friend class SnapshotReader; |
1537 public: | 1556 public: |
1538 float x() const { return value_[0]; } | 1557 float x() const { return value_[0]; } |
1539 float y() const { return value_[1]; } | 1558 float y() const { return value_[1]; } |
1540 float z() const { return value_[2]; } | 1559 float z() const { return value_[2]; } |
(...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1951 COMPILE_ASSERT(kExternalTypedDataInt8ArrayCid == | 1970 COMPILE_ASSERT(kExternalTypedDataInt8ArrayCid == |
1952 kTypedDataInt8ArrayViewCid + 15); | 1971 kTypedDataInt8ArrayViewCid + 15); |
1953 COMPILE_ASSERT(kByteBufferCid == kExternalTypedDataInt8ArrayCid + 14); | 1972 COMPILE_ASSERT(kByteBufferCid == kExternalTypedDataInt8ArrayCid + 14); |
1954 COMPILE_ASSERT(kNullCid == kByteBufferCid + 1); | 1973 COMPILE_ASSERT(kNullCid == kByteBufferCid + 1); |
1955 return (kNullCid - kTypedDataInt8ArrayCid); | 1974 return (kNullCid - kTypedDataInt8ArrayCid); |
1956 } | 1975 } |
1957 | 1976 |
1958 } // namespace dart | 1977 } // namespace dart |
1959 | 1978 |
1960 #endif // VM_RAW_OBJECT_H_ | 1979 #endif // VM_RAW_OBJECT_H_ |
OLD | NEW |