Store entry id as 32-bit int.
BUG= TEST= Review URL: https://chromiumcodereview.appspot.com/9695046 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11029 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
parent
262c8bddd5
commit
cd81976065
@ -114,15 +114,6 @@ int V8HeapExplorer::GetGcSubrootOrder(HeapObject* subroot) {
|
|||||||
HeapObjectsMap::kObjectIdStep);
|
HeapObjectsMap::kObjectIdStep);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
SnapshotObjectId HeapEntry::id() {
|
|
||||||
union {
|
|
||||||
Id stored_id;
|
|
||||||
SnapshotObjectId returned_id;
|
|
||||||
} id_adaptor = {id_};
|
|
||||||
return id_adaptor.returned_id;
|
|
||||||
}
|
|
||||||
|
|
||||||
} } // namespace v8::internal
|
} } // namespace v8::internal
|
||||||
|
|
||||||
#endif // V8_PROFILE_GENERATOR_INL_H_
|
#endif // V8_PROFILE_GENERATOR_INL_H_
|
||||||
|
@ -978,12 +978,7 @@ void HeapEntry::Init(HeapSnapshot* snapshot,
|
|||||||
children_count_ = children_count;
|
children_count_ = children_count;
|
||||||
retainers_count_ = retainers_count;
|
retainers_count_ = retainers_count;
|
||||||
dominator_ = NULL;
|
dominator_ = NULL;
|
||||||
|
id_ = id;
|
||||||
union {
|
|
||||||
SnapshotObjectId set_id;
|
|
||||||
Id stored_id;
|
|
||||||
} id_adaptor = {id};
|
|
||||||
id_ = id_adaptor.stored_id;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1113,7 +1108,7 @@ template <size_t ptr_size> struct SnapshotSizeConstants;
|
|||||||
|
|
||||||
template <> struct SnapshotSizeConstants<4> {
|
template <> struct SnapshotSizeConstants<4> {
|
||||||
static const int kExpectedHeapGraphEdgeSize = 12;
|
static const int kExpectedHeapGraphEdgeSize = 12;
|
||||||
static const int kExpectedHeapEntrySize = 36;
|
static const int kExpectedHeapEntrySize = 32;
|
||||||
static const size_t kMaxSerializableSnapshotRawSize = 256 * MB;
|
static const size_t kMaxSerializableSnapshotRawSize = 256 * MB;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -1139,10 +1134,10 @@ HeapSnapshot::HeapSnapshot(HeapSnapshotsCollection* collection,
|
|||||||
natives_root_entry_(NULL),
|
natives_root_entry_(NULL),
|
||||||
raw_entries_(NULL),
|
raw_entries_(NULL),
|
||||||
entries_sorted_(false) {
|
entries_sorted_(false) {
|
||||||
STATIC_ASSERT(
|
STATIC_CHECK(
|
||||||
sizeof(HeapGraphEdge) ==
|
sizeof(HeapGraphEdge) ==
|
||||||
SnapshotSizeConstants<kPointerSize>::kExpectedHeapGraphEdgeSize);
|
SnapshotSizeConstants<kPointerSize>::kExpectedHeapGraphEdgeSize);
|
||||||
STATIC_ASSERT(
|
STATIC_CHECK(
|
||||||
sizeof(HeapEntry) ==
|
sizeof(HeapEntry) ==
|
||||||
SnapshotSizeConstants<kPointerSize>::kExpectedHeapEntrySize);
|
SnapshotSizeConstants<kPointerSize>::kExpectedHeapEntrySize);
|
||||||
for (int i = 0; i < VisitorSynchronization::kNumberOfSyncTags; ++i) {
|
for (int i = 0; i < VisitorSynchronization::kNumberOfSyncTags; ++i) {
|
||||||
|
@ -544,7 +544,7 @@ class HeapEntry BASE_EMBEDDED {
|
|||||||
Type type() { return static_cast<Type>(type_); }
|
Type type() { return static_cast<Type>(type_); }
|
||||||
const char* name() { return name_; }
|
const char* name() { return name_; }
|
||||||
void set_name(const char* name) { name_ = name; }
|
void set_name(const char* name) { name_ = name; }
|
||||||
inline SnapshotObjectId id();
|
inline SnapshotObjectId id() { return id_; }
|
||||||
int self_size() { return self_size_; }
|
int self_size() { return self_size_; }
|
||||||
int retained_size() { return retained_size_; }
|
int retained_size() { return retained_size_; }
|
||||||
void add_retained_size(int size) { retained_size_ += size; }
|
void add_retained_size(int size) { retained_size_ += size; }
|
||||||
@ -608,12 +608,9 @@ class HeapEntry BASE_EMBEDDED {
|
|||||||
int ordered_index_; // Used during dominator tree building.
|
int ordered_index_; // Used during dominator tree building.
|
||||||
int retained_size_; // At that moment, there is no retained size yet.
|
int retained_size_; // At that moment, there is no retained size yet.
|
||||||
};
|
};
|
||||||
|
SnapshotObjectId id_;
|
||||||
HeapEntry* dominator_;
|
HeapEntry* dominator_;
|
||||||
HeapSnapshot* snapshot_;
|
HeapSnapshot* snapshot_;
|
||||||
struct Id {
|
|
||||||
uint32_t id1_;
|
|
||||||
uint32_t id2_;
|
|
||||||
} id_; // This is to avoid extra padding of 64-bit value.
|
|
||||||
const char* name_;
|
const char* name_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(HeapEntry);
|
DISALLOW_COPY_AND_ASSIGN(HeapEntry);
|
||||||
|
Loading…
Reference in New Issue
Block a user