44
55#include " src/parsing/background-parsing-task.h"
66
7+ #include " src/counters.h"
78#include " src/objects-inl.h"
89#include " src/parsing/parser.h"
910#include " src/parsing/scanner-character-streams.h"
@@ -20,7 +21,10 @@ void StreamedSource::Release() {
2021BackgroundParsingTask::BackgroundParsingTask (
2122 StreamedSource* source, ScriptCompiler::CompileOptions options,
2223 int stack_size, Isolate* isolate)
23- : source_(source), stack_size_(stack_size), script_data_(nullptr ) {
24+ : source_(source),
25+ stack_size_ (stack_size),
26+ script_data_(nullptr ),
27+ timer_(isolate->counters ()->compile_script_on_background()) {
2428 // We don't set the context to the CompilationInfo yet, because the background
2529 // thread cannot do anything with it anyway. We set it just before compilation
2630 // on the foreground thread.
@@ -67,6 +71,7 @@ BackgroundParsingTask::BackgroundParsingTask(
6771}
6872
6973void BackgroundParsingTask::Run () {
74+ TimedHistogramScope timer (timer_);
7075 DisallowHeapAllocation no_allocation;
7176 DisallowHandleAllocation no_handles;
7277 DisallowHandleDereference no_deref;
0 commit comments