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

Unified Diff: src/profile-generator.cc

Issue 9666038: Revert "We have a problem with really big apps. The snapshot for such pages doesn't fit into JS hea… (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 9 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
« no previous file with comments | « src/profile-generator.h ('k') | src/profile-generator-inl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/profile-generator.cc
diff --git a/src/profile-generator.cc b/src/profile-generator.cc
index c4148f904e3069bc837190cdb9b209a4a6da4f41..14349ccaa9137be6b6ad95dc3c2133daf378f96c 100644
--- a/src/profile-generator.cc
+++ b/src/profile-generator.cc
@@ -965,7 +965,7 @@ HeapEntry* HeapGraphEdge::From() {
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 @@ void HeapEntry::Init(HeapSnapshot* snapshot,
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::AddGcSubrootEntry(int tag,
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::GetNextEntryToInit() {
}
-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 @@ HeapEntry* HeapSnapshot::GetEntryById(SnapshotObjectId id) {
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 @@ void HeapSnapshot::Print(int max_depth) {
// 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 @@ void HeapObjectsMap::SnapshotGenerationFinished() {
}
-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::MoveObject(Address from, Address to) {
}
-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 @@ void HeapObjectsMap::AddEntry(Address addr, SnapshotObjectId id) {
}
-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 @@ void HeapObjectsMap::RemoveDeadEntries() {
}
-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 @@ void HeapSnapshotsCollection::RemoveSnapshot(HeapSnapshot* snapshot) {
}
-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::SerializeEdge(HeapGraphEdge* edge) {
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(),
« no previous file with comments | « src/profile-generator.h ('k') | src/profile-generator-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698