[heap] Hide GCTracer inside the heap component.
This prevents leakage of the gc-tracer.h declarations inside of the heap and prevents it from being exposed to the world. Protects private state from being inadvertently mocked with. R=mlippautz@chromium.org Review URL: https://codereview.chromium.org/1294763004 Cr-Commit-Position: refs/heads/master@{#30276}
This commit is contained in:
parent
267381d978
commit
1a3c7e2fb1
@ -18,6 +18,7 @@
|
||||
#include "src/deoptimizer.h"
|
||||
#include "src/global-handles.h"
|
||||
#include "src/heap/gc-idle-time-handler.h"
|
||||
#include "src/heap/gc-tracer.h"
|
||||
#include "src/heap/incremental-marking.h"
|
||||
#include "src/heap/mark-compact-inl.h"
|
||||
#include "src/heap/mark-compact.h"
|
||||
@ -97,7 +98,7 @@ Heap::Heap()
|
||||
inline_allocation_disabled_(false),
|
||||
store_buffer_rebuilder_(store_buffer()),
|
||||
total_regexp_code_generated_(0),
|
||||
tracer_(this),
|
||||
tracer_(nullptr),
|
||||
high_survival_rate_period_length_(0),
|
||||
promoted_objects_size_(0),
|
||||
promotion_ratio_(0),
|
||||
@ -5806,6 +5807,7 @@ bool Heap::SetUp() {
|
||||
deferred_counters_[i] = 0;
|
||||
}
|
||||
|
||||
tracer_ = new GCTracer(this);
|
||||
|
||||
LOG(isolate_, IntPtrTEvent("heap-capacity", Capacity()));
|
||||
LOG(isolate_, IntPtrTEvent("heap-available", Available()));
|
||||
@ -5878,8 +5880,9 @@ void Heap::TearDown() {
|
||||
PrintF("total_gc_time=%.1f ", total_gc_time_ms_);
|
||||
PrintF("min_in_mutator=%.1f ", get_min_in_mutator());
|
||||
PrintF("max_alive_after_gc=%" V8_PTR_PREFIX "d ", get_max_alive_after_gc());
|
||||
PrintF("total_marking_time=%.1f ", tracer_.cumulative_marking_duration());
|
||||
PrintF("total_sweeping_time=%.1f ", tracer_.cumulative_sweeping_duration());
|
||||
PrintF("total_marking_time=%.1f ", tracer()->cumulative_marking_duration());
|
||||
PrintF("total_sweeping_time=%.1f ",
|
||||
tracer()->cumulative_sweeping_duration());
|
||||
PrintF("\n\n");
|
||||
}
|
||||
|
||||
@ -5914,6 +5917,9 @@ void Heap::TearDown() {
|
||||
|
||||
mark_compact_collector()->TearDown();
|
||||
|
||||
delete tracer_;
|
||||
tracer_ = nullptr;
|
||||
|
||||
new_space_.TearDown();
|
||||
|
||||
if (old_space_ != NULL) {
|
||||
|
@ -12,7 +12,6 @@
|
||||
#include "src/assert-scope.h"
|
||||
#include "src/globals.h"
|
||||
#include "src/heap/gc-idle-time-handler.h"
|
||||
#include "src/heap/gc-tracer.h"
|
||||
#include "src/heap/incremental-marking.h"
|
||||
#include "src/heap/mark-compact.h"
|
||||
#include "src/heap/memory-reducer.h"
|
||||
@ -1344,7 +1343,7 @@ class Heap {
|
||||
|
||||
void ClearNormalizedMapCaches();
|
||||
|
||||
GCTracer* tracer() { return &tracer_; }
|
||||
GCTracer* tracer() { return tracer_; }
|
||||
|
||||
// Returns the size of objects residing in non new spaces.
|
||||
intptr_t PromotedSpaceSizeOfObjects();
|
||||
@ -2098,7 +2097,7 @@ class Heap {
|
||||
|
||||
int deferred_counters_[v8::Isolate::kUseCounterFeatureCount];
|
||||
|
||||
GCTracer tracer_;
|
||||
GCTracer* tracer_;
|
||||
|
||||
// Creates and installs the full-sized number string cache.
|
||||
int FullSizeNumberStringCacheLength();
|
||||
|
@ -7,6 +7,7 @@
|
||||
#include "src/code-stubs.h"
|
||||
#include "src/compilation-cache.h"
|
||||
#include "src/conversions.h"
|
||||
#include "src/heap/gc-tracer.h"
|
||||
#include "src/heap/mark-compact-inl.h"
|
||||
#include "src/heap/objects-visiting.h"
|
||||
#include "src/heap/objects-visiting-inl.h"
|
||||
|
@ -14,6 +14,7 @@
|
||||
#include "src/frames-inl.h"
|
||||
#include "src/gdb-jit.h"
|
||||
#include "src/global-handles.h"
|
||||
#include "src/heap/gc-tracer.h"
|
||||
#include "src/heap/incremental-marking.h"
|
||||
#include "src/heap/mark-compact-inl.h"
|
||||
#include "src/heap/objects-visiting.h"
|
||||
|
@ -5,6 +5,7 @@
|
||||
#include "src/heap/memory-reducer.h"
|
||||
|
||||
#include "src/flags.h"
|
||||
#include "src/heap/gc-tracer.h"
|
||||
#include "src/heap/heap.h"
|
||||
#include "src/objects-inl.h" // TODO(mstarzinger): Temporary cycle breaker!
|
||||
#include "src/utils.h"
|
||||
|
@ -28,8 +28,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <utility>
|
||||
|
||||
#include "src/v8.h"
|
||||
|
||||
#include "src/heap/gc-tracer.h"
|
||||
#include "test/cctest/cctest.h"
|
||||
|
||||
using namespace v8::internal;
|
||||
|
@ -28,14 +28,13 @@
|
||||
#include <stdlib.h>
|
||||
#include <utility>
|
||||
|
||||
#include "src/v8.h"
|
||||
|
||||
#include "src/compilation-cache.h"
|
||||
#include "src/context-measure.h"
|
||||
#include "src/deoptimizer.h"
|
||||
#include "src/execution.h"
|
||||
#include "src/factory.h"
|
||||
#include "src/global-handles.h"
|
||||
#include "src/heap/gc-tracer.h"
|
||||
#include "src/ic/ic.h"
|
||||
#include "src/macro-assembler.h"
|
||||
#include "src/snapshot/snapshot.h"
|
||||
|
Loading…
Reference in New Issue
Block a user