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

Unified Diff: src/heap/object-stats.cc

Issue 2190563002: [heap] ObjectStats: Fixes for recording HashTable overhead (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fixes Created 4 years, 5 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/object-stats.cc
diff --git a/src/heap/object-stats.cc b/src/heap/object-stats.cc
index a9ef8686b82575b30b976a754065a88973d41c83..e30d84950e007318a82dcace7fe74392ad2114f0 100644
--- a/src/heap/object-stats.cc
+++ b/src/heap/object-stats.cc
@@ -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()) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698