Commit 9e857ef3 authored by Victor Gomes's avatar Victor Gomes Committed by V8 LUCI CQ

[baseline] Fix RecordVirtualCodeDetails

Avoid accessing deoptimzation_data and source_position_table
in RecordVirtualCodeDetails for baseline code.

Bug: v8:12321
Change-Id: I8d1bebc973ea2cb3de88102965281314facbc864
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3229568
Commit-Queue: Victor Gomes <victorgomes@chromium.org>
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Auto-Submit: Victor Gomes <victorgomes@chromium.org>
Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
Reviewed-by: 's avatarDominik Inführ <dinfuehr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77467}
parent 8ef02420
...@@ -1019,17 +1019,17 @@ ObjectStats::VirtualInstanceType CodeKindToVirtualInstanceType(CodeKind kind) { ...@@ -1019,17 +1019,17 @@ ObjectStats::VirtualInstanceType CodeKindToVirtualInstanceType(CodeKind kind) {
void ObjectStatsCollectorImpl::RecordVirtualCodeDetails(Code code) { void ObjectStatsCollectorImpl::RecordVirtualCodeDetails(Code code) {
RecordSimpleVirtualObjectStats(HeapObject(), code, RecordSimpleVirtualObjectStats(HeapObject(), code,
CodeKindToVirtualInstanceType(code.kind())); CodeKindToVirtualInstanceType(code.kind()));
RecordSimpleVirtualObjectStats(code, code.deoptimization_data(),
ObjectStats::DEOPTIMIZATION_DATA_TYPE);
RecordSimpleVirtualObjectStats(code, code.relocation_info(), RecordSimpleVirtualObjectStats(code, code.relocation_info(),
ObjectStats::RELOC_INFO_TYPE); ObjectStats::RELOC_INFO_TYPE);
Object source_position_table = code.source_position_table();
if (source_position_table.IsHeapObject()) {
RecordSimpleVirtualObjectStats(code,
HeapObject::cast(source_position_table),
ObjectStats::SOURCE_POSITION_TABLE_TYPE);
}
if (CodeKindIsOptimizedJSFunction(code.kind())) { if (CodeKindIsOptimizedJSFunction(code.kind())) {
Object source_position_table = code.source_position_table();
if (source_position_table.IsHeapObject()) {
RecordSimpleVirtualObjectStats(code,
HeapObject::cast(source_position_table),
ObjectStats::SOURCE_POSITION_TABLE_TYPE);
}
RecordSimpleVirtualObjectStats(code, code.deoptimization_data(),
ObjectStats::DEOPTIMIZATION_DATA_TYPE);
DeoptimizationData input_data = DeoptimizationData input_data =
DeoptimizationData::cast(code.deoptimization_data()); DeoptimizationData::cast(code.deoptimization_data());
if (input_data.length() > 0) { if (input_data.length() > 0) {
......
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