Commit bbb4c24e authored by Leszek Swirski's avatar Leszek Swirski Committed by Commit Bot

[offthread] Make SFI printing off-thread friendly

Bug: chromium:1011762
Change-Id: I99d7d48543972c2de8c1728a75a81b6e83f0064f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2122030
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: 's avatarToon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/master@{#67233}
parent 934fdb0a
......@@ -1384,7 +1384,12 @@ void SharedFunctionInfo::SharedFunctionInfoPrint(std::ostream& os) { // NOLINT
os << "\n - expected_nof_properties: " << expected_nof_properties();
os << "\n - language_mode: " << language_mode();
os << "\n - data: " << Brief(function_data());
os << "\n - code (from data): " << Brief(GetCode());
os << "\n - code (from data): ";
if (Heap::InOffThreadSpace(*this)) {
os << "<not available off-thread>";
} else {
os << Brief(GetCode());
}
PrintSourceCode(os);
// Script files are often large, thus only print their {Brief} representation.
os << "\n - script: " << Brief(script());
......
......@@ -5179,9 +5179,9 @@ bool SharedFunctionInfo::PassesFilter(const char* raw_filter) {
}
bool SharedFunctionInfo::HasSourceCode() const {
Isolate* isolate = GetIsolate();
return !script().IsUndefined(isolate) &&
!Script::cast(script()).source().IsUndefined(isolate);
ReadOnlyRoots roots = GetReadOnlyRoots();
return !script().IsUndefined(roots) &&
!Script::cast(script()).source().IsUndefined(roots);
}
void SharedFunctionInfo::DiscardCompiledMetadata(
......
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