Commit 44981e4f authored by yurys@chromium.org's avatar yurys@chromium.org

Remove deprecated heap profiler methods from V8 public API

v8::HeapProfiler::FindHeapSnapshot was already deprecated when 3.19 branch was created (https://code.google.com/p/v8/source/browse/branches/3.19/include/v8-profiler.h).

BUG=None
R=loislo@chromium.org, yangguo@chromium.org

Review URL: https://codereview.chromium.org/18701002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@15493 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent cc97192c
...@@ -415,9 +415,6 @@ class V8EXPORT HeapProfiler { ...@@ -415,9 +415,6 @@ class V8EXPORT HeapProfiler {
/** Returns a snapshot by index. */ /** Returns a snapshot by index. */
const HeapSnapshot* GetHeapSnapshot(int index); const HeapSnapshot* GetHeapSnapshot(int index);
/** Returns a profile by uid. */
V8_DEPRECATED(const HeapSnapshot* FindHeapSnapshot(unsigned uid));
/** /**
* Returns SnapshotObjectId for a heap object referenced by |value| if * Returns SnapshotObjectId for a heap object referenced by |value| if
* it has been seen by the heap profiler, kUnknownObjectId otherwise. * it has been seen by the heap profiler, kUnknownObjectId otherwise.
......
...@@ -7745,12 +7745,6 @@ const HeapSnapshot* HeapProfiler::GetHeapSnapshot(int index) { ...@@ -7745,12 +7745,6 @@ const HeapSnapshot* HeapProfiler::GetHeapSnapshot(int index) {
} }
const HeapSnapshot* HeapProfiler::FindHeapSnapshot(unsigned uid) {
return reinterpret_cast<const HeapSnapshot*>(
reinterpret_cast<i::HeapProfiler*>(this)->FindSnapshot(uid));
}
SnapshotObjectId HeapProfiler::GetObjectId(Handle<Value> value) { SnapshotObjectId HeapProfiler::GetObjectId(Handle<Value> value) {
i::Handle<i::Object> obj = Utils::OpenHandle(*value); i::Handle<i::Object> obj = Utils::OpenHandle(*value);
return reinterpret_cast<i::HeapProfiler*>(this)->GetSnapshotObjectId(obj); return reinterpret_cast<i::HeapProfiler*>(this)->GetSnapshotObjectId(obj);
......
...@@ -124,11 +124,6 @@ HeapSnapshot* HeapProfiler::GetSnapshot(int index) { ...@@ -124,11 +124,6 @@ HeapSnapshot* HeapProfiler::GetSnapshot(int index) {
} }
HeapSnapshot* HeapProfiler::FindSnapshot(unsigned uid) {
return snapshots_->GetSnapshot(uid);
}
SnapshotObjectId HeapProfiler::GetSnapshotObjectId(Handle<Object> obj) { SnapshotObjectId HeapProfiler::GetSnapshotObjectId(Handle<Object> obj) {
if (!obj->IsHeapObject()) if (!obj->IsHeapObject())
return v8::HeapProfiler::kUnknownObjectId; return v8::HeapProfiler::kUnknownObjectId;
......
...@@ -66,7 +66,6 @@ class HeapProfiler { ...@@ -66,7 +66,6 @@ class HeapProfiler {
SnapshotObjectId PushHeapObjectsStats(OutputStream* stream); SnapshotObjectId PushHeapObjectsStats(OutputStream* stream);
int GetSnapshotsCount(); int GetSnapshotsCount();
HeapSnapshot* GetSnapshot(int index); HeapSnapshot* GetSnapshot(int index);
HeapSnapshot* FindSnapshot(unsigned uid);
SnapshotObjectId GetSnapshotObjectId(Handle<Object> obj); SnapshotObjectId GetSnapshotObjectId(Handle<Object> obj);
void DeleteAllSnapshots(); void DeleteAllSnapshots();
......
...@@ -189,15 +189,11 @@ template <size_t ptr_size> struct SnapshotSizeConstants; ...@@ -189,15 +189,11 @@ 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 = 24; static const int kExpectedHeapEntrySize = 24;
static const int kExpectedHeapSnapshotsCollectionSize = 100;
static const int kExpectedHeapSnapshotSize = 132;
}; };
template <> struct SnapshotSizeConstants<8> { template <> struct SnapshotSizeConstants<8> {
static const int kExpectedHeapGraphEdgeSize = 24; static const int kExpectedHeapGraphEdgeSize = 24;
static const int kExpectedHeapEntrySize = 32; static const int kExpectedHeapEntrySize = 32;
static const int kExpectedHeapSnapshotsCollectionSize = 152;
static const int kExpectedHeapSnapshotSize = 160;
}; };
} // namespace } // namespace
...@@ -353,8 +349,6 @@ static size_t GetMemoryUsedByList(const List<T, P>& list) { ...@@ -353,8 +349,6 @@ static size_t GetMemoryUsedByList(const List<T, P>& list) {
size_t HeapSnapshot::RawSnapshotSize() const { size_t HeapSnapshot::RawSnapshotSize() const {
STATIC_CHECK(SnapshotSizeConstants<kPointerSize>::kExpectedHeapSnapshotSize ==
sizeof(HeapSnapshot)); // NOLINT
return return
sizeof(*this) + sizeof(*this) +
GetMemoryUsedByList(entries_) + GetMemoryUsedByList(entries_) +
...@@ -578,7 +572,6 @@ size_t HeapObjectsMap::GetUsedMemorySize() const { ...@@ -578,7 +572,6 @@ size_t HeapObjectsMap::GetUsedMemorySize() const {
HeapSnapshotsCollection::HeapSnapshotsCollection(Heap* heap) HeapSnapshotsCollection::HeapSnapshotsCollection(Heap* heap)
: is_tracking_objects_(false), : is_tracking_objects_(false),
snapshots_uids_(HeapSnapshotsMatch),
token_enumerator_(new TokenEnumerator()), token_enumerator_(new TokenEnumerator()),
ids_(heap) { ids_(heap) {
} }
...@@ -607,29 +600,12 @@ void HeapSnapshotsCollection::SnapshotGenerationFinished( ...@@ -607,29 +600,12 @@ void HeapSnapshotsCollection::SnapshotGenerationFinished(
ids_.SnapshotGenerationFinished(); ids_.SnapshotGenerationFinished();
if (snapshot != NULL) { if (snapshot != NULL) {
snapshots_.Add(snapshot); snapshots_.Add(snapshot);
HashMap::Entry* entry =
snapshots_uids_.Lookup(reinterpret_cast<void*>(snapshot->uid()),
static_cast<uint32_t>(snapshot->uid()),
true);
ASSERT(entry->value == NULL);
entry->value = snapshot;
} }
} }
HeapSnapshot* HeapSnapshotsCollection::GetSnapshot(unsigned uid) {
HashMap::Entry* entry = snapshots_uids_.Lookup(reinterpret_cast<void*>(uid),
static_cast<uint32_t>(uid),
false);
return entry != NULL ? reinterpret_cast<HeapSnapshot*>(entry->value) : NULL;
}
void HeapSnapshotsCollection::RemoveSnapshot(HeapSnapshot* snapshot) { void HeapSnapshotsCollection::RemoveSnapshot(HeapSnapshot* snapshot) {
snapshots_.RemoveElement(snapshot); snapshots_.RemoveElement(snapshot);
unsigned uid = snapshot->uid();
snapshots_uids_.Remove(reinterpret_cast<void*>(uid),
static_cast<uint32_t>(uid));
} }
...@@ -656,13 +632,9 @@ Handle<HeapObject> HeapSnapshotsCollection::FindHeapObjectById( ...@@ -656,13 +632,9 @@ Handle<HeapObject> HeapSnapshotsCollection::FindHeapObjectById(
size_t HeapSnapshotsCollection::GetUsedMemorySize() const { size_t HeapSnapshotsCollection::GetUsedMemorySize() const {
STATIC_CHECK(SnapshotSizeConstants<kPointerSize>::
kExpectedHeapSnapshotsCollectionSize ==
sizeof(HeapSnapshotsCollection)); // NOLINT
size_t size = sizeof(*this); size_t size = sizeof(*this);
size += names_.GetUsedMemorySize(); size += names_.GetUsedMemorySize();
size += ids_.GetUsedMemorySize(); size += ids_.GetUsedMemorySize();
size += sizeof(HashMap::Entry) * snapshots_uids_.capacity();
size += GetMemoryUsedByList(snapshots_); size += GetMemoryUsedByList(snapshots_);
for (int i = 0; i < snapshots_.length(); ++i) { for (int i = 0; i < snapshots_.length(); ++i) {
size += snapshots_[i]->RawSnapshotSize(); size += snapshots_[i]->RawSnapshotSize();
......
...@@ -303,7 +303,6 @@ class HeapSnapshotsCollection { ...@@ -303,7 +303,6 @@ class HeapSnapshotsCollection {
HeapSnapshot* NewSnapshot(const char* name, unsigned uid); HeapSnapshot* NewSnapshot(const char* name, unsigned uid);
void SnapshotGenerationFinished(HeapSnapshot* snapshot); void SnapshotGenerationFinished(HeapSnapshot* snapshot);
List<HeapSnapshot*>* snapshots() { return &snapshots_; } List<HeapSnapshot*>* snapshots() { return &snapshots_; }
HeapSnapshot* GetSnapshot(unsigned uid);
void RemoveSnapshot(HeapSnapshot* snapshot); void RemoveSnapshot(HeapSnapshot* snapshot);
StringsStorage* names() { return &names_; } StringsStorage* names() { return &names_; }
...@@ -323,14 +322,8 @@ class HeapSnapshotsCollection { ...@@ -323,14 +322,8 @@ class HeapSnapshotsCollection {
size_t GetUsedMemorySize() const; size_t GetUsedMemorySize() const;
private: private:
INLINE(static bool HeapSnapshotsMatch(void* key1, void* key2)) {
return key1 == key2;
}
bool is_tracking_objects_; // Whether tracking object moves is needed. bool is_tracking_objects_; // Whether tracking object moves is needed.
List<HeapSnapshot*> snapshots_; List<HeapSnapshot*> snapshots_;
// Mapping from snapshots' uids to HeapSnapshot* pointers.
HashMap snapshots_uids_;
StringsStorage names_; StringsStorage names_;
TokenEnumerator* token_enumerator_; TokenEnumerator* token_enumerator_;
// Mapping from HeapObject addresses to objects' uids. // Mapping from HeapObject addresses to objects' uids.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment