Revision: 11029
Author: [email protected]
Date: Tue Mar 13 08:42:26 2012
Log: Store entry id as 32-bit int.
BUG=
TEST=
Review URL: https://chromiumcodereview.appspot.com/9695046
http://code.google.com/p/v8/source/detail?r=11029
Modified:
/branches/bleeding_edge/src/profile-generator-inl.h
/branches/bleeding_edge/src/profile-generator.cc
/branches/bleeding_edge/src/profile-generator.h
=======================================
--- /branches/bleeding_edge/src/profile-generator-inl.h Sat Mar 10 23:02:19
2012
+++ /branches/bleeding_edge/src/profile-generator-inl.h Tue Mar 13 08:42:26
2012
@@ -113,15 +113,6 @@
reinterpret_cast<char*>(kFirstGcSubrootObject)) /
HeapObjectsMap::kObjectIdStep);
}
-
-
-SnapshotObjectId HeapEntry::id() {
- union {
- Id stored_id;
- SnapshotObjectId returned_id;
- } id_adaptor = {id_};
- return id_adaptor.returned_id;
-}
} } // namespace v8::internal
=======================================
--- /branches/bleeding_edge/src/profile-generator.cc Sun Mar 11 08:04:50
2012
+++ /branches/bleeding_edge/src/profile-generator.cc Tue Mar 13 08:42:26
2012
@@ -978,12 +978,7 @@
children_count_ = children_count;
retainers_count_ = retainers_count;
dominator_ = NULL;
-
- union {
- SnapshotObjectId set_id;
- Id stored_id;
- } id_adaptor = {id};
- id_ = id_adaptor.stored_id;
+ id_ = id;
}
@@ -1113,7 +1108,7 @@
template <> struct SnapshotSizeConstants<4> {
static const int kExpectedHeapGraphEdgeSize = 12;
- static const int kExpectedHeapEntrySize = 36;
+ static const int kExpectedHeapEntrySize = 32;
static const size_t kMaxSerializableSnapshotRawSize = 256 * MB;
};
@@ -1139,10 +1134,10 @@
natives_root_entry_(NULL),
raw_entries_(NULL),
entries_sorted_(false) {
- STATIC_ASSERT(
+ STATIC_CHECK(
sizeof(HeapGraphEdge) ==
SnapshotSizeConstants<kPointerSize>::kExpectedHeapGraphEdgeSize);
- STATIC_ASSERT(
+ STATIC_CHECK(
sizeof(HeapEntry) ==
SnapshotSizeConstants<kPointerSize>::kExpectedHeapEntrySize);
for (int i = 0; i < VisitorSynchronization::kNumberOfSyncTags; ++i) {
=======================================
--- /branches/bleeding_edge/src/profile-generator.h Sun Mar 11 08:04:50 2012
+++ /branches/bleeding_edge/src/profile-generator.h Tue Mar 13 08:42:26 2012
@@ -544,7 +544,7 @@
Type type() { return static_cast<Type>(type_); }
const char* name() { return name_; }
void set_name(const char* name) { name_ = name; }
- inline SnapshotObjectId id();
+ inline SnapshotObjectId id() { return id_; }
int self_size() { return self_size_; }
int retained_size() { return retained_size_; }
void add_retained_size(int size) { retained_size_ += size; }
@@ -608,12 +608,9 @@
int ordered_index_; // Used during dominator tree building.
int retained_size_; // At that moment, there is no retained size yet.
};
+ SnapshotObjectId id_;
HeapEntry* dominator_;
HeapSnapshot* snapshot_;
- struct Id {
- uint32_t id1_;
- uint32_t id2_;
- } id_; // This is to avoid extra padding of 64-bit value.
const char* name_;
DISALLOW_COPY_AND_ASSIGN(HeapEntry);
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev