[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/+/3769830 Reviewed-by: Patrick Thier <pthier@chromium.org> Auto-Submit: Igor Sheludko <ishell@chromium.org> Reviewed-by: Anton Bikineev <bikineev@chromium.org> Commit-Queue: Anton Bikineev <bikineev@chromium.org> Cr-Commit-Position: refs/heads/main@{#81783}
This commit is contained in:
parent
d5b3d8e994
commit
b988c6ae9e
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user