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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
59 V(Mint) \ | 59 V(Mint) \ |
60 V(Bigint) \ | 60 V(Bigint) \ |
61 V(Double) \ | 61 V(Double) \ |
62 V(Bool) \ | 62 V(Bool) \ |
63 V(GrowableObjectArray) \ | 63 V(GrowableObjectArray) \ |
64 V(TypedData) \ | 64 V(TypedData) \ |
65 V(ExternalTypedData) \ | 65 V(ExternalTypedData) \ |
66 V(Stacktrace) \ | 66 V(Stacktrace) \ |
67 V(JSRegExp) \ | 67 V(JSRegExp) \ |
68 V(WeakProperty) \ | 68 V(WeakProperty) \ |
69 V(MirrorReference) \ | |
69 V(DartFunction) \ | 70 V(DartFunction) \ |
70 V(Float32x4) \ | 71 V(Float32x4) \ |
71 V(Uint32x4) \ | 72 V(Uint32x4) \ |
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) \ |
(...skipping 1441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1520 return reinterpret_cast<RawObject**>(&ptr()->value_); | 1521 return reinterpret_cast<RawObject**>(&ptr()->value_); |
1521 } | 1522 } |
1522 | 1523 |
1523 friend class GCMarker; | 1524 friend class GCMarker; |
1524 friend class MarkingVisitor; | 1525 friend class MarkingVisitor; |
1525 friend class Scavenger; | 1526 friend class Scavenger; |
1526 friend class ScavengerVisitor; | 1527 friend class ScavengerVisitor; |
1527 }; | 1528 }; |
1528 | 1529 |
1529 | 1530 |
1531 class RawMirrorReference : public RawInstance { | |
siva
2013/07/02 01:07:11
Could you add a brief comment on top indicating th
| |
1532 RAW_HEAP_OBJECT_IMPLEMENTATION(MirrorReference); | |
1533 | |
1534 RawObject** from() { | |
1535 return reinterpret_cast<RawObject**>(&ptr()->referent_); | |
1536 } | |
1537 RawObject* referent_; | |
1538 RawObject** to() { | |
1539 return reinterpret_cast<RawObject**>(&ptr()->referent_); | |
1540 } | |
1541 }; | |
1542 | |
1543 | |
1530 // Class Id predicates. | 1544 // Class Id predicates. |
1531 | 1545 |
1532 inline bool RawObject::IsErrorClassId(intptr_t index) { | 1546 inline bool RawObject::IsErrorClassId(intptr_t index) { |
1533 // Make sure this function is updated when new Error types are added. | 1547 // Make sure this function is updated when new Error types are added. |
1534 ASSERT(kApiErrorCid == kErrorCid + 1 && | 1548 ASSERT(kApiErrorCid == kErrorCid + 1 && |
1535 kLanguageErrorCid == kErrorCid + 2 && | 1549 kLanguageErrorCid == kErrorCid + 2 && |
1536 kUnhandledExceptionCid == kErrorCid + 3 && | 1550 kUnhandledExceptionCid == kErrorCid + 3 && |
1537 kUnwindErrorCid == kErrorCid + 4 && | 1551 kUnwindErrorCid == kErrorCid + 4 && |
1538 kInstanceCid == kErrorCid + 5); | 1552 kInstanceCid == kErrorCid + 5); |
1539 return (index >= kErrorCid && index < kInstanceCid); | 1553 return (index >= kErrorCid && index < kInstanceCid); |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1690 // Make sure this is updated when new TypedData types are added. | 1704 // Make sure this is updated when new TypedData types are added. |
1691 ASSERT(kTypedDataInt8ArrayViewCid == kTypedDataInt8ArrayCid + 12); | 1705 ASSERT(kTypedDataInt8ArrayViewCid == kTypedDataInt8ArrayCid + 12); |
1692 ASSERT(kExternalTypedDataInt8ArrayCid == kTypedDataInt8ArrayViewCid + 13); | 1706 ASSERT(kExternalTypedDataInt8ArrayCid == kTypedDataInt8ArrayViewCid + 13); |
1693 ASSERT(kNullCid == kExternalTypedDataInt8ArrayCid + 12); | 1707 ASSERT(kNullCid == kExternalTypedDataInt8ArrayCid + 12); |
1694 return (kNullCid - kTypedDataInt8ArrayCid); | 1708 return (kNullCid - kTypedDataInt8ArrayCid); |
1695 } | 1709 } |
1696 | 1710 |
1697 } // namespace dart | 1711 } // namespace dart |
1698 | 1712 |
1699 #endif // VM_RAW_OBJECT_H_ | 1713 #endif // VM_RAW_OBJECT_H_ |
OLD | NEW |