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

Unified Diff: runtime/vm/isolate.cc

Issue 205713004: Add isolate tag-profile and better handling of errors (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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/isolate.cc
diff --git a/runtime/vm/isolate.cc b/runtime/vm/isolate.cc
index 673fa0b72f1f76797b4c546e470f302248403245..b95c4c35deb365959f595aef5f1103d3bb7fd7fe 100644
--- a/runtime/vm/isolate.cc
+++ b/runtime/vm/isolate.cc
@@ -368,9 +368,11 @@ void Isolate::SetCurrent(Isolate* current) {
if (old_current != NULL) {
old_current->set_thread_state(NULL);
Profiler::EndExecution(old_current);
+ old_current->set_vm_tag(VMTag::kIdleTagId);
}
Thread::SetThreadLocal(isolate_key, reinterpret_cast<uword>(current));
if (current != NULL) {
+ current->set_vm_tag(VMTag::kVMTagId);
ASSERT(current->thread_state() == NULL);
InterruptableThreadState* thread_state =
ThreadInterrupter::GetCurrentThreadState();
@@ -923,6 +925,12 @@ void Isolate::PrintToJSONStream(JSONStream* stream, bool ref) {
timer_list().PrintTimersToJSONProperty(&jsobj);
+ if (object_store()->sticky_error() != Object::null()) {
+ Error& error = Error::Handle(this, object_store()->sticky_error());
+ ASSERT(!error.IsNull());
+ jsobj.AddProperty("stickyError", error, false);
turnidge 2014/03/24 20:22:13 rename to "error"?
Cutch 2014/03/25 14:39:06 Done.
+ }
+
{
JSONObject typeargsRef(&jsobj, "canonicalTypeArguments");
typeargsRef.AddProperty("type", "@TypeArgumentsList");
@@ -932,6 +940,23 @@ void Isolate::PrintToJSONStream(JSONStream* stream, bool ref) {
}
+void Isolate::ProfileInterrupt() {
+ InterruptableThreadState* state = thread_state();
+ if (state == NULL) {
+ // Isolate is not scheduled on a thread.
+ ProfileIdle();
+ return;
+ }
+ ASSERT(state->id != Thread::kInvalidThreadId);
+ ThreadInterrupter::InterruptThread(state);
+}
+
+
+void Isolate::ProfileIdle() {
+ vm_tag_counters_.Increment(vm_tag());
turnidge 2014/03/24 20:22:13 Is the vm_tag always the kIdleTagId here? Or are
Cutch 2014/03/25 14:39:06 It will always be kIdleTagId or kVMTagId (there is
+}
+
+
void Isolate::VisitIsolates(IsolateVisitor* visitor) {
if (visitor == NULL) {
return;

Powered by Google App Engine
This is Rietveld 408576698