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

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
« no previous file with comments | « runtime/vm/isolate.h ('k') | runtime/vm/profiler.h » ('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 673fa0b72f1f76797b4c546e470f302248403245..fdaf5a62441142dd772095520eb4e9c0c498c297 100644
--- a/runtime/vm/isolate.cc
+++ b/runtime/vm/isolate.cc
@@ -338,7 +338,7 @@ Isolate::Isolate()
REUSABLE_HANDLE_LIST(REUSABLE_HANDLE_INITIALIZERS)
REUSABLE_HANDLE_LIST(REUSABLE_HANDLE_SCOPE_INIT)
reusable_handles_() {
- set_vm_tag(VMTag::kVMTagId);
+ set_vm_tag(VMTag::kIdleTagId);
}
#undef REUSABLE_HANDLE_SCOPE_INIT
#undef REUSABLE_HANDLE_INITIALIZERS
@@ -366,6 +366,7 @@ Isolate::~Isolate() {
void Isolate::SetCurrent(Isolate* current) {
Isolate* old_current = Current();
if (old_current != NULL) {
+ old_current->set_vm_tag(VMTag::kIdleTagId);
old_current->set_thread_state(NULL);
Profiler::EndExecution(old_current);
}
@@ -379,6 +380,7 @@ void Isolate::SetCurrent(Isolate* current) {
#endif
Profiler::BeginExecution(current);
current->set_thread_state(thread_state);
+ current->set_vm_tag(VMTag::kVMTagId);
}
}
@@ -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("error", error, false);
+ }
+
{
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());
+}
+
+
void Isolate::VisitIsolates(IsolateVisitor* visitor) {
if (visitor == NULL) {
return;
« no previous file with comments | « runtime/vm/isolate.h ('k') | runtime/vm/profiler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698