Commit fd9d6fef authored by Patrick Thier's avatar Patrick Thier Committed by V8 LUCI CQ

[sparkplug] Add tracing for batch compilation

Add flag --trace-baseline-batch-compilation to enable tracing for
baseline batch compilation.

Bug: v8:11790
Change-Id: I2b05017181b95bf3bccb70e2092250211dafb86c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2945174Reviewed-by: 's avatarCamillo Bruni <cbruni@chromium.org>
Commit-Queue: Patrick Thier <pthier@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75014}
parent 5c89c4c7
......@@ -50,12 +50,31 @@ bool BaselineBatchCompiler::EnqueueFunction(Handle<JSFunction> function) {
isolate_, function, Compiler::CLEAR_EXCEPTION, &is_compiled_scope);
}
int estimated_size;
{
DisallowHeapAllocation no_gc;
estimated_instruction_size_ += BaselineCompiler::EstimateInstructionSize(
estimated_size = BaselineCompiler::EstimateInstructionSize(
shared->GetBytecodeArray(isolate_));
}
estimated_instruction_size_ += estimated_size;
if (FLAG_trace_baseline_batch_compilation) {
CodeTracer::Scope trace_scope(isolate_->GetCodeTracer());
PrintF(trace_scope.file(),
"[Baseline batch compilation] Enqueued function ");
function->PrintName(trace_scope.file());
PrintF(trace_scope.file(),
" with estimated size %d (current budget: %d/%d)\n", estimated_size,
estimated_instruction_size_,
FLAG_baseline_batch_compilation_threshold);
}
if (ShouldCompileBatch()) {
if (FLAG_trace_baseline_batch_compilation) {
CodeTracer::Scope trace_scope(isolate_->GetCodeTracer());
PrintF(trace_scope.file(),
"[Baseline batch compilation] Compiling current batch of %d "
"functions\n",
(last_index_ + 1));
}
CompileBatch(function);
return true;
}
......
......@@ -669,6 +669,8 @@ DEFINE_BOOL(baseline_batch_compilation, false, "batch compile Sparkplug code")
DEFINE_INT(baseline_batch_compilation_threshold, 4 * KB,
"the estimated instruction size of a batch to trigger compilation")
DEFINE_BOOL(trace_baseline, false, "trace baseline compilation")
DEFINE_BOOL(trace_baseline_batch_compilation, false,
"trace baseline batch compilation")
#undef FLAG
#define FLAG FLAG_FULL
......
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