Commit 7d4208ae authored by Sigurd Schneider's avatar Sigurd Schneider Committed by Commit Bot

[cctest] Add V8_EXPORT_PRIVATE for cctest (profiler part)

Bug: v8:9020

Change-Id: I851e9a18eab0812e009d323cd98814bebc83f003
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1541047
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: 's avatarPeter Marshall <petermarshall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60487}
parent fe3a83f2
...@@ -26,7 +26,7 @@ namespace sampler { ...@@ -26,7 +26,7 @@ namespace sampler {
// (if used for profiling) the program counter and stack pointer for // (if used for profiling) the program counter and stack pointer for
// the thread that created it. // the thread that created it.
class Sampler { class V8_EXPORT_PRIVATE Sampler {
public: public:
static const int kMaxFramesCountLog2 = 8; static const int kMaxFramesCountLog2 = 8;
static const unsigned kMaxFramesCount = (1u << kMaxFramesCountLog2) - 1; static const unsigned kMaxFramesCount = (1u << kMaxFramesCountLog2) - 1;
...@@ -96,7 +96,7 @@ typedef std::atomic_bool AtomicMutex; ...@@ -96,7 +96,7 @@ typedef std::atomic_bool AtomicMutex;
// A helper that uses an std::atomic_bool to create a lock that is obtained on // A helper that uses an std::atomic_bool to create a lock that is obtained on
// construction and released on destruction. // construction and released on destruction.
class AtomicGuard { class V8_EXPORT_PRIVATE AtomicGuard {
public: public:
// Attempt to obtain the lock represented by |atomic|. |is_blocking| // Attempt to obtain the lock represented by |atomic|. |is_blocking|
// determines whether we will block to obtain the lock, or only make one // determines whether we will block to obtain the lock, or only make one
...@@ -118,7 +118,7 @@ class AtomicGuard { ...@@ -118,7 +118,7 @@ class AtomicGuard {
// SamplerManager keeps a list of Samplers per thread, and allows the caller to // SamplerManager keeps a list of Samplers per thread, and allows the caller to
// take a sample for every Sampler on the current thread. // take a sample for every Sampler on the current thread.
class SamplerManager { class V8_EXPORT_PRIVATE SamplerManager {
public: public:
typedef std::vector<Sampler*> SamplerList; typedef std::vector<Sampler*> SamplerList;
......
...@@ -61,7 +61,7 @@ class AllocationTraceTree { ...@@ -61,7 +61,7 @@ class AllocationTraceTree {
AllocationTraceNode* AddPathFromEnd(const Vector<unsigned>& path); AllocationTraceNode* AddPathFromEnd(const Vector<unsigned>& path);
AllocationTraceNode* root() { return &root_; } AllocationTraceNode* root() { return &root_; }
unsigned next_node_id() { return next_node_id_++; } unsigned next_node_id() { return next_node_id_++; }
void Print(AllocationTracker* tracker); V8_EXPORT_PRIVATE void Print(AllocationTracker* tracker);
private: private:
unsigned next_node_id_; unsigned next_node_id_;
...@@ -70,8 +70,7 @@ class AllocationTraceTree { ...@@ -70,8 +70,7 @@ class AllocationTraceTree {
DISALLOW_COPY_AND_ASSIGN(AllocationTraceTree); DISALLOW_COPY_AND_ASSIGN(AllocationTraceTree);
}; };
class V8_EXPORT_PRIVATE AddressToTraceMap {
class AddressToTraceMap {
public: public:
void AddRange(Address addr, int size, unsigned node_id); void AddRange(Address addr, int size, unsigned node_id);
unsigned GetTraceNodeId(Address addr); unsigned GetTraceNodeId(Address addr);
...@@ -110,7 +109,7 @@ class AllocationTracker { ...@@ -110,7 +109,7 @@ class AllocationTracker {
AllocationTracker(HeapObjectsMap* ids, StringsStorage* names); AllocationTracker(HeapObjectsMap* ids, StringsStorage* names);
~AllocationTracker(); ~AllocationTracker();
void PrepareForSerialization(); V8_EXPORT_PRIVATE void PrepareForSerialization();
void AllocationEvent(Address addr, int size); void AllocationEvent(Address addr, int size);
AllocationTraceTree* trace_tree() { return &trace_tree_; } AllocationTraceTree* trace_tree() { return &trace_tree_; }
......
...@@ -132,7 +132,8 @@ class CodeEventsContainer { ...@@ -132,7 +132,8 @@ class CodeEventsContainer {
// This class implements both the profile events processor thread and // This class implements both the profile events processor thread and
// methods called by event producers: VM and stack sampler threads. // methods called by event producers: VM and stack sampler threads.
class ProfilerEventsProcessor : public base::Thread, public CodeEventObserver { class V8_EXPORT_PRIVATE ProfilerEventsProcessor : public base::Thread,
public CodeEventObserver {
public: public:
virtual ~ProfilerEventsProcessor(); virtual ~ProfilerEventsProcessor();
...@@ -174,7 +175,8 @@ class ProfilerEventsProcessor : public base::Thread, public CodeEventObserver { ...@@ -174,7 +175,8 @@ class ProfilerEventsProcessor : public base::Thread, public CodeEventObserver {
Isolate* isolate_; Isolate* isolate_;
}; };
class SamplingEventsProcessor : public ProfilerEventsProcessor { class V8_EXPORT_PRIVATE SamplingEventsProcessor
: public ProfilerEventsProcessor {
public: public:
SamplingEventsProcessor(Isolate* isolate, ProfileGenerator* generator, SamplingEventsProcessor(Isolate* isolate, ProfileGenerator* generator,
base::TimeDelta period); base::TimeDelta period);
...@@ -210,7 +212,7 @@ class SamplingEventsProcessor : public ProfilerEventsProcessor { ...@@ -210,7 +212,7 @@ class SamplingEventsProcessor : public ProfilerEventsProcessor {
const base::TimeDelta period_; // Samples & code events processing period. const base::TimeDelta period_; // Samples & code events processing period.
}; };
class CpuProfiler { class V8_EXPORT_PRIVATE CpuProfiler {
public: public:
explicit CpuProfiler(Isolate* isolate); explicit CpuProfiler(Isolate* isolate);
......
...@@ -146,8 +146,8 @@ class HeapEntry { ...@@ -146,8 +146,8 @@ class HeapEntry {
const char* description, HeapEntry* child, const char* description, HeapEntry* child,
StringsStorage* strings); StringsStorage* strings);
void Print( V8_EXPORT_PRIVATE void Print(const char* prefix, const char* edge_name,
const char* prefix, const char* edge_name, int max_depth, int indent); int max_depth, int indent);
private: private:
V8_INLINE std::vector<HeapGraphEdge*>::iterator children_begin() const; V8_INLINE std::vector<HeapGraphEdge*>::iterator children_begin() const;
...@@ -311,7 +311,7 @@ class SnapshottingProgressReportingInterface { ...@@ -311,7 +311,7 @@ class SnapshottingProgressReportingInterface {
}; };
// An implementation of V8 heap graph extractor. // An implementation of V8 heap graph extractor.
class V8HeapExplorer : public HeapEntriesAllocator { class V8_EXPORT_PRIVATE V8HeapExplorer : public HeapEntriesAllocator {
public: public:
V8HeapExplorer(HeapSnapshot* snapshot, V8HeapExplorer(HeapSnapshot* snapshot,
SnapshottingProgressReportingInterface* progress, SnapshottingProgressReportingInterface* progress,
......
...@@ -29,7 +29,7 @@ struct TickSample; ...@@ -29,7 +29,7 @@ struct TickSample;
// Provides a mapping from the offsets within generated code or a bytecode array // Provides a mapping from the offsets within generated code or a bytecode array
// to the source line and inlining id. // to the source line and inlining id.
class SourcePositionTable : public Malloced { class V8_EXPORT_PRIVATE SourcePositionTable : public Malloced {
public: public:
SourcePositionTable() = default; SourcePositionTable() = default;
...@@ -144,16 +144,16 @@ class CodeEntry { ...@@ -144,16 +144,16 @@ class CodeEntry {
} }
static const char* const kWasmResourceNamePrefix; static const char* const kWasmResourceNamePrefix;
static const char* const kEmptyResourceName; V8_EXPORT_PRIVATE static const char* const kEmptyResourceName;
static const char* const kEmptyBailoutReason; static const char* const kEmptyBailoutReason;
static const char* const kNoDeoptReason; static const char* const kNoDeoptReason;
static const char* const kProgramEntryName; V8_EXPORT_PRIVATE static const char* const kProgramEntryName;
static const char* const kIdleEntryName; V8_EXPORT_PRIVATE static const char* const kIdleEntryName;
static const char* const kGarbageCollectorEntryName; static const char* const kGarbageCollectorEntryName;
// Used to represent frames for which we have no reliable way to // Used to represent frames for which we have no reliable way to
// detect function. // detect function.
static const char* const kUnresolvedFunctionName; V8_EXPORT_PRIVATE static const char* const kUnresolvedFunctionName;
V8_INLINE static CodeEntry* program_entry() { V8_INLINE static CodeEntry* program_entry() {
return kProgramEntry.Pointer(); return kProgramEntry.Pointer();
...@@ -231,7 +231,7 @@ typedef std::vector<CodeEntryAndLineNumber> ProfileStackTrace; ...@@ -231,7 +231,7 @@ typedef std::vector<CodeEntryAndLineNumber> ProfileStackTrace;
class ProfileTree; class ProfileTree;
class ProfileNode { class V8_EXPORT_PRIVATE ProfileNode {
public: public:
inline ProfileNode(ProfileTree* tree, CodeEntry* entry, ProfileNode* parent, inline ProfileNode(ProfileTree* tree, CodeEntry* entry, ProfileNode* parent,
int line_number = 0); int line_number = 0);
...@@ -298,7 +298,7 @@ class ProfileNode { ...@@ -298,7 +298,7 @@ class ProfileNode {
DISALLOW_COPY_AND_ASSIGN(ProfileNode); DISALLOW_COPY_AND_ASSIGN(ProfileNode);
}; };
class ProfileTree { class V8_EXPORT_PRIVATE ProfileTree {
public: public:
explicit ProfileTree(Isolate* isolate); explicit ProfileTree(Isolate* isolate);
~ProfileTree(); ~ProfileTree();
...@@ -379,7 +379,7 @@ class CpuProfile { ...@@ -379,7 +379,7 @@ class CpuProfile {
void UpdateTicksScale(); void UpdateTicksScale();
void Print(); V8_EXPORT_PRIVATE void Print();
private: private:
void StreamPendingTraceEvents(); void StreamPendingTraceEvents();
...@@ -400,7 +400,7 @@ class CpuProfile { ...@@ -400,7 +400,7 @@ class CpuProfile {
DISALLOW_COPY_AND_ASSIGN(CpuProfile); DISALLOW_COPY_AND_ASSIGN(CpuProfile);
}; };
class CodeMap { class V8_EXPORT_PRIVATE CodeMap {
public: public:
CodeMap(); CodeMap();
~CodeMap(); ~CodeMap();
...@@ -436,7 +436,7 @@ class CodeMap { ...@@ -436,7 +436,7 @@ class CodeMap {
DISALLOW_COPY_AND_ASSIGN(CodeMap); DISALLOW_COPY_AND_ASSIGN(CodeMap);
}; };
class CpuProfilesCollection { class V8_EXPORT_PRIVATE CpuProfilesCollection {
public: public:
explicit CpuProfilesCollection(Isolate* isolate); explicit CpuProfilesCollection(Isolate* isolate);
...@@ -473,7 +473,7 @@ class CpuProfilesCollection { ...@@ -473,7 +473,7 @@ class CpuProfilesCollection {
DISALLOW_COPY_AND_ASSIGN(CpuProfilesCollection); DISALLOW_COPY_AND_ASSIGN(CpuProfilesCollection);
}; };
class ProfileGenerator { class V8_EXPORT_PRIVATE ProfileGenerator {
public: public:
explicit ProfileGenerator(CpuProfilesCollection* profiles); explicit ProfileGenerator(CpuProfilesCollection* profiles);
......
...@@ -23,7 +23,7 @@ class CodeEventObserver { ...@@ -23,7 +23,7 @@ class CodeEventObserver {
virtual ~CodeEventObserver() = default; virtual ~CodeEventObserver() = default;
}; };
class ProfilerListener : public CodeEventListener { class V8_EXPORT_PRIVATE ProfilerListener : public CodeEventListener {
public: public:
ProfilerListener(Isolate*, CodeEventObserver*); ProfilerListener(Isolate*, CodeEventObserver*);
~ProfilerListener() override; ~ProfilerListener() override;
......
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