Commit 3a1730f3 authored by Dominik Inführ's avatar Dominik Inführ Committed by Commit Bot

[interpreter] Run MaybePrintAst before parking

MaybePrintAst needs to be run before parking the thread. It allows
handle dereferences internally but that doesn't work when thread is
parked.

Bug: chromium:1193728
Change-Id: I0adbf6f236be8d442fd8be4d4d6e4931fcff4db6
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2794432Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#73736}
parent e07a2c35
......@@ -56,7 +56,6 @@ static const char* NameForNativeContextIntrinsicIndex(uint32_t idx) {
}
void AstNode::Print(Isolate* isolate) {
AllowHandleDereference allow_deref;
AstPrinter::PrintOut(isolate, this);
}
......@@ -243,7 +242,6 @@ std::unique_ptr<char[]> FunctionLiteral::GetDebugName() const {
} else if (raw_inferred_name_ != nullptr && !raw_inferred_name_->IsEmpty()) {
cons_string = raw_inferred_name_;
} else if (!inferred_name_.is_null()) {
AllowHandleDereference allow_deref;
return inferred_name_->ToCString();
} else {
char* empty_str = new char[1];
......
......@@ -184,12 +184,15 @@ InterpreterCompilationJob::Status InterpreterCompilationJob::ExecuteJobImpl() {
// TODO(lpy): add support for background compilation RCS trace.
TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.compile"), "V8.CompileIgnition");
base::Optional<ParkedScope> parked_scope;
if (local_isolate_) parked_scope.emplace(local_isolate_);
// Print AST if flag is enabled. Note, if compiling on a background thread
// then ASTs from different functions may be intersperse when printed.
MaybePrintAst(parse_info(), compilation_info());
{
DisallowGarbageCollection no_heap_access;
MaybePrintAst(parse_info(), compilation_info());
}
base::Optional<ParkedScope> parked_scope;
if (local_isolate_) parked_scope.emplace(local_isolate_);
generator()->GenerateBytecode(stack_limit());
......
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