Commit 934e8d3a authored by Mythri A's avatar Mythri A Committed by V8 LUCI CQ

[sparkplug] Retain baseline data in IsCompiledScope

With baseline code flushing we also need to hold baseline
data in IsCompiledScope. IsCompiledScope is used in places where we
don't want bytecode / baseline code to be flushed.

Change-Id: I692cdc5fc433dedeabcfc412d9f96d76148ddbe3
BUG: v8:12009
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3048172
Commit-Queue: Mythri Alle <mythria@chromium.org>
Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75903}
parent 8b385ee8
......@@ -466,21 +466,31 @@ IsCompiledScope SharedFunctionInfo::is_compiled_scope(IsolateT* isolate) const {
IsCompiledScope::IsCompiledScope(const SharedFunctionInfo shared,
Isolate* isolate)
: retain_bytecode_(shared.HasBytecodeArray()
? handle(shared.GetBytecodeArray(isolate), isolate)
: MaybeHandle<BytecodeArray>()),
is_compiled_(shared.is_compiled()) {
DCHECK_IMPLIES(!retain_bytecode_.is_null(), is_compiled());
: is_compiled_(shared.is_compiled()) {
if (shared.HasBytecodeArray()) {
retain_code_ = handle(shared.GetBytecodeArray(isolate), isolate);
} else if (shared.HasBaselineData()) {
retain_code_ = handle(shared.baseline_data(), isolate);
} else {
retain_code_ = MaybeHandle<HeapObject>();
}
DCHECK_IMPLIES(!retain_code_.is_null(), is_compiled());
}
IsCompiledScope::IsCompiledScope(const SharedFunctionInfo shared,
LocalIsolate* isolate)
: retain_bytecode_(shared.HasBytecodeArray()
? isolate->heap()->NewPersistentHandle(
shared.GetBytecodeArray(isolate))
: MaybeHandle<BytecodeArray>()),
is_compiled_(shared.is_compiled()) {
DCHECK_IMPLIES(!retain_bytecode_.is_null(), is_compiled());
: is_compiled_(shared.is_compiled()) {
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>();
}
DCHECK_IMPLIES(!retain_code_.is_null(), is_compiled());
}
bool SharedFunctionInfo::has_simple_parameters() {
......
......@@ -691,12 +691,12 @@ class V8_NODISCARD IsCompiledScope {
inline IsCompiledScope(const SharedFunctionInfo shared, Isolate* isolate);
inline IsCompiledScope(const SharedFunctionInfo shared,
LocalIsolate* isolate);
inline IsCompiledScope() : retain_bytecode_(), is_compiled_(false) {}
inline IsCompiledScope() : retain_code_(), is_compiled_(false) {}
inline bool is_compiled() const { return is_compiled_; }
private:
MaybeHandle<BytecodeArray> retain_bytecode_;
MaybeHandle<HeapObject> retain_code_;
bool is_compiled_;
};
......
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