Commit 4440d7a5 authored by Leszek Swirski's avatar Leszek Swirski Committed by V8 LUCI CQ

[sparkplug] Fix IsCompiledScope

IsCompiledScope should check for BaselineData before BytecodeArray,
since the former implies the latter.

Bug: v8:11420
Change-Id: I6c659a5f97180b478fb3401f55a095b6d307b80f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3054117
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Mythri Alle <mythria@chromium.org>
Auto-Submit: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: 's avatarMythri Alle <mythria@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75924}
parent 5f8cd123
......@@ -467,10 +467,10 @@ IsCompiledScope SharedFunctionInfo::is_compiled_scope(IsolateT* isolate) const {
IsCompiledScope::IsCompiledScope(const SharedFunctionInfo shared,
Isolate* isolate)
: is_compiled_(shared.is_compiled()) {
if (shared.HasBytecodeArray()) {
retain_code_ = handle(shared.GetBytecodeArray(isolate), isolate);
} else if (shared.HasBaselineData()) {
if (shared.HasBaselineData()) {
retain_code_ = handle(shared.baseline_data(), isolate);
} else if (shared.HasBytecodeArray()) {
retain_code_ = handle(shared.GetBytecodeArray(isolate), isolate);
} else {
retain_code_ = MaybeHandle<HeapObject>();
}
......@@ -481,11 +481,11 @@ IsCompiledScope::IsCompiledScope(const SharedFunctionInfo shared,
IsCompiledScope::IsCompiledScope(const SharedFunctionInfo shared,
LocalIsolate* isolate)
: is_compiled_(shared.is_compiled()) {
if (shared.HasBytecodeArray()) {
if (shared.HasBaselineData()) {
retain_code_ = isolate->heap()->NewPersistentHandle(shared.baseline_data());
} else if (shared.HasBytecodeArray()) {
retain_code_ =
isolate->heap()->NewPersistentHandle(shared.GetBytecodeArray(isolate));
} else if (shared.HasBaselineData()) {
retain_code_ = isolate->heap()->NewPersistentHandle(shared.baseline_data());
} else {
retain_code_ = MaybeHandle<HeapObject>();
}
......
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