Fix a few remaining AbstractCode = InstructionStream cases

.. which are invalid now that AbstractCode is either a BytecodeArray or
Code object.

Bug: v8:13654
Change-Id: Ib6c396c05dae9db5a6775cfc6e2897ec42236ec6
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4200641
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Auto-Submit: Jakob Linke <jgruber@chromium.org>
Commit-Queue: Jakob Linke <jgruber@chromium.org>
Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85537}
This commit is contained in:
Jakob Linke 2023-01-30 10:11:39 +01:00 committed by V8 LUCI CQ
parent a7c83d5515
commit ed8cd96a9d
3 changed files with 6 additions and 7 deletions

View File

@ -161,7 +161,7 @@ void BreakLocation::AllAtCurrentStatement(
int offset = summary.code_offset();
Handle<AbstractCode> abstract_code = summary.abstract_code();
PtrComprCageBase cage_base = GetPtrComprCageBase(*debug_info);
if (abstract_code->IsInstructionStream(cage_base)) offset = offset - 1;
if (abstract_code->IsCode(cage_base)) offset = offset - 1;
int statement_position;
{
BreakIterator it(debug_info);

View File

@ -32,7 +32,7 @@ void CodeStatistics::RecordCodeAndMetadataStatistics(HeapObject object,
// Record code+metadata statistics.
AbstractCode abstract_code = AbstractCode::cast(object);
int size = abstract_code.SizeIncludingMetadata(cage_base);
if (abstract_code.IsInstructionStream(cage_base)) {
if (abstract_code.IsCode(cage_base)) {
size += isolate->code_and_metadata_size();
isolate->set_code_and_metadata_size(size);
} else {
@ -204,9 +204,9 @@ void CodeStatistics::CollectCodeCommentStatistics(AbstractCode obj,
// them in the stats.
// Only process code objects for code comment statistics.
PtrComprCageBase cage_base(isolate);
if (!obj.IsInstructionStream(cage_base)) return;
if (!obj.IsCode(cage_base)) return;
InstructionStream code = InstructionStream::cast(obj);
Code code = Code::cast(obj);
CodeCommentsIterator cit(code.code_comments(), code.code_comments_size());
int delta = 0;
int prev_pc_offset = 0;

View File

@ -825,8 +825,7 @@ void JitLogger::LogRecordedBuffer(Handle<AbstractCode> code,
JitCodeEvent event;
event.type = JitCodeEvent::CODE_ADDED;
event.code_start = reinterpret_cast<void*>(code->InstructionStart(cage_base));
event.code_type = code->IsInstructionStream(cage_base)
? JitCodeEvent::JIT_CODE
event.code_type = code->IsCode(cage_base) ? JitCodeEvent::JIT_CODE
: JitCodeEvent::BYTE_CODE;
event.code_len = code->InstructionSize(cage_base);
Handle<SharedFunctionInfo> shared;