Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(205)

Unified Diff: runtime/vm/raw_object.h

Issue 10452006: Implement a heap profiler for the Dart managed heap. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: runtime/vm/raw_object.h
diff --git a/runtime/vm/raw_object.h b/runtime/vm/raw_object.h
index 4d67bb099d9d41da868d89a0a99324d1c44ca83b..3128cf86960b736db897acd370d6cad653fcd459 100644
--- a/runtime/vm/raw_object.h
+++ b/runtime/vm/raw_object.h
@@ -341,6 +341,7 @@ class RawObject {
friend class Api;
friend class Array;
friend class Heap;
+ friend class HeapProfiler;
friend class MarkingVisitor;
friend class Object;
friend class RawInstructions;
@@ -385,17 +386,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 index_; // 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;
@@ -488,6 +490,8 @@ class RawInstantiatedType : public RawAbstractType {
class RawAbstractTypeArguments : public RawObject {
private:
RAW_HEAP_OBJECT_IMPLEMENTATION(AbstractTypeArguments);
+
+ friend class HeapProfiler;
};
@@ -588,6 +592,8 @@ class RawField : public RawObject {
bool is_static_;
bool is_final_;
bool has_initializer_;
+
+ friend class HeapProfiler;
};
@@ -1004,6 +1010,8 @@ class RawString : public RawInstance {
RawSmi* length_;
RawSmi* hash_;
RawObject** to() { return reinterpret_cast<RawObject**>(&ptr()->hash_); }
+
+ friend class HeapProfiler;
};
@@ -1013,6 +1021,7 @@ class RawOneByteString : public RawString {
// Variable length data follows here.
uint8_t data_[0];
+ friend class HeapProfiler;
friend class SnapshotReader;
};
@@ -1023,6 +1032,7 @@ class RawTwoByteString : public RawString {
// Variable length data follows here.
uint16_t data_[0];
+ friend class HeapProfiler;
friend class SnapshotReader;
};
@@ -1033,6 +1043,7 @@ class RawFourByteString : public RawString {
// Variable length data follows here.
uint32_t data_[0];
+ friend class HeapProfiler;
friend class SnapshotReader;
};
@@ -1106,10 +1117,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;
};
@@ -1144,6 +1156,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;
};
@@ -1152,6 +1166,8 @@ class RawInt8Array: public RawByteArray {
// Variable length data follows here.
int8_t data_[0];
+
+ friend class HeapProfiler;
};
@@ -1160,6 +1176,8 @@ class RawUint8Array: public RawByteArray {
// Variable length data follows here.
uint8_t data_[0];
+
+ friend class HeapProfiler;
};
@@ -1168,6 +1186,8 @@ class RawInt16Array: public RawByteArray {
// Variable length data follows here.
int16_t data_[0];
+
+ friend class HeapProfiler;
};
@@ -1176,6 +1196,8 @@ class RawUint16Array: public RawByteArray {
// Variable length data follows here.
uint16_t data_[0];
+
+ friend class HeapProfiler;
};
@@ -1184,6 +1206,8 @@ class RawInt32Array: public RawByteArray {
// Variable length data follows here.
int32_t data_[0];
+
+ friend class HeapProfiler;
};
@@ -1192,6 +1216,8 @@ class RawUint32Array: public RawByteArray {
// Variable length data follows here.
uint32_t data_[0];
+
+ friend class HeapProfiler;
};
@@ -1200,6 +1226,8 @@ class RawInt64Array: public RawByteArray {
// Variable length data follows here.
int64_t data_[0];
+
+ friend class HeapProfiler;
};
@@ -1208,6 +1236,8 @@ class RawUint64Array: public RawByteArray {
// Variable length data follows here.
uint64_t data_[0];
+
+ friend class HeapProfiler;
};
@@ -1216,6 +1246,8 @@ class RawFloat32Array: public RawByteArray {
// Variable length data follows here.
float data_[0];
+
+ friend class HeapProfiler;
};
@@ -1224,6 +1256,8 @@ class RawFloat64Array: public RawByteArray {
// Variable length data follows here.
double data_[0];
+
+ friend class HeapProfiler;
};
« runtime/vm/heap_profiler.cc ('K') | « runtime/vm/pages.cc ('k') | runtime/vm/scavenger.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698