Fix issue 738: make compilable with profilingsupport=off
BUG=738 TBR=sgjesse@chromium.org Review URL: http://codereview.chromium.org/2800009 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4883 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
parent
f5fdef253b
commit
e6ea484e1f
@ -326,20 +326,27 @@ HeapProfiler::~HeapProfiler() {
|
||||
delete snapshots_;
|
||||
}
|
||||
|
||||
#endif // ENABLE_LOGGING_AND_PROFILING
|
||||
|
||||
void HeapProfiler::Setup() {
|
||||
#ifdef ENABLE_LOGGING_AND_PROFILING
|
||||
if (singleton_ == NULL) {
|
||||
singleton_ = new HeapProfiler();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
void HeapProfiler::TearDown() {
|
||||
#ifdef ENABLE_LOGGING_AND_PROFILING
|
||||
delete singleton_;
|
||||
singleton_ = NULL;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
#ifdef ENABLE_LOGGING_AND_PROFILING
|
||||
|
||||
HeapSnapshot* HeapProfiler::TakeSnapshot(const char* name) {
|
||||
ASSERT(singleton_ != NULL);
|
||||
return singleton_->TakeSnapshotImpl(name);
|
||||
|
@ -38,12 +38,16 @@ namespace internal {
|
||||
class HeapSnapshot;
|
||||
class HeapSnapshotsCollection;
|
||||
|
||||
#endif
|
||||
|
||||
// The HeapProfiler writes data to the log files, which can be postprocessed
|
||||
// to generate .hp files for use by the GHC/Valgrind tool hp2ps.
|
||||
class HeapProfiler {
|
||||
public:
|
||||
static void Setup();
|
||||
static void TearDown();
|
||||
|
||||
#ifdef ENABLE_LOGGING_AND_PROFILING
|
||||
static HeapSnapshot* TakeSnapshot(const char* name);
|
||||
static HeapSnapshot* TakeSnapshot(String* name);
|
||||
static int GetSnapshotsCount();
|
||||
@ -68,9 +72,12 @@ class HeapProfiler {
|
||||
unsigned next_snapshot_uid_;
|
||||
|
||||
static HeapProfiler* singleton_;
|
||||
#endif // ENABLE_LOGGING_AND_PROFILING
|
||||
};
|
||||
|
||||
|
||||
#ifdef ENABLE_LOGGING_AND_PROFILING
|
||||
|
||||
// JSObjectsCluster describes a group of JS objects that are
|
||||
// considered equivalent in terms of a particular profile.
|
||||
class JSObjectsCluster BASE_EMBEDDED {
|
||||
|
@ -1105,6 +1105,7 @@ Object* StubCompiler::CompileCallDebugBreak(Code::Flags flags) {
|
||||
Code* code = Code::cast(result);
|
||||
USE(code);
|
||||
Code::Kind kind = Code::ExtractKindFromFlags(flags);
|
||||
USE(kind);
|
||||
PROFILE(CodeCreateEvent(CALL_LOGGER_TAG(kind, CALL_DEBUG_BREAK_TAG),
|
||||
code, code->arguments_count()));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user