Commit b988c6ae authored by ishell@chromium.org's avatar ishell@chromium.org Committed by V8 LUCI CQ

[heap-stats] Fix accounting of JSCollection tables

... which might be undefined during initialization.

Bug: v8:13054
Change-Id: Ia3a7a95ffb1133b5d3d299c36bfb3875bcee2dfa
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3769830Reviewed-by: 's avatarPatrick Thier <pthier@chromium.org>
Auto-Submit: Igor Sheludko <ishell@chromium.org>
Reviewed-by: 's avatarAnton Bikineev <bikineev@chromium.org>
Commit-Queue: Anton Bikineev <bikineev@chromium.org>
Cr-Commit-Position: refs/heads/main@{#81783}
parent d5b3d8e9
......@@ -633,10 +633,13 @@ void ObjectStatsCollectorImpl::RecordVirtualJSObjectDetails(JSObject object) {
// JSCollections.
if (object.IsJSCollection()) {
// TODO(bmeurer): Properly compute over-allocation here.
RecordSimpleVirtualObjectStats(
object, FixedArray::cast(JSCollection::cast(object).table()),
ObjectStats::JS_COLLECTION_TABLE_TYPE);
Object maybe_table = JSCollection::cast(object).table();
if (!maybe_table.IsUndefined(isolate())) {
DCHECK(maybe_table.IsFixedArray(isolate()));
// TODO(bmeurer): Properly compute over-allocation here.
RecordSimpleVirtualObjectStats(object, HeapObject::cast(maybe_table),
ObjectStats::JS_COLLECTION_TABLE_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