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

Unified Diff: runtime/vm/thread.cc

Issue 2646443005: Track async causal stack traces (Closed)
Patch Set: rebase Created 3 years, 10 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/thread.h ('k') | runtime/vm/thread_registry.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/thread.cc
diff --git a/runtime/vm/thread.cc b/runtime/vm/thread.cc
index 16091844b0ee92302c0885f62fb57482e5b61685..dc54d6a01a2f1247565635c47a29582929588ca4 100644
--- a/runtime/vm/thread.cc
+++ b/runtime/vm/thread.cc
@@ -70,6 +70,7 @@ Thread::Thread(Isolate* isolate)
store_buffer_block_(NULL),
vm_tag_(0),
task_kind_(kUnknownTask),
+ async_stack_trace_(StackTrace::null()),
dart_stream_(NULL),
os_thread_(NULL),
thread_lock_(new Monitor()),
@@ -303,6 +304,27 @@ const char* Thread::TaskKindToCString(TaskKind kind) {
}
+RawStackTrace* Thread::async_stack_trace() const {
+ return async_stack_trace_;
+}
+
+
+void Thread::set_async_stack_trace(const StackTrace& stack_trace) {
+ ASSERT(!stack_trace.IsNull());
+ async_stack_trace_ = stack_trace.raw();
+}
+
+
+void Thread::set_raw_async_stack_trace(RawStackTrace* raw_stack_trace) {
+ async_stack_trace_ = raw_stack_trace;
+}
+
+
+void Thread::clear_async_stack_trace() {
+ async_stack_trace_ = StackTrace::null();
+}
+
+
bool Thread::EnterIsolate(Isolate* isolate) {
const bool kIsMutatorThread = true;
Thread* thread = isolate->ScheduleThread(kIsMutatorThread);
@@ -681,6 +703,7 @@ void Thread::VisitObjectPointers(ObjectPointerVisitor* visitor,
visitor->VisitPointer(reinterpret_cast<RawObject**>(&active_exception_));
visitor->VisitPointer(reinterpret_cast<RawObject**>(&active_stacktrace_));
visitor->VisitPointer(reinterpret_cast<RawObject**>(&sticky_error_));
+ visitor->VisitPointer(reinterpret_cast<RawObject**>(&async_stack_trace_));
// Visit the api local scope as it has all the api local handles.
ApiLocalScope* scope = api_top_scope_;
« no previous file with comments | « runtime/vm/thread.h ('k') | runtime/vm/thread_registry.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698