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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
62 V(GrowableObjectArray) \ | 62 V(GrowableObjectArray) \ |
63 V(TypedData) \ | 63 V(TypedData) \ |
64 V(ExternalTypedData) \ | 64 V(ExternalTypedData) \ |
65 V(Stacktrace) \ | 65 V(Stacktrace) \ |
66 V(JSRegExp) \ | 66 V(JSRegExp) \ |
67 V(WeakProperty) \ | 67 V(WeakProperty) \ |
68 V(MirrorReference) \ | 68 V(MirrorReference) \ |
69 V(Float32x4) \ | 69 V(Float32x4) \ |
70 V(Int32x4) \ | 70 V(Int32x4) \ |
71 V(Float64x2) \ | 71 V(Float64x2) \ |
72 V(UserTag) \ | |
siva
2014/04/09 21:32:01
IsObjectStoreClassId in snapshot.cc needs to be up
Cutch
2014/04/09 22:27:20
Now that I don't store this in the object_store th
| |
72 | 73 |
73 #define CLASS_LIST_ARRAYS(V) \ | 74 #define CLASS_LIST_ARRAYS(V) \ |
74 V(Array) \ | 75 V(Array) \ |
75 V(ImmutableArray) \ | 76 V(ImmutableArray) \ |
76 | 77 |
77 #define CLASS_LIST_STRINGS(V) \ | 78 #define CLASS_LIST_STRINGS(V) \ |
78 V(String) \ | 79 V(String) \ |
79 V(OneByteString) \ | 80 V(OneByteString) \ |
80 V(TwoByteString) \ | 81 V(TwoByteString) \ |
81 V(ExternalOneByteString) \ | 82 V(ExternalOneByteString) \ |
(...skipping 1491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1573 RawObject** from() { | 1574 RawObject** from() { |
1574 return reinterpret_cast<RawObject**>(&ptr()->referent_); | 1575 return reinterpret_cast<RawObject**>(&ptr()->referent_); |
1575 } | 1576 } |
1576 RawObject* referent_; | 1577 RawObject* referent_; |
1577 RawObject** to() { | 1578 RawObject** to() { |
1578 return reinterpret_cast<RawObject**>(&ptr()->referent_); | 1579 return reinterpret_cast<RawObject**>(&ptr()->referent_); |
1579 } | 1580 } |
1580 }; | 1581 }; |
1581 | 1582 |
1582 | 1583 |
1584 // UserTag are used by the profiler to track Dart script state. | |
1585 class RawUserTag : public RawInstance { | |
1586 RAW_HEAP_OBJECT_IMPLEMENTATION(UserTag); | |
1587 | |
1588 RawObject** from() { | |
1589 return reinterpret_cast<RawObject**>(&ptr()->label_); | |
1590 } | |
1591 | |
1592 RawString* label_; | |
1593 | |
1594 RawObject** to() { | |
1595 return reinterpret_cast<RawObject**>(&ptr()->label_); | |
1596 } | |
1597 | |
1598 // Isolate unique tag. | |
1599 uword tag_; | |
1600 | |
1601 friend class SnapshotReader; | |
1602 | |
1603 public: | |
1604 uword tag() const { return tag_; } | |
1605 }; | |
1606 | |
1583 // Class Id predicates. | 1607 // Class Id predicates. |
1584 | 1608 |
1585 inline bool RawObject::IsErrorClassId(intptr_t index) { | 1609 inline bool RawObject::IsErrorClassId(intptr_t index) { |
1586 // Make sure this function is updated when new Error types are added. | 1610 // Make sure this function is updated when new Error types are added. |
1587 ASSERT(kApiErrorCid == kErrorCid + 1 && | 1611 ASSERT(kApiErrorCid == kErrorCid + 1 && |
1588 kLanguageErrorCid == kErrorCid + 2 && | 1612 kLanguageErrorCid == kErrorCid + 2 && |
1589 kUnhandledExceptionCid == kErrorCid + 3 && | 1613 kUnhandledExceptionCid == kErrorCid + 3 && |
1590 kUnwindErrorCid == kErrorCid + 4 && | 1614 kUnwindErrorCid == kErrorCid + 4 && |
1591 kInstanceCid == kErrorCid + 5); | 1615 kInstanceCid == kErrorCid + 5); |
1592 return (index >= kErrorCid && index < kInstanceCid); | 1616 return (index >= kErrorCid && index < kInstanceCid); |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1780 // Make sure this is updated when new TypedData types are added. | 1804 // Make sure this is updated when new TypedData types are added. |
1781 ASSERT(kTypedDataInt8ArrayViewCid == kTypedDataInt8ArrayCid + 14); | 1805 ASSERT(kTypedDataInt8ArrayViewCid == kTypedDataInt8ArrayCid + 14); |
1782 ASSERT(kExternalTypedDataInt8ArrayCid == kTypedDataInt8ArrayViewCid + 15); | 1806 ASSERT(kExternalTypedDataInt8ArrayCid == kTypedDataInt8ArrayViewCid + 15); |
1783 ASSERT(kNullCid == kExternalTypedDataInt8ArrayCid + 14); | 1807 ASSERT(kNullCid == kExternalTypedDataInt8ArrayCid + 14); |
1784 return (kNullCid - kTypedDataInt8ArrayCid); | 1808 return (kNullCid - kTypedDataInt8ArrayCid); |
1785 } | 1809 } |
1786 | 1810 |
1787 } // namespace dart | 1811 } // namespace dart |
1788 | 1812 |
1789 #endif // VM_RAW_OBJECT_H_ | 1813 #endif // VM_RAW_OBJECT_H_ |
OLD | NEW |