Fix issue 738: make compilable with profilingsupport=off
authormikhail.naganov@gmail.com <mikhail.naganov@gmail.com@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Wed, 16 Jun 2010 19:53:24 +0000 (19:53 +0000)
committermikhail.naganov@gmail.com <mikhail.naganov@gmail.com@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Wed, 16 Jun 2010 19:53:24 +0000 (19:53 +0000)
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

src/heap-profiler.cc
src/heap-profiler.h
src/stub-cache.cc

index ea17abc33d930dbf2dc2e2fcb755a063eb4380d6..55f09b92831f87e93a3338f1595b07b213b5a676 100644 (file)
@@ -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 28e240daf666c5703e73605ce625c7ebfba01fad..b593b992bb981ac8ae181f763f8ded0a9522bb5c 100644 (file)
@@ -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 c1eaa050b5dd7382fff5b41a01d3ca3b25633ebd..ffa92dd3661a47964de25a255d4db472e990f022 100644 (file)
@@ -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()));
   }