Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(318)

Unified Diff: runtime/vm/compiler.cc

Issue 1841213003: Move CompilerStats from isolate to thread. Aggregate stats. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: cleanup Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: runtime/vm/compiler.cc
diff --git a/runtime/vm/compiler.cc b/runtime/vm/compiler.cc
index bf5eac59933cec7484c67d3055bb0ec67b8e600c..92c3d68f3c69c4292e80586d03c19b1117ca946a 100644
--- a/runtime/vm/compiler.cc
+++ b/runtime/vm/compiler.cc
@@ -1670,12 +1670,15 @@ void BackgroundCompiler::Run() {
ASSERT(result);
{
Thread* thread = Thread::Current();
+ Isolate* isolate = thread->isolate();
StackZone stack_zone(thread);
Zone* zone = stack_zone.GetZone();
HANDLESCOPE(thread);
Function& function = Function::Handle(zone);
function = function_queue()->PeekFunction();
while (running_ && !function.IsNull()) {
+ // Check that we have aggregated and cleared the stats.
+ ASSERT(thread->compiler_stats()->IsCleared());
const Error& error = Error::Handle(zone,
Compiler::CompileOptimizedFunction(thread,
function,
@@ -1685,6 +1688,8 @@ void BackgroundCompiler::Run() {
// unoptimized code. Any issues while optimizing are flagged by
// making the result invalid.
ASSERT(error.IsNull());
+ isolate->aggregate_compiler_stats()->Add(*thread->compiler_stats());
+ thread->compiler_stats()->Clear();
QueueElement* qelem = function_queue()->Remove();
delete qelem;
function = function_queue()->PeekFunction();

Powered by Google App Engine
This is Rietveld 408576698