Revision: 10995
Author: [email protected]
Date: Sat Mar 10 22:12:10 2012
Log: Revert "We have a problem with really big apps. The snapshot for
such pages doesn't fit into JS heap on DevTools front-end side. I'd like to
move the snapshot's nodes data into Int32Array."
This reverts commit 8c08ecc2782d5a8c60eb0692ec8f13d6da3cdc58.
BUG=none
TEST=none
Review URL: https://chromiumcodereview.appspot.com/9666038
http://code.google.com/p/v8/source/detail?r=10995
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 22:00:55
2012
+++ /branches/bleeding_edge/src/profile-generator-inl.h Sat Mar 10 22:12:10
2012
@@ -95,7 +95,7 @@
}
-SnapshotObjectId HeapObjectsMap::GetNthGcSubrootId(int delta) {
+uint64_t HeapObjectsMap::GetNthGcSubrootId(int delta) {
return kGcRootsFirstSubrootId + delta * kObjectIdStep;
}
@@ -115,10 +115,10 @@
}
-SnapshotObjectId HeapEntry::id() {
+uint64_t HeapEntry::id() {
union {
Id stored_id;
- SnapshotObjectId returned_id;
+ uint64_t returned_id;
} id_adaptor = {id_};
return id_adaptor.returned_id;
}
=======================================
--- /branches/bleeding_edge/src/profile-generator.cc Sat Mar 10 22:00:55
2012
+++ /branches/bleeding_edge/src/profile-generator.cc Sat Mar 10 22:12:10
2012
@@ -965,7 +965,7 @@
void HeapEntry::Init(HeapSnapshot* snapshot,
Type type,
const char* name,
- SnapshotObjectId id,
+ uint64_t id,
int self_size,
int children_count,
int retainers_count) {
@@ -980,7 +980,7 @@
dominator_ = NULL;
union {
- SnapshotObjectId set_id;
+ uint64_t set_id;
Id stored_id;
} id_adaptor = {id};
id_ = id_adaptor.stored_id;
@@ -1221,7 +1221,7 @@
HeapEntry* HeapSnapshot::AddEntry(HeapEntry::Type type,
const char* name,
- SnapshotObjectId id,
+ uint64_t id,
int size,
int children_count,
int retainers_count) {
@@ -1253,7 +1253,7 @@
}
-HeapEntry* HeapSnapshot::GetEntryById(SnapshotObjectId id) {
+HeapEntry* HeapSnapshot::GetEntryById(uint64_t id) {
List<HeapEntry*>* entries_by_id = GetSortedEntriesList();
// Perform a binary search by id.
@@ -1262,7 +1262,7 @@
while (low <= high) {
int mid =
(static_cast<unsigned int>(low) + static_cast<unsigned int>(high))
1;
- SnapshotObjectId mid_id = entries_by_id->at(mid)->id();
+ uint64_t mid_id = entries_by_id->at(mid)->id();
if (mid_id > id)
high = mid - 1;
else if (mid_id < id)
@@ -1298,12 +1298,12 @@
// We split IDs on evens for embedder objects (see
// HeapObjectsMap::GenerateId) and odds for native objects.
-const SnapshotObjectId HeapObjectsMap::kInternalRootObjectId = 1;
-const SnapshotObjectId HeapObjectsMap::kGcRootsObjectId =
+const uint64_t HeapObjectsMap::kInternalRootObjectId = 1;
+const uint64_t HeapObjectsMap::kGcRootsObjectId =
HeapObjectsMap::kInternalRootObjectId + HeapObjectsMap::kObjectIdStep;
-const SnapshotObjectId HeapObjectsMap::kGcRootsFirstSubrootId =
+const uint64_t HeapObjectsMap::kGcRootsFirstSubrootId =
HeapObjectsMap::kGcRootsObjectId + HeapObjectsMap::kObjectIdStep;
-const SnapshotObjectId HeapObjectsMap::kFirstAvailableObjectId =
+const uint64_t HeapObjectsMap::kFirstAvailableObjectId =
HeapObjectsMap::kGcRootsFirstSubrootId +
VisitorSynchronization::kNumberOfSyncTags *
HeapObjectsMap::kObjectIdStep;
@@ -1325,12 +1325,12 @@
}
-SnapshotObjectId HeapObjectsMap::FindObject(Address addr) {
+uint64_t HeapObjectsMap::FindObject(Address addr) {
if (!initial_fill_mode_) {
- SnapshotObjectId existing = FindEntry(addr);
+ uint64_t existing = FindEntry(addr);
if (existing != 0) return existing;
}
- SnapshotObjectId id = next_id_;
+ uint64_t id = next_id_;
next_id_ += kObjectIdStep;
AddEntry(addr, id);
return id;
@@ -1353,7 +1353,7 @@
}
-void HeapObjectsMap::AddEntry(Address addr, SnapshotObjectId id) {
+void HeapObjectsMap::AddEntry(Address addr, uint64_t id) {
HashMap::Entry* entry = entries_map_.Lookup(addr, AddressHash(addr),
true);
ASSERT(entry->value == NULL);
entry->value = reinterpret_cast<void*>(entries_->length());
@@ -1361,7 +1361,7 @@
}
-SnapshotObjectId HeapObjectsMap::FindEntry(Address addr) {
+uint64_t HeapObjectsMap::FindEntry(Address addr) {
HashMap::Entry* entry = entries_map_.Lookup(addr, AddressHash(addr),
false);
if (entry != NULL) {
int entry_index =
@@ -1401,8 +1401,8 @@
}
-SnapshotObjectId HeapObjectsMap::GenerateId(v8::RetainedObjectInfo* info) {
- SnapshotObjectId id = static_cast<SnapshotObjectId>(info->GetHash());
+uint64_t HeapObjectsMap::GenerateId(v8::RetainedObjectInfo* info) {
+ uint64_t id = static_cast<uint64_t>(info->GetHash());
const char* label = info->GetLabel();
id ^= HashSequentialString(label,
static_cast<int>(strlen(label)),
@@ -1472,8 +1472,7 @@
}
-Handle<HeapObject> HeapSnapshotsCollection::FindHeapObjectById(
- SnapshotObjectId id) {
+Handle<HeapObject> HeapSnapshotsCollection::FindHeapObjectById(uint64_t
id) {
// First perform a full GC in order to avoid dead objects.
HEAP->CollectAllGarbage(Heap::kMakeHeapIterableMask,
"HeapSnapshotsCollection::FindHeapObjectById");
@@ -3527,21 +3526,21 @@
void HeapSnapshotJSONSerializer::SerializeNode(HeapEntry* entry) {
- // The buffer needs space for 6 ints, 1 unsigned, 7 commas, \n and \0
+ // The buffer needs space for 6 ints, 1 uint64_t, 7 commas, \n and \0
static const int kBufferSize =
6 * MaxDecimalDigitsIn<sizeof(int)>::kSigned // NOLINT
- + MaxDecimalDigitsIn<sizeof(unsigned)>::kUnsigned // NOLINT
+ + MaxDecimalDigitsIn<sizeof(uint64_t)>::kUnsigned // NOLINT
+ 7 + 1 + 1;
EmbeddedVector<char, kBufferSize> buffer;
Vector<HeapGraphEdge> children = entry->children();
STATIC_CHECK(sizeof(int) == sizeof(entry->type())); // NOLINT
STATIC_CHECK(sizeof(int) == sizeof(GetStringId(entry->name()))); //
NOLINT
- STATIC_CHECK(sizeof(unsigned) == sizeof(entry->id())); // NOLINT
+ STATIC_CHECK(sizeof(uint64_t) == sizeof(entry->id())); // NOLINT
STATIC_CHECK(sizeof(int) == sizeof(entry->self_size())); // NOLINT
STATIC_CHECK(sizeof(int) == sizeof(entry->retained_size())); // NOLINT
STATIC_CHECK(sizeof(int) == sizeof(GetNodeId(entry->dominator()))); //
NOLINT
STATIC_CHECK(sizeof(int) == sizeof(children.length())); // NOLINT
- int result = OS::SNPrintF(buffer, "\n,%d,%d,%u,%d,%d,%d,%d",
+ int result = OS::SNPrintF(buffer, "\n,%d,%d,%llu,%d,%d,%d,%d",
entry->type(),
GetStringId(entry->name()),
entry->id(),
=======================================
--- /branches/bleeding_edge/src/profile-generator.h Sat Mar 10 22:00:55 2012
+++ /branches/bleeding_edge/src/profile-generator.h Sat Mar 10 22:12:10 2012
@@ -35,8 +35,6 @@
namespace v8 {
namespace internal {
-typedef uint32_t SnapshotObjectId;
-
class TokenEnumerator {
public:
TokenEnumerator();
@@ -535,7 +533,7 @@
void Init(HeapSnapshot* snapshot,
Type type,
const char* name,
- SnapshotObjectId id,
+ uint64_t id,
int self_size,
int children_count,
int retainers_count);
@@ -544,7 +542,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 uint64_t id();
int self_size() { return self_size_; }
int retained_size() { return retained_size_; }
void add_retained_size(int size) { retained_size_ += size; }
@@ -653,7 +651,7 @@
int entries_count, int children_count, int retainers_count);
HeapEntry* AddEntry(HeapEntry::Type type,
const char* name,
- SnapshotObjectId id,
+ uint64_t id,
int size,
int children_count,
int retainers_count);
@@ -664,7 +662,7 @@
int retainers_count);
HeapEntry* AddNativesRootEntry(int children_count, int retainers_count);
void ClearPaint();
- HeapEntry* GetEntryById(SnapshotObjectId id);
+ HeapEntry* GetEntryById(uint64_t id);
List<HeapEntry*>* GetSortedEntriesList();
template<class Visitor>
void IterateEntries(Visitor* visitor) { entries_.Iterate(visitor); }
@@ -701,29 +699,29 @@
~HeapObjectsMap();
void SnapshotGenerationFinished();
- SnapshotObjectId FindObject(Address addr);
+ uint64_t FindObject(Address addr);
void MoveObject(Address from, Address to);
- static SnapshotObjectId GenerateId(v8::RetainedObjectInfo* info);
- static inline SnapshotObjectId GetNthGcSubrootId(int delta);
+ static uint64_t GenerateId(v8::RetainedObjectInfo* info);
+ static inline uint64_t GetNthGcSubrootId(int delta);
static const int kObjectIdStep = 2;
- static const SnapshotObjectId kInternalRootObjectId;
- static const SnapshotObjectId kGcRootsObjectId;
- static const SnapshotObjectId kNativesRootObjectId;
- static const SnapshotObjectId kGcRootsFirstSubrootId;
- static const SnapshotObjectId kFirstAvailableObjectId;
+ static const uint64_t kInternalRootObjectId;
+ static const uint64_t kGcRootsObjectId;
+ static const uint64_t kNativesRootObjectId;
+ static const uint64_t kGcRootsFirstSubrootId;
+ static const uint64_t kFirstAvailableObjectId;
private:
struct EntryInfo {
- explicit EntryInfo(SnapshotObjectId id) : id(id), accessed(true) { }
- EntryInfo(SnapshotObjectId id, bool accessed) : id(id),
accessed(accessed) { }
- SnapshotObjectId id;
+ explicit EntryInfo(uint64_t id) : id(id), accessed(true) { }
+ EntryInfo(uint64_t id, bool accessed) : id(id), accessed(accessed) { }
+ uint64_t id;
bool accessed;
};
- void AddEntry(Address addr, SnapshotObjectId id);
- SnapshotObjectId FindEntry(Address addr);
+ void AddEntry(Address addr, uint64_t id);
+ uint64_t FindEntry(Address addr);
void RemoveDeadEntries();
static bool AddressesMatch(void* key1, void* key2) {
@@ -737,7 +735,7 @@
}
bool initial_fill_mode_;
- SnapshotObjectId next_id_;
+ uint64_t next_id_;
HashMap entries_map_;
List<EntryInfo>* entries_;
@@ -762,8 +760,8 @@
StringsStorage* names() { return &names_; }
TokenEnumerator* token_enumerator() { return token_enumerator_; }
- SnapshotObjectId GetObjectId(Address addr) { return
ids_.FindObject(addr); }
- Handle<HeapObject> FindHeapObjectById(SnapshotObjectId id);
+ uint64_t GetObjectId(Address addr) { return ids_.FindObject(addr); }
+ Handle<HeapObject> FindHeapObjectById(uint64_t id);
void ObjectMoveEvent(Address from, Address to) { ids_.MoveObject(from,
to); }
private:
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev