Commit e5d8e588 authored by Benedikt Meurer's avatar Benedikt Meurer Committed by Commit Bot

[heap] Fix GC stats with lazy source positions.

In RecordVirtualBytecodeArrayDetails() check whether the BytecodeArray
has a source position table before accessing it, otherwise it will just
crash with --enable-lazy-source-positions.

Bug: v8:8510
Change-Id: I1250e89faf836a8d5976ca98c14b6b7314bacb98
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1559730
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Auto-Submit: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60692}
parent b51404a8
......@@ -966,8 +966,10 @@ void ObjectStatsCollectorImpl::RecordVirtualBytecodeArrayDetails(
RecordSimpleVirtualObjectStats(
bytecode, bytecode->handler_table(),
ObjectStats::BYTECODE_ARRAY_HANDLER_TABLE_TYPE);
RecordSimpleVirtualObjectStats(bytecode, bytecode->SourcePositionTable(),
ObjectStats::SOURCE_POSITION_TABLE_TYPE);
if (bytecode->HasSourcePositionTable()) {
RecordSimpleVirtualObjectStats(bytecode, bytecode->SourcePositionTable(),
ObjectStats::SOURCE_POSITION_TABLE_TYPE);
}
}
namespace {
......
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