merged
authormikhail.naganov@gmail.com <mikhail.naganov@gmail.com@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Wed, 14 Apr 2010 18:48:05 +0000 (18:48 +0000)
committermikhail.naganov@gmail.com <mikhail.naganov@gmail.com@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Wed, 14 Apr 2010 18:48:05 +0000 (18:48 +0000)
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4422 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

16 files changed:
SConstruct
src/api.cc
src/cpu-profiler-inl.h
src/cpu-profiler.cc
src/cpu-profiler.h
src/log-inl.h
src/log.h
src/platform-linux.cc
src/platform-macos.cc
src/platform-win32.cc
src/profile-generator-inl.h
src/profile-generator.cc
src/profile-generator.h
test/cctest/test-cpu-profiler.cc
test/cctest/test-profile-generator.cc
tools/gyp/v8.gyp

index 1625b7a..ad28d6a 100644 (file)
@@ -114,9 +114,6 @@ LIBRARY_FLAGS = {
     'profilingsupport:on': {
       'CPPDEFINES':   ['ENABLE_VMSTATE_TRACKING', 'ENABLE_LOGGING_AND_PROFILING'],
     },
-    'cppprofilesprocessor:on': {
-      'CPPDEFINES':   ['ENABLE_CPP_PROFILES_PROCESSOR'],
-    },
     'debuggersupport:on': {
       'CPPDEFINES':   ['ENABLE_DEBUGGER_SUPPORT'],
     }
@@ -696,11 +693,6 @@ SIMPLE_OPTIONS = {
     'default': 'on',
     'help': 'enable profiling of JavaScript code'
   },
-  'cppprofilesprocessor': {
-    'values': ['on', 'off'],
-    'default': 'on',
-    'help': 'enable C++ profiles processor'
-  },
   'debuggersupport': {
     'values': ['on', 'off'],
     'default': 'on',
index 47950eb..3e3865f 100644 (file)
@@ -4027,7 +4027,7 @@ Local<Context> Debug::GetDebugContext() {
 #endif  // ENABLE_DEBUGGER_SUPPORT
 
 
-#ifdef ENABLE_CPP_PROFILES_PROCESSOR
+#ifdef ENABLE_LOGGING_AND_PROFILING
 
 Handle<String> CpuProfileNode::GetFunctionName() const {
   IsDeadCheck("v8::CpuProfileNode::GetFunctionName");
@@ -4148,7 +4148,7 @@ const CpuProfile* CpuProfiler::StopProfiling(Handle<String> title) {
       i::CpuProfiler::StopProfiling(*Utils::OpenHandle(*title)));
 }
 
-#endif  // ENABLE_CPP_PROFILES_PROCESSOR
+#endif  // ENABLE_LOGGING_AND_PROFILING
 
 
 namespace internal {
index 036e110..fb4f43b 100644 (file)
@@ -30,7 +30,7 @@
 
 #include "cpu-profiler.h"
 
-#ifdef ENABLE_CPP_PROFILES_PROCESSOR
+#ifdef ENABLE_LOGGING_AND_PROFILING
 
 #include "circular-queue-inl.h"
 #include "profile-generator-inl.h"
@@ -93,6 +93,6 @@ bool ProfilerEventsProcessor::FilterOutCodeCreateEvent(
 
 } }  // namespace v8::internal
 
-#endif  // ENABLE_CPP_PROFILES_PROCESSOR
+#endif  // ENABLE_LOGGING_AND_PROFILING
 
 #endif  // V8_CPU_PROFILER_INL_H_
index 22937c0..5ee0739 100644 (file)
@@ -29,7 +29,7 @@
 
 #include "cpu-profiler-inl.h"
 
-#ifdef ENABLE_CPP_PROFILES_PROCESSOR
+#ifdef ENABLE_LOGGING_AND_PROFILING
 
 #include "log-inl.h"
 
@@ -466,13 +466,13 @@ void CpuProfiler::StopProcessorIfLastProfile() {
 
 } }  // namespace v8::internal
 
-#endif  // ENABLE_CPP_PROFILES_PROCESSOR
+#endif  // ENABLE_LOGGING_AND_PROFILING
 
 namespace v8 {
 namespace internal {
 
 void CpuProfiler::Setup() {
-#ifdef ENABLE_CPP_PROFILES_PROCESSOR
+#ifdef ENABLE_LOGGING_AND_PROFILING
   if (singleton_ == NULL) {
     singleton_ = new CpuProfiler();
   }
@@ -481,7 +481,7 @@ void CpuProfiler::Setup() {
 
 
 void CpuProfiler::TearDown() {
-#ifdef ENABLE_CPP_PROFILES_PROCESSOR
+#ifdef ENABLE_LOGGING_AND_PROFILING
   if (singleton_ != NULL) {
     delete singleton_;
   }
index 594e44e..35d8d5e 100644 (file)
@@ -28,7 +28,7 @@
 #ifndef V8_CPU_PROFILER_H_
 #define V8_CPU_PROFILER_H_
 
-#ifdef ENABLE_CPP_PROFILES_PROCESSOR
+#ifdef ENABLE_LOGGING_AND_PROFILING
 
 #include "circular-queue.h"
 
@@ -197,7 +197,7 @@ class ProfilerEventsProcessor : public Thread {
   } while (false)
 #else
 #define PROFILE(Call) LOG(Call)
-#endif  // ENABLE_CPP_PROFILES_PROCESSOR
+#endif  // ENABLE_LOGGING_AND_PROFILING
 
 
 namespace v8 {
@@ -208,7 +208,7 @@ class CpuProfiler {
   static void Setup();
   static void TearDown();
 
-#ifdef ENABLE_CPP_PROFILES_PROCESSOR
+#ifdef ENABLE_LOGGING_AND_PROFILING
   static void StartProfiling(const char* title);
   static void StartProfiling(String* title);
   static CpuProfile* StopProfiling(const char* title);
@@ -265,7 +265,7 @@ class CpuProfiler {
 
 #else
   static INLINE(bool is_profiling()) { return false; }
-#endif  // ENABLE_CPP_PROFILES_PROCESSOR
+#endif  // ENABLE_LOGGING_AND_PROFILING
 
  private:
   DISALLOW_COPY_AND_ASSIGN(CpuProfiler);
index f8242e1..02238fe 100644 (file)
@@ -38,7 +38,6 @@ namespace internal {
 
 Logger::LogEventsAndTags Logger::ToNativeByScript(Logger::LogEventsAndTags tag,
                                                   Script* script) {
-#ifdef ENABLE_CPP_PROFILES_PROCESSOR
   if ((tag == FUNCTION_TAG || tag == LAZY_COMPILE_TAG || tag == SCRIPT_TAG)
       && script->type()->value() == Script::TYPE_NATIVE) {
     switch (tag) {
@@ -50,9 +49,6 @@ Logger::LogEventsAndTags Logger::ToNativeByScript(Logger::LogEventsAndTags tag,
   } else {
     return tag;
   }
-#else
-  return tag;
-#endif  // ENABLE_CPP_PROFILES_PROCESSOR
 }
 
 #endif  // ENABLE_LOGGING_AND_PROFILING
index b54428a..ea9dc81 100644 (file)
--- a/src/log.h
+++ b/src/log.h
@@ -87,7 +87,7 @@ class CompressionHelper;
 #define LOG(Call) ((void) 0)
 #endif
 
-#define LOG_EVENTS_AND_TAGS_LIST_NO_NATIVES(V) \
+#define LOG_EVENTS_AND_TAGS_LIST(V) \
   V(CODE_CREATION_EVENT,            "code-creation",          "cc")       \
   V(CODE_MOVE_EVENT,                "code-move",              "cm")       \
   V(CODE_DELETE_EVENT,              "code-delete",            "cd")       \
@@ -116,19 +116,13 @@ class CompressionHelper;
   V(REG_EXP_TAG,                    "RegExp",                 "re")       \
   V(SCRIPT_TAG,                     "Script",                 "sc")       \
   V(STORE_IC_TAG,                   "StoreIC",                "sic")      \
-  V(STUB_TAG,                       "Stub",                   "s")
-
-#ifdef ENABLE_CPP_PROFILES_PROCESSOR
-// Add 'NATIVE_' cases for functions and scripts, but map them to
-// original tags when writing to the log.
-#define LOG_EVENTS_AND_TAGS_LIST(V) \
-  LOG_EVENTS_AND_TAGS_LIST_NO_NATIVES(V)                                  \
+  V(STUB_TAG,                       "Stub",                   "s")        \
   V(NATIVE_FUNCTION_TAG,            "Function",               "f")        \
   V(NATIVE_LAZY_COMPILE_TAG,        "LazyCompile",            "lc")       \
   V(NATIVE_SCRIPT_TAG,              "Script",                 "sc")
-#else
-#define LOG_EVENTS_AND_TAGS_LIST(V) LOG_EVENTS_AND_TAGS_LIST_NO_NATIVES(V)
-#endif
+// Note that 'NATIVE_' cases for functions and scripts are mapped onto
+// original tags when writing to the log.
+
 
 class Logger {
  public:
index 185b2fe..ea1830f 100644 (file)
@@ -728,10 +728,7 @@ static void ProfilerSignalHandler(int signal, siginfo_t* info, void* context) {
   if (active_sampler_ == NULL) return;
 
   TickSample sample_obj;
-  TickSample* sample = NULL;
-#ifdef ENABLE_CPP_PROFILES_PROCESSOR
-  sample = CpuProfiler::TickSampleEvent();
-#endif
+  TickSample* sample = CpuProfiler::TickSampleEvent();
   if (sample == NULL) sample = &sample_obj;
 
   // We always sample the VM state.
index e50517c..5516909 100644 (file)
@@ -547,10 +547,7 @@ class Sampler::PlatformData : public Malloced {
     // Loop until the sampler is disengaged, keeping the specified samling freq.
     for ( ; sampler_->IsActive(); OS::Sleep(sampler_->interval_)) {
       TickSample sample_obj;
-      TickSample* sample = NULL;
-#ifdef ENABLE_CPP_PROFILES_PROCESSOR
-      sample = CpuProfiler::TickSampleEvent();
-#endif
+      TickSample* sample = CpuProfiler::TickSampleEvent();
       if (sample == NULL) sample = &sample_obj;
 
       // We always sample the VM state.
index 7f3d95a..d03a0a9 100644 (file)
@@ -1806,10 +1806,7 @@ class Sampler::PlatformData : public Malloced {
     // Loop until the sampler is disengaged, keeping the specified samling freq.
     for ( ; sampler_->IsActive(); Sleep(sampler_->interval_)) {
       TickSample sample_obj;
-      TickSample* sample = NULL;
-#ifdef ENABLE_CPP_PROFILES_PROCESSOR
-      sample = CpuProfiler::TickSampleEvent();
-#endif
+      TickSample* sample = CpuProfiler::TickSampleEvent();
       if (sample == NULL) sample = &sample_obj;
 
       // We always sample the VM state.
index b4fdfb7..0f17c4f 100644 (file)
@@ -28,7 +28,7 @@
 #ifndef V8_PROFILE_GENERATOR_INL_H_
 #define V8_PROFILE_GENERATOR_INL_H_
 
-#ifdef ENABLE_CPP_PROFILES_PROCESSOR
+#ifdef ENABLE_LOGGING_AND_PROFILING
 
 #include "profile-generator.h"
 
@@ -118,6 +118,6 @@ CodeEntry* ProfileGenerator::EntryForVMState(StateTag tag) {
 
 } }  // namespace v8::internal
 
-#endif  // ENABLE_CPP_PROFILES_PROCESSOR
+#endif  // ENABLE_LOGGING_AND_PROFILING
 
 #endif  // V8_PROFILE_GENERATOR_INL_H_
index b809aab..5e7bea1 100644 (file)
@@ -25,7 +25,7 @@
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-#ifdef ENABLE_CPP_PROFILES_PROCESSOR
+#ifdef ENABLE_LOGGING_AND_PROFILING
 
 #include "v8.h"
 
@@ -522,4 +522,4 @@ void ProfileGenerator::RecordTickSample(const TickSample& sample) {
 
 } }  // namespace v8::internal
 
-#endif  // ENABLE_CPP_PROFILES_PROCESSOR
+#endif  // ENABLE_LOGGING_AND_PROFILING
index 79bef09..b02ba85 100644 (file)
@@ -28,7 +28,7 @@
 #ifndef V8_PROFILE_GENERATOR_H_
 #define V8_PROFILE_GENERATOR_H_
 
-#ifdef ENABLE_CPP_PROFILES_PROCESSOR
+#ifdef ENABLE_LOGGING_AND_PROFILING
 
 #include "hashmap.h"
 
@@ -304,6 +304,6 @@ class ProfileGenerator {
 
 } }  // namespace v8::internal
 
-#endif  // ENABLE_CPP_PROFILES_PROCESSOR
+#endif  // ENABLE_LOGGING_AND_PROFILING
 
 #endif  // V8_PROFILE_GENERATOR_H_
index 81d981e..1ed89b9 100644 (file)
@@ -2,7 +2,7 @@
 //
 // Tests of profiles generator and utilities.
 
-#ifdef ENABLE_CPP_PROFILES_PROCESSOR
+#ifdef ENABLE_LOGGING_AND_PROFILING
 
 #include "v8.h"
 #include "cpu-profiler-inl.h"
@@ -222,4 +222,4 @@ TEST(TickEvents) {
   CHECK_EQ("bbb", bottom_up_ddd_stub_children->last()->entry()->name());
 }
 
-#endif  // ENABLE_CPP_PROFILES_PROCESSOR
+#endif  // ENABLE_LOGGING_AND_PROFILING
index 15a5b5a..c20dac6 100644 (file)
@@ -2,7 +2,7 @@
 //
 // Tests of profiles generator and utilities.
 
-#ifdef ENABLE_CPP_PROFILES_PROCESSOR
+#ifdef ENABLE_LOGGING_AND_PROFILING
 
 #include "v8.h"
 #include "profile-generator-inl.h"
@@ -443,4 +443,4 @@ TEST(RecordTickSample) {
   CHECK_EQ(entry1, node4->entry());
 }
 
-#endif  // ENABLE_CPP_PROFILES_PROCESSOR
+#endif  // ENABLE_LOGGING_AND_PROFILING
index 39e20d6..847b4be 100644 (file)
@@ -38,7 +38,6 @@
       'ENABLE_LOGGING_AND_PROFILING',
       'ENABLE_DEBUGGER_SUPPORT',
       'ENABLE_VMSTATE_TRACKING',
-      'ENABLE_CPP_PROFILES_PROCESSOR',
     ],
     'conditions': [
       ['target_arch=="arm"', {