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

Unified Diff: runtime/vm/thread.cc

Issue 1314673008: Migrate logging infrastructure Isolate->Thread (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Finalize marking tasks in parallel, now that it's safe. Created 5 years, 3 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
« runtime/vm/log.cc ('K') | « runtime/vm/thread.h ('k') | no next file » | 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 7d817d3072249ccff66e41f6ef07c2fca4890a76..f938ef078472e9079381760b3aa3cbd06d2b34c0 100644
--- a/runtime/vm/thread.cc
+++ b/runtime/vm/thread.cc
@@ -7,6 +7,7 @@
#include "vm/growable_array.h"
#include "vm/isolate.h"
#include "vm/lockers.h"
+#include "vm/log.h"
#include "vm/object.h"
#include "vm/os_thread.h"
#include "vm/profiler.h"
@@ -52,6 +53,8 @@ Thread::~Thread() {
// Clear |this| from all isolate's thread registry.
ThreadPruner pruner(this);
Isolate::VisitIsolates(&pruner);
+ delete log_;
+ log_ = NULL;
}
@@ -108,7 +111,8 @@ Thread::Thread(bool init_vm_constants)
thread_interrupt_data_(NULL),
isolate_(NULL),
heap_(NULL),
- store_buffer_block_(NULL) {
+ store_buffer_block_(NULL),
+ log_(new class Log()) {
Ivan Posva 2015/09/08 21:22:22 I do not like the fact that we allocate this botto
koda 2015/09/09 00:26:57 The log is flushed by Print or by the destructor o
ClearState();
#define DEFAULT_INIT(type_name, member_name, init_expr, default_init_value) \
@@ -307,6 +311,15 @@ void Thread::set_cha(CHA* value) {
}
+class Log* Thread::Log() const {
+ if (isolate_ != NULL && isolate_->ShouldLog()) {
Ivan Posva 2015/09/08 21:22:22 This logic is now distributed across three differe
koda 2015/09/09 00:26:57 Moved the flag checking logic from Isolate to Log.
+ return log_;
+ } else {
+ return Log::NoOpLog();
+ }
+}
+
+
void Thread::SetThreadInterrupter(ThreadInterruptCallback callback,
void* data) {
ASSERT(Thread::Current() == this);
« runtime/vm/log.cc ('K') | « runtime/vm/thread.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698