Commit 17c2f92c authored by Michael Lippautz's avatar Michael Lippautz Committed by Commit Bot

[oilpan] Fix logging in ThreadState

Move away from WTF DataLogF to VLOG

Usage:
  chrome --enable-logging=stderr --vmodule=*/heap/*=1

Change-Id: I379bb4fffa42986ce3efe593bd63547d12afef6e
Reviewed-on: https://chromium-review.googlesource.com/834509Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#525289}
parent 03bf2d2d
...@@ -146,6 +146,12 @@ void ThreadHeapStats::DecreaseAllocatedSpace(size_t delta) { ...@@ -146,6 +146,12 @@ void ThreadHeapStats::DecreaseAllocatedSpace(size_t delta) {
ProcessHeap::DecreaseTotalAllocatedSpace(delta); ProcessHeap::DecreaseTotalAllocatedSpace(delta);
} }
double ThreadHeapStats::LiveObjectRateSinceLastGC() const {
if (ObjectSizeAtLastGC() > 0)
return static_cast<double>(MarkedObjectSize()) / ObjectSizeAtLastGC();
return 0.0;
}
ThreadHeap::ThreadHeap(ThreadState* thread_state) ThreadHeap::ThreadHeap(ThreadState* thread_state)
: thread_state_(thread_state), : thread_state_(thread_state),
region_tree_(std::make_unique<RegionTree>()), region_tree_(std::make_unique<RegionTree>()),
......
...@@ -179,11 +179,12 @@ class ThreadHeapStats { ...@@ -179,11 +179,12 @@ class ThreadHeapStats {
void DecreaseAllocatedObjectSize(size_t delta); void DecreaseAllocatedObjectSize(size_t delta);
size_t AllocatedObjectSize() { return allocated_object_size_; } size_t AllocatedObjectSize() { return allocated_object_size_; }
void IncreaseMarkedObjectSize(size_t delta); void IncreaseMarkedObjectSize(size_t delta);
size_t MarkedObjectSize() { return marked_object_size_; } size_t MarkedObjectSize() const { return marked_object_size_; }
void IncreaseAllocatedSpace(size_t delta); void IncreaseAllocatedSpace(size_t delta);
void DecreaseAllocatedSpace(size_t delta); void DecreaseAllocatedSpace(size_t delta);
size_t AllocatedSpace() { return allocated_space_; } size_t AllocatedSpace() { return allocated_space_; }
size_t ObjectSizeAtLastGC() { return object_size_at_last_gc_; } size_t ObjectSizeAtLastGC() const { return object_size_at_last_gc_; }
double LiveObjectRateSinceLastGC() const;
void IncreaseWrapperCount(size_t delta) { wrapper_count_ += delta; } void IncreaseWrapperCount(size_t delta) { wrapper_count_ += delta; }
void DecreaseWrapperCount(size_t delta) { wrapper_count_ -= delta; } void DecreaseWrapperCount(size_t delta) { wrapper_count_ -= delta; }
size_t WrapperCount() { return AcquireLoad(&wrapper_count_); } size_t WrapperCount() { return AcquireLoad(&wrapper_count_); }
......
...@@ -508,8 +508,6 @@ class PLATFORM_EXPORT ThreadState { ...@@ -508,8 +508,6 @@ class PLATFORM_EXPORT ThreadState {
} }
}; };
static const char* GcReasonString(BlinkGC::GCReason);
// Returns |true| if |object| resides on this thread's heap. // Returns |true| if |object| resides on this thread's heap.
// It is well-defined to call this method on any heap allocated // It is well-defined to call this method on any heap allocated
// reference, provided its associated heap hasn't been detached // reference, provided its associated heap hasn't been detached
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment