Commit 5ccf209b authored by Leszek Swirski's avatar Leszek Swirski Committed by Commit Bot

[heap-stats] Log uncompiled JSFunctions

Change-Id: I9c64f70585592bb46e993041a275b989ea71489d
Reviewed-on: https://chromium-review.googlesource.com/897529
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#51041}
parent c06e5507
......@@ -259,6 +259,7 @@ class ObjectStatsCollectorImpl {
void RecordVirtualMapDetails(Map* map);
void RecordVirtualScriptDetails(Script* script);
void RecordVirtualSharedFunctionInfoDetails(SharedFunctionInfo* info);
void RecordVirtualJSFunctionDetails(JSFunction* function);
Heap* heap_;
ObjectStats* stats_;
......@@ -441,6 +442,8 @@ void ObjectStatsCollectorImpl::CollectStatistics(HeapObject* obj, Phase phase) {
} else if (obj->IsFunctionTemplateInfo()) {
RecordVirtualFunctionTemplateInfoDetails(
FunctionTemplateInfo::cast(obj));
} else if (obj->IsJSFunction()) {
RecordVirtualJSFunctionDetails(JSFunction::cast(obj));
} else if (obj->IsJSGlobalObject()) {
RecordVirtualJSGlobalObjectDetails(JSGlobalObject::cast(obj));
} else if (obj->IsJSObject()) {
......@@ -593,6 +596,15 @@ void ObjectStatsCollectorImpl::RecordVirtualSharedFunctionInfoDetails(
kIgnoreCow);
}
void ObjectStatsCollectorImpl::RecordVirtualJSFunctionDetails(
JSFunction* function) {
// Uncompiled JSFunctions get their own category.
if (!function->is_compiled()) {
RecordSimpleVirtualObjectStats(nullptr, function,
ObjectStats::UNCOMPILED_JS_FUNCTION_TYPE);
}
}
namespace {
bool MatchesConstantElementsPair(Object* object) {
......
......@@ -55,6 +55,7 @@
V(SINGLE_CHARACTER_STRING_CACHE_TYPE) \
V(STRING_SPLIT_CACHE_TYPE) \
V(STRING_TABLE_TYPE) \
V(UNCOMPILED_JS_FUNCTION_TYPE) \
V(UNCOMPILED_SHARED_FUNCTION_INFO_TYPE) \
V(WEAK_NEW_SPACE_OBJECT_TO_CODE_TYPE)
......
......@@ -152,6 +152,7 @@ const CATEGORIES = new Map([
'SCRIPT_TYPE',
'SHARED_FUNCTION_INFO_TYPE',
'STORE_HANDLER_TYPE',
'UNCOMPILED_JS_FUNCTION_TYPE',
'UNCOMPILED_SHARED_FUNCTION_INFO_TYPE',
])
],
......
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