Commit 8d47a28b authored by Leszek Swirski's avatar Leszek Swirski Committed by Commit Bot

[offthread] Release OffThreadParseInfoScope early

In off-thread compilation, the ParseInfo is released on the background
thread. We have to make sure to that the OffThreadParseInfoScope doesn't
try to reset its per-thread data in this case.

Bug: chromium:1011762
Change-Id: I6ddad6508cacc18f29e020e373783da64d3e4cb7
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2115431Reviewed-by: 's avatarRoss McIlroy <rmcilroy@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66860}
parent d7d18f9e
...@@ -1230,6 +1230,7 @@ class OffThreadParseInfoScope { ...@@ -1230,6 +1230,7 @@ class OffThreadParseInfoScope {
} }
~OffThreadParseInfoScope() { ~OffThreadParseInfoScope() {
DCHECK_NOT_NULL(parse_info_);
parse_info_->set_stack_limit(original_stack_limit_); parse_info_->set_stack_limit(original_stack_limit_);
parse_info_->set_runtime_call_stats(original_runtime_call_stats_); parse_info_->set_runtime_call_stats(original_runtime_call_stats_);
} }
...@@ -1251,8 +1252,9 @@ void BackgroundCompileTask::Run() { ...@@ -1251,8 +1252,9 @@ void BackgroundCompileTask::Run() {
DisallowHeapAccess no_heap_access; DisallowHeapAccess no_heap_access;
TimedHistogramScope timer(timer_); TimedHistogramScope timer(timer_);
OffThreadParseInfoScope off_thread_scope( base::Optional<OffThreadParseInfoScope> off_thread_scope(
info_.get(), worker_thread_runtime_call_stats_, stack_size_); base::in_place, info_.get(), worker_thread_runtime_call_stats_,
stack_size_);
TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.compile"), TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.compile"),
"BackgroundCompileTask::Run"); "BackgroundCompileTask::Run");
RuntimeCallTimerScope runtimeTimer( RuntimeCallTimerScope runtimeTimer(
...@@ -1311,6 +1313,7 @@ void BackgroundCompileTask::Run() { ...@@ -1311,6 +1313,7 @@ void BackgroundCompileTask::Run() {
TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.compile"), TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.compile"),
"V8.FinalizeCodeBackground.ReleaseParser"); "V8.FinalizeCodeBackground.ReleaseParser");
DCHECK_EQ(language_mode_, info_->language_mode()); DCHECK_EQ(language_mode_, info_->language_mode());
off_thread_scope.reset();
parser_.reset(); parser_.reset();
info_.reset(); info_.reset();
outer_function_job_.reset(); outer_function_job_.reset();
......
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