Commit 53dde335 authored by mlippautz's avatar mlippautz Committed by Commit bot

[heap] ObjectStats: Fixes for recording HashTable overhead

- Overhead for HashTable was not accounted in bytes
- Name table in typefeedback metadata changed

BUG=chromium:631094
R=hpayer@chromium.org

Review-Url: https://codereview.chromium.org/2190563002
Cr-Commit-Position: refs/heads/master@{#38098}
parent 834f53eb
......@@ -272,7 +272,7 @@ template <class HashTable>
void ObjectStatsCollector::RecordHashTableHelper(HeapObject* parent,
HashTable* array,
int subtype) {
int used = array->NumberOfElements() * HashTable::kEntrySize;
int used = array->NumberOfElements() * HashTable::kEntrySize * kPointerSize;
CHECK_GE(array->Size(), used);
size_t overhead = array->Size() - used -
HashTable::kElementsStartIndex * kPointerSize -
......@@ -411,9 +411,13 @@ void ObjectStatsCollector::RecordSharedFunctionInfoDetails(
if (!feedback_metadata->is_empty()) {
RecordFixedArrayHelper(sfi, feedback_metadata,
TYPE_FEEDBACK_METADATA_SUB_TYPE, 0);
UnseededNumberDictionary* names = UnseededNumberDictionary::cast(
feedback_metadata->get(TypeFeedbackMetadata::kNamesTableIndex));
RecordHashTableHelper(sfi, names, TYPE_FEEDBACK_METADATA_SUB_TYPE);
Object* names =
feedback_metadata->get(TypeFeedbackMetadata::kNamesTableIndex);
if (!names->IsSmi()) {
UnseededNumberDictionary* names = UnseededNumberDictionary::cast(
feedback_metadata->get(TypeFeedbackMetadata::kNamesTableIndex));
RecordHashTableHelper(sfi, names, TYPE_FEEDBACK_METADATA_SUB_TYPE);
}
}
if (!sfi->OptimizedCodeMapIsCleared()) {
......
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