Revision: 10604 Author: [email protected] Date: Mon Feb 6 00:59:43 2012 Log: Add timestamp to --trace-gc output.
BUG=v8:1932 TEST= Review URL: https://chromiumcodereview.appspot.com/9307116 http://code.google.com/p/v8/source/detail?r=10604 Modified: /branches/bleeding_edge/src/heap.cc /branches/bleeding_edge/src/isolate.cc /branches/bleeding_edge/src/isolate.h ======================================= --- /branches/bleeding_edge/src/heap.cc Fri Feb 3 06:16:40 2012 +++ /branches/bleeding_edge/src/heap.cc Mon Feb 6 00:59:43 2012 @@ -6594,6 +6594,8 @@ static_cast<int>(spent_in_mutator_)); } } + + PrintF("%8.0f ms: ", heap_->isolate()->time_millis_since_init()); if (!FLAG_trace_gc_nvp) { int external_time = static_cast<int>(scopes_[Scope::EXTERNAL]); ======================================= --- /branches/bleeding_edge/src/isolate.cc Wed Jan 18 08:16:11 2012 +++ /branches/bleeding_edge/src/isolate.cc Mon Feb 6 00:59:43 2012 @@ -1834,6 +1834,7 @@ } state_ = INITIALIZED; + time_millis_at_init_ = OS::TimeCurrentMillis(); return true; } ======================================= --- /branches/bleeding_edge/src/isolate.h Fri Jan 20 08:17:08 2012 +++ /branches/bleeding_edge/src/isolate.h Mon Feb 6 00:59:43 2012 @@ -1029,6 +1029,10 @@ void set_context_exit_happened(bool context_exit_happened) { context_exit_happened_ = context_exit_happened; } + + double time_millis_since_init() { + return OS::TimeCurrentMillis() - time_millis_at_init_; + } private: Isolate(); @@ -1200,6 +1204,9 @@ // that a context was recently exited. bool context_exit_happened_; + // Time stamp at initialization. + double time_millis_at_init_; + #if defined(V8_TARGET_ARCH_ARM) && !defined(__arm__) || \ defined(V8_TARGET_ARCH_MIPS) && !defined(__mips__) bool simulator_initialized_; -- v8-dev mailing list [email protected] http://groups.google.com/group/v8-dev
