Reviewers: Søren Gjesse,
Description:
Fix issue 738: make compilable with profilingsupport=off
BUG=738
[email protected]
Please review this at http://codereview.chromium.org/2800009/show
Affected files:
M src/heap-profiler.h
M src/heap-profiler.cc
M src/stub-cache.cc
Index: src/heap-profiler.cc
diff --git a/src/heap-profiler.cc b/src/heap-profiler.cc
index
ea17abc33d930dbf2dc2e2fcb755a063eb4380d6..55f09b92831f87e93a3338f1595b07b213b5a676
100644
--- a/src/heap-profiler.cc
+++ b/src/heap-profiler.cc
@@ -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);
Index: src/heap-profiler.h
diff --git a/src/heap-profiler.h b/src/heap-profiler.h
index
28e240daf666c5703e73605ce625c7ebfba01fad..b593b992bb981ac8ae181f763f8ded0a9522bb5c
100644
--- a/src/heap-profiler.h
+++ b/src/heap-profiler.h
@@ -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 {
Index: src/stub-cache.cc
diff --git a/src/stub-cache.cc b/src/stub-cache.cc
index
c1eaa050b5dd7382fff5b41a01d3ca3b25633ebd..ffa92dd3661a47964de25a255d4db472e990f022
100644
--- a/src/stub-cache.cc
+++ b/src/stub-cache.cc
@@ -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()));
}
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev