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

Unified Diff: runtime/vm/isolate.cc

Issue 1412733008: Switch profiler from isolates to threads (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 2 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/isolate.cc
diff --git a/runtime/vm/isolate.cc b/runtime/vm/isolate.cc
index aaef25c6f40e4431eaa25d31b2667a93085c81b4..6fc36f54d997c8a8cf0922d892855b9b1e6a7caf 100644
--- a/runtime/vm/isolate.cc
+++ b/runtime/vm/isolate.cc
@@ -784,7 +784,6 @@ Isolate::Isolate(const Dart_IsolateFlags& api_flags)
last_allocationprofile_gc_timestamp_(0),
object_id_ring_(NULL),
trace_buffer_(NULL),
- profiler_data_(NULL),
tag_table_(GrowableObjectArray::null()),
deoptimized_code_array_(GrowableObjectArray::null()),
background_compiler_(NULL),
@@ -1714,7 +1713,6 @@ void Isolate::Shutdown() {
Thread::ExitIsolate();
// All threads should have exited by now.
thread_registry()->CheckNotScheduled(this);
- Profiler::ShutdownProfilingForIsolate(this);
}
@@ -1921,62 +1919,6 @@ void Isolate::PrintJSON(JSONStream* stream, bool ref) {
}
-intptr_t Isolate::ProfileInterrupt() {
- // Other threads might be modifying these fields. Save them in locals so that
- // we can at least trust the NULL check.
- IsolateProfilerData* prof_data = profiler_data();
- if (prof_data == NULL) {
- // Profiler not setup for isolate.
- return 0;
- }
- if (prof_data->blocked()) {
- // Profiler blocked for this isolate.
- return 0;
- }
- Debugger* debug = debugger();
- if ((debug != NULL) && debug->IsPaused()) {
- // Paused at breakpoint. Don't tick.
- return 0;
- }
- MessageHandler* msg_handler = message_handler();
- if ((msg_handler != NULL) &&
- (msg_handler->paused_on_start() ||
- msg_handler->paused_on_exit())) {
- // Paused at start / exit . Don't tick.
- return 0;
- }
- // Make sure that the isolate's mutator thread does not change behind our
- // backs. Otherwise we find the entry in the registry and end up reading
- // the field again. Only by that time it has been reset to NULL because the
- // thread was in process of exiting the isolate.
- Thread* mutator = mutator_thread_;
- if (mutator == NULL) {
- // No active mutator.
- ProfileIdle();
- return 1;
- }
-
- // TODO(johnmccutchan): Sample all threads, not just the mutator thread.
- // TODO(johnmccutchan): Keep a global list of threads and use that
- // instead of Isolate.
- ThreadRegistry::EntryIterator it(thread_registry());
- while (it.HasNext()) {
- const ThreadRegistry::Entry& entry = it.Next();
- if (entry.thread == mutator) {
- ThreadInterrupter::InterruptThread(mutator);
- break;
- }
- }
- return 1;
-}
-
-
-void Isolate::ProfileIdle() {
- // Currently we are only sampling the mutator thread.
- vm_tag_counters_.Increment(VMTag::kIdleTagId);
-}
-
-
void Isolate::set_tag_table(const GrowableObjectArray& value) {
tag_table_ = value.raw();
}

Powered by Google App Engine
This is Rietveld 408576698