Chromium Code Reviews| Index: runtime/vm/raw_object.h |
| diff --git a/runtime/vm/raw_object.h b/runtime/vm/raw_object.h |
| index 3ed5eb4a45b707def96b9198aea16a633a93fff9..e63eaaf0fcee8a69ed90e947d7725c7cfd9ecf5c 100644 |
| --- a/runtime/vm/raw_object.h |
| +++ b/runtime/vm/raw_object.h |
| @@ -343,6 +343,7 @@ class RawObject { |
| friend class Api; |
| friend class Array; |
| friend class Heap; |
| + friend class HeapProfiler; |
| friend class MarkingVisitor; |
| friend class Object; |
| friend class RawInstructions; |
| @@ -387,17 +388,18 @@ class RawClass : public RawObject { |
| } |
| cpp_vtable handle_vtable_; |
| - intptr_t instance_size_; |
| + intptr_t instance_size_; // Size if fixed length or 0 if variable length. |
| ObjectKind instance_kind_; |
| intptr_t id_; // Class Id, also index in the class table. |
| intptr_t type_arguments_instance_field_offset_; // May be kNoTypeArguments. |
| - intptr_t next_field_offset_; // Offset of then next instance field. |
| + intptr_t next_field_offset_; // Offset of the next instance field. |
| intptr_t num_native_fields_; // Number of native fields in class. |
| intptr_t token_index_; |
| int8_t class_state_; // Of type ClassState. |
| bool is_const_; |
| bool is_interface_; |
| + friend class HeapProfiler; |
| friend class Object; |
| friend class RawInstance; |
| friend class RawInstructions; |
| @@ -490,6 +492,8 @@ class RawInstantiatedType : public RawAbstractType { |
| class RawAbstractTypeArguments : public RawObject { |
| private: |
| RAW_HEAP_OBJECT_IMPLEMENTATION(AbstractTypeArguments); |
| + |
| + friend class HeapProfiler; |
| }; |
| @@ -590,6 +594,8 @@ class RawField : public RawObject { |
| bool is_static_; |
| bool is_final_; |
| bool has_initializer_; |
| + |
| + friend class HeapProfiler; |
| }; |
| @@ -1008,6 +1014,8 @@ class RawString : public RawInstance { |
| RawSmi* length_; |
| RawSmi* hash_; |
| RawObject** to() { return reinterpret_cast<RawObject**>(&ptr()->hash_); } |
| + |
| + friend class HeapProfiler; |
| }; |
| @@ -1017,6 +1025,7 @@ class RawOneByteString : public RawString { |
| // Variable length data follows here. |
| uint8_t data_[0]; |
| + friend class HeapProfiler; |
| friend class SnapshotReader; |
| }; |
| @@ -1027,6 +1036,7 @@ class RawTwoByteString : public RawString { |
| // Variable length data follows here. |
| uint16_t data_[0]; |
| + friend class HeapProfiler; |
| friend class SnapshotReader; |
| }; |
| @@ -1037,6 +1047,7 @@ class RawFourByteString : public RawString { |
| // Variable length data follows here. |
| uint32_t data_[0]; |
| + friend class HeapProfiler; |
| friend class SnapshotReader; |
| }; |
| @@ -1110,10 +1121,11 @@ class RawArray : public RawInstance { |
| return reinterpret_cast<RawObject**>(&ptr()->data()[length - 1]); |
| } |
| + friend class GrowableObjectArray; |
| + friend class HeapProfiler; |
| friend class RawCode; |
| friend class RawImmutableArray; |
| friend class SnapshotReader; |
| - friend class GrowableObjectArray; |
| }; |
| @@ -1148,6 +1160,8 @@ class RawByteArray : public RawInstance { |
| RawObject** from() { return reinterpret_cast<RawObject**>(&ptr()->length_); } |
| RawSmi* length_; |
| RawObject** to() { return reinterpret_cast<RawObject**>(&ptr()->length_); } |
| + |
| + friend class HeapProfiler; |
| }; |
| @@ -1156,6 +1170,8 @@ class RawInt8Array: public RawByteArray { |
| // Variable length data follows here. |
| int8_t data_[0]; |
| + |
| + friend class HeapProfiler; |
| }; |
| @@ -1164,6 +1180,8 @@ class RawUint8Array: public RawByteArray { |
| // Variable length data follows here. |
| uint8_t data_[0]; |
| + |
| + friend class HeapProfiler; |
| }; |
| @@ -1172,6 +1190,8 @@ class RawInt16Array: public RawByteArray { |
| // Variable length data follows here. |
| int16_t data_[0]; |
| + |
| + friend class HeapProfiler; |
| }; |
| @@ -1180,6 +1200,8 @@ class RawUint16Array: public RawByteArray { |
| // Variable length data follows here. |
| uint16_t data_[0]; |
| + |
| + friend class HeapProfiler; |
| }; |
| @@ -1188,6 +1210,8 @@ class RawInt32Array: public RawByteArray { |
| // Variable length data follows here. |
| int32_t data_[0]; |
| + |
| + friend class HeapProfiler; |
| }; |
| @@ -1196,6 +1220,8 @@ class RawUint32Array: public RawByteArray { |
| // Variable length data follows here. |
| uint32_t data_[0]; |
| + |
| + friend class HeapProfiler; |
| }; |
| @@ -1204,6 +1230,8 @@ class RawInt64Array: public RawByteArray { |
| // Variable length data follows here. |
| int64_t data_[0]; |
| + |
| + friend class HeapProfiler; |
| }; |
| @@ -1212,6 +1240,8 @@ class RawUint64Array: public RawByteArray { |
| // Variable length data follows here. |
| uint64_t data_[0]; |
| + |
| + friend class HeapProfiler; |
| }; |
| @@ -1220,6 +1250,8 @@ class RawFloat32Array: public RawByteArray { |
| // Variable length data follows here. |
| float data_[0]; |
| + |
| + friend class HeapProfiler; |
| }; |
| @@ -1228,6 +1260,8 @@ class RawFloat64Array: public RawByteArray { |
| // Variable length data follows here. |
| double data_[0]; |
| + |
| + friend class HeapProfiler; |
|
turnidge
2012/06/12 17:02:19
I'm wondering if it makes sense to add this friend
cshapiro
2012/06/14 00:08:36
I think that is a good idea. I have pulled this u
|
| }; |