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

Unified Diff: runtime/vm/isolate.cc

Issue 109803002: Profiler Take 2 (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years 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
« no previous file with comments | « runtime/vm/dart.cc ('k') | runtime/vm/native_symbol_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/isolate.cc
diff --git a/runtime/vm/isolate.cc b/runtime/vm/isolate.cc
index 1874127f6f4e705609455b53624f7c9f81c8e9fb..6de24c355c4181e35475828f144c08a9280a4b20 100644
--- a/runtime/vm/isolate.cc
+++ b/runtime/vm/isolate.cc
@@ -30,6 +30,7 @@
#include "vm/stub_code.h"
#include "vm/symbols.h"
#include "vm/thread.h"
+#include "vm/thread_interrupter.h"
#include "vm/timer.h"
#include "vm/visitor.h"
@@ -339,13 +340,11 @@ Isolate::~Isolate() {
}
void Isolate::SetCurrent(Isolate* current) {
- Isolate* old_isolate = Current();
- if (old_isolate != NULL) {
- ProfilerManager::DescheduleIsolate(old_isolate);
- }
- Thread::SetThreadLocal(isolate_key, reinterpret_cast<uword>(current));
- if (current != NULL) {
- ProfilerManager::ScheduleIsolate(current);
+ Isolate* old_current = Current();
+ if (old_current != current) {
+ Profiler::EndExecution(old_current);
+ Thread::SetThreadLocal(isolate_key, reinterpret_cast<uword>(current));
+ Profiler::BeginExecution(current);
}
}
@@ -370,7 +369,7 @@ Isolate* Isolate::Init(const char* name_prefix) {
ASSERT(result != NULL);
// Setup for profiling.
- ProfilerManager::SetupIsolateForProfiling(result);
+ Profiler::InitProfilingForIsolate(result);
// TODO(5411455): For now just set the recently created isolate as
// the current isolate.
@@ -724,6 +723,9 @@ void Isolate::Shutdown() {
PrintInvokedFunctions();
}
+ // Write out profiler data if requested.
+ Profiler::WriteTracing(this);
+
// Write out the coverage data if collection has been enabled.
CodeCoverage::Write(this);
@@ -744,8 +746,7 @@ void Isolate::Shutdown() {
// TODO(5411455): For now just make sure there are no current isolates
// as we are shutting down the isolate.
SetCurrent(NULL);
- ProfilerManager::DescheduleIsolate(this);
- ProfilerManager::ShutdownIsolateForProfiling(this);
+ Profiler::ShutdownProfilingForIsolate(this);
}
« no previous file with comments | « runtime/vm/dart.cc ('k') | runtime/vm/native_symbol_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698