Fix DCHECK in CodeCreateEvent

CodeCreateEvent expects one of a) bytecode, b) builtins, c) baseline
code.

The invalid DCHECK was introduced in crrev.com/c/4178821.

Bug: v8:13654
Fixed: chromium:1409785
Change-Id: Ib12ca6e6ec722dcaaf02f3dc57a4bf24e2830a91
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4194188
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Auto-Submit: Jakob Linke <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85467}
This commit is contained in:
Jakob Linke 2023-01-25 10:59:12 +01:00 committed by V8 LUCI CQ
parent aeda84ad57
commit ce9b5600b5

View File

@ -75,7 +75,8 @@ void ProfilerListener::CodeCreateEvent(CodeTag tag, Handle<AbstractCode> code,
Handle<Name> script_name) {
PtrComprCageBase cage_base(isolate_);
DCHECK(code->IsBytecodeArray(cage_base) ||
code->GetCode().kind() == CodeKind::BASELINE);
Builtins::IsBuiltinId(code->builtin_id(cage_base)) ||
code->kind(cage_base) == CodeKind::BASELINE);
CodeEventsContainer evt_rec(CodeEventRecord::Type::kCodeCreation);
CodeCreateEventRecord* rec = &evt_rec.CodeCreateEventRecord_;
rec->instruction_start = code->InstructionStart(cage_base);