merged

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4422 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 97f6a6a7
...@@ -114,9 +114,6 @@ LIBRARY_FLAGS = { ...@@ -114,9 +114,6 @@ LIBRARY_FLAGS = {
'profilingsupport:on': { 'profilingsupport:on': {
'CPPDEFINES': ['ENABLE_VMSTATE_TRACKING', 'ENABLE_LOGGING_AND_PROFILING'], 'CPPDEFINES': ['ENABLE_VMSTATE_TRACKING', 'ENABLE_LOGGING_AND_PROFILING'],
}, },
'cppprofilesprocessor:on': {
'CPPDEFINES': ['ENABLE_CPP_PROFILES_PROCESSOR'],
},
'debuggersupport:on': { 'debuggersupport:on': {
'CPPDEFINES': ['ENABLE_DEBUGGER_SUPPORT'], 'CPPDEFINES': ['ENABLE_DEBUGGER_SUPPORT'],
} }
...@@ -696,11 +693,6 @@ SIMPLE_OPTIONS = { ...@@ -696,11 +693,6 @@ SIMPLE_OPTIONS = {
'default': 'on', 'default': 'on',
'help': 'enable profiling of JavaScript code' 'help': 'enable profiling of JavaScript code'
}, },
'cppprofilesprocessor': {
'values': ['on', 'off'],
'default': 'on',
'help': 'enable C++ profiles processor'
},
'debuggersupport': { 'debuggersupport': {
'values': ['on', 'off'], 'values': ['on', 'off'],
'default': 'on', 'default': 'on',
......
...@@ -4027,7 +4027,7 @@ Local<Context> Debug::GetDebugContext() { ...@@ -4027,7 +4027,7 @@ Local<Context> Debug::GetDebugContext() {
#endif // ENABLE_DEBUGGER_SUPPORT #endif // ENABLE_DEBUGGER_SUPPORT
#ifdef ENABLE_CPP_PROFILES_PROCESSOR #ifdef ENABLE_LOGGING_AND_PROFILING
Handle<String> CpuProfileNode::GetFunctionName() const { Handle<String> CpuProfileNode::GetFunctionName() const {
IsDeadCheck("v8::CpuProfileNode::GetFunctionName"); IsDeadCheck("v8::CpuProfileNode::GetFunctionName");
...@@ -4148,7 +4148,7 @@ const CpuProfile* CpuProfiler::StopProfiling(Handle<String> title) { ...@@ -4148,7 +4148,7 @@ const CpuProfile* CpuProfiler::StopProfiling(Handle<String> title) {
i::CpuProfiler::StopProfiling(*Utils::OpenHandle(*title))); i::CpuProfiler::StopProfiling(*Utils::OpenHandle(*title)));
} }
#endif // ENABLE_CPP_PROFILES_PROCESSOR #endif // ENABLE_LOGGING_AND_PROFILING
namespace internal { namespace internal {
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
#include "cpu-profiler.h" #include "cpu-profiler.h"
#ifdef ENABLE_CPP_PROFILES_PROCESSOR #ifdef ENABLE_LOGGING_AND_PROFILING
#include "circular-queue-inl.h" #include "circular-queue-inl.h"
#include "profile-generator-inl.h" #include "profile-generator-inl.h"
...@@ -93,6 +93,6 @@ bool ProfilerEventsProcessor::FilterOutCodeCreateEvent( ...@@ -93,6 +93,6 @@ bool ProfilerEventsProcessor::FilterOutCodeCreateEvent(
} } // namespace v8::internal } } // namespace v8::internal
#endif // ENABLE_CPP_PROFILES_PROCESSOR #endif // ENABLE_LOGGING_AND_PROFILING
#endif // V8_CPU_PROFILER_INL_H_ #endif // V8_CPU_PROFILER_INL_H_
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
#include "cpu-profiler-inl.h" #include "cpu-profiler-inl.h"
#ifdef ENABLE_CPP_PROFILES_PROCESSOR #ifdef ENABLE_LOGGING_AND_PROFILING
#include "log-inl.h" #include "log-inl.h"
...@@ -466,13 +466,13 @@ void CpuProfiler::StopProcessorIfLastProfile() { ...@@ -466,13 +466,13 @@ void CpuProfiler::StopProcessorIfLastProfile() {
} } // namespace v8::internal } } // namespace v8::internal
#endif // ENABLE_CPP_PROFILES_PROCESSOR #endif // ENABLE_LOGGING_AND_PROFILING
namespace v8 { namespace v8 {
namespace internal { namespace internal {
void CpuProfiler::Setup() { void CpuProfiler::Setup() {
#ifdef ENABLE_CPP_PROFILES_PROCESSOR #ifdef ENABLE_LOGGING_AND_PROFILING
if (singleton_ == NULL) { if (singleton_ == NULL) {
singleton_ = new CpuProfiler(); singleton_ = new CpuProfiler();
} }
...@@ -481,7 +481,7 @@ void CpuProfiler::Setup() { ...@@ -481,7 +481,7 @@ void CpuProfiler::Setup() {
void CpuProfiler::TearDown() { void CpuProfiler::TearDown() {
#ifdef ENABLE_CPP_PROFILES_PROCESSOR #ifdef ENABLE_LOGGING_AND_PROFILING
if (singleton_ != NULL) { if (singleton_ != NULL) {
delete singleton_; delete singleton_;
} }
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
#ifndef V8_CPU_PROFILER_H_ #ifndef V8_CPU_PROFILER_H_
#define V8_CPU_PROFILER_H_ #define V8_CPU_PROFILER_H_
#ifdef ENABLE_CPP_PROFILES_PROCESSOR #ifdef ENABLE_LOGGING_AND_PROFILING
#include "circular-queue.h" #include "circular-queue.h"
...@@ -197,7 +197,7 @@ class ProfilerEventsProcessor : public Thread { ...@@ -197,7 +197,7 @@ class ProfilerEventsProcessor : public Thread {
} while (false) } while (false)
#else #else
#define PROFILE(Call) LOG(Call) #define PROFILE(Call) LOG(Call)
#endif // ENABLE_CPP_PROFILES_PROCESSOR #endif // ENABLE_LOGGING_AND_PROFILING
namespace v8 { namespace v8 {
...@@ -208,7 +208,7 @@ class CpuProfiler { ...@@ -208,7 +208,7 @@ class CpuProfiler {
static void Setup(); static void Setup();
static void TearDown(); static void TearDown();
#ifdef ENABLE_CPP_PROFILES_PROCESSOR #ifdef ENABLE_LOGGING_AND_PROFILING
static void StartProfiling(const char* title); static void StartProfiling(const char* title);
static void StartProfiling(String* title); static void StartProfiling(String* title);
static CpuProfile* StopProfiling(const char* title); static CpuProfile* StopProfiling(const char* title);
...@@ -265,7 +265,7 @@ class CpuProfiler { ...@@ -265,7 +265,7 @@ class CpuProfiler {
#else #else
static INLINE(bool is_profiling()) { return false; } static INLINE(bool is_profiling()) { return false; }
#endif // ENABLE_CPP_PROFILES_PROCESSOR #endif // ENABLE_LOGGING_AND_PROFILING
private: private:
DISALLOW_COPY_AND_ASSIGN(CpuProfiler); DISALLOW_COPY_AND_ASSIGN(CpuProfiler);
......
...@@ -38,7 +38,6 @@ namespace internal { ...@@ -38,7 +38,6 @@ namespace internal {
Logger::LogEventsAndTags Logger::ToNativeByScript(Logger::LogEventsAndTags tag, Logger::LogEventsAndTags Logger::ToNativeByScript(Logger::LogEventsAndTags tag,
Script* script) { Script* script) {
#ifdef ENABLE_CPP_PROFILES_PROCESSOR
if ((tag == FUNCTION_TAG || tag == LAZY_COMPILE_TAG || tag == SCRIPT_TAG) if ((tag == FUNCTION_TAG || tag == LAZY_COMPILE_TAG || tag == SCRIPT_TAG)
&& script->type()->value() == Script::TYPE_NATIVE) { && script->type()->value() == Script::TYPE_NATIVE) {
switch (tag) { switch (tag) {
...@@ -50,9 +49,6 @@ Logger::LogEventsAndTags Logger::ToNativeByScript(Logger::LogEventsAndTags tag, ...@@ -50,9 +49,6 @@ Logger::LogEventsAndTags Logger::ToNativeByScript(Logger::LogEventsAndTags tag,
} else { } else {
return tag; return tag;
} }
#else
return tag;
#endif // ENABLE_CPP_PROFILES_PROCESSOR
} }
#endif // ENABLE_LOGGING_AND_PROFILING #endif // ENABLE_LOGGING_AND_PROFILING
......
...@@ -87,7 +87,7 @@ class CompressionHelper; ...@@ -87,7 +87,7 @@ class CompressionHelper;
#define LOG(Call) ((void) 0) #define LOG(Call) ((void) 0)
#endif #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_CREATION_EVENT, "code-creation", "cc") \
V(CODE_MOVE_EVENT, "code-move", "cm") \ V(CODE_MOVE_EVENT, "code-move", "cm") \
V(CODE_DELETE_EVENT, "code-delete", "cd") \ V(CODE_DELETE_EVENT, "code-delete", "cd") \
...@@ -116,19 +116,13 @@ class CompressionHelper; ...@@ -116,19 +116,13 @@ class CompressionHelper;
V(REG_EXP_TAG, "RegExp", "re") \ V(REG_EXP_TAG, "RegExp", "re") \
V(SCRIPT_TAG, "Script", "sc") \ V(SCRIPT_TAG, "Script", "sc") \
V(STORE_IC_TAG, "StoreIC", "sic") \ V(STORE_IC_TAG, "StoreIC", "sic") \
V(STUB_TAG, "Stub", "s") 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(NATIVE_FUNCTION_TAG, "Function", "f") \ V(NATIVE_FUNCTION_TAG, "Function", "f") \
V(NATIVE_LAZY_COMPILE_TAG, "LazyCompile", "lc") \ V(NATIVE_LAZY_COMPILE_TAG, "LazyCompile", "lc") \
V(NATIVE_SCRIPT_TAG, "Script", "sc") V(NATIVE_SCRIPT_TAG, "Script", "sc")
#else // Note that 'NATIVE_' cases for functions and scripts are mapped onto
#define LOG_EVENTS_AND_TAGS_LIST(V) LOG_EVENTS_AND_TAGS_LIST_NO_NATIVES(V) // original tags when writing to the log.
#endif
class Logger { class Logger {
public: public:
......
...@@ -728,10 +728,7 @@ static void ProfilerSignalHandler(int signal, siginfo_t* info, void* context) { ...@@ -728,10 +728,7 @@ static void ProfilerSignalHandler(int signal, siginfo_t* info, void* context) {
if (active_sampler_ == NULL) return; if (active_sampler_ == NULL) return;
TickSample sample_obj; TickSample sample_obj;
TickSample* sample = NULL; TickSample* sample = CpuProfiler::TickSampleEvent();
#ifdef ENABLE_CPP_PROFILES_PROCESSOR
sample = CpuProfiler::TickSampleEvent();
#endif
if (sample == NULL) sample = &sample_obj; if (sample == NULL) sample = &sample_obj;
// We always sample the VM state. // We always sample the VM state.
......
...@@ -547,10 +547,7 @@ class Sampler::PlatformData : public Malloced { ...@@ -547,10 +547,7 @@ class Sampler::PlatformData : public Malloced {
// Loop until the sampler is disengaged, keeping the specified samling freq. // Loop until the sampler is disengaged, keeping the specified samling freq.
for ( ; sampler_->IsActive(); OS::Sleep(sampler_->interval_)) { for ( ; sampler_->IsActive(); OS::Sleep(sampler_->interval_)) {
TickSample sample_obj; TickSample sample_obj;
TickSample* sample = NULL; TickSample* sample = CpuProfiler::TickSampleEvent();
#ifdef ENABLE_CPP_PROFILES_PROCESSOR
sample = CpuProfiler::TickSampleEvent();
#endif
if (sample == NULL) sample = &sample_obj; if (sample == NULL) sample = &sample_obj;
// We always sample the VM state. // We always sample the VM state.
......
...@@ -1806,10 +1806,7 @@ class Sampler::PlatformData : public Malloced { ...@@ -1806,10 +1806,7 @@ class Sampler::PlatformData : public Malloced {
// Loop until the sampler is disengaged, keeping the specified samling freq. // Loop until the sampler is disengaged, keeping the specified samling freq.
for ( ; sampler_->IsActive(); Sleep(sampler_->interval_)) { for ( ; sampler_->IsActive(); Sleep(sampler_->interval_)) {
TickSample sample_obj; TickSample sample_obj;
TickSample* sample = NULL; TickSample* sample = CpuProfiler::TickSampleEvent();
#ifdef ENABLE_CPP_PROFILES_PROCESSOR
sample = CpuProfiler::TickSampleEvent();
#endif
if (sample == NULL) sample = &sample_obj; if (sample == NULL) sample = &sample_obj;
// We always sample the VM state. // We always sample the VM state.
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
#ifndef V8_PROFILE_GENERATOR_INL_H_ #ifndef V8_PROFILE_GENERATOR_INL_H_
#define 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" #include "profile-generator.h"
...@@ -118,6 +118,6 @@ CodeEntry* ProfileGenerator::EntryForVMState(StateTag tag) { ...@@ -118,6 +118,6 @@ CodeEntry* ProfileGenerator::EntryForVMState(StateTag tag) {
} } // namespace v8::internal } } // namespace v8::internal
#endif // ENABLE_CPP_PROFILES_PROCESSOR #endif // ENABLE_LOGGING_AND_PROFILING
#endif // V8_PROFILE_GENERATOR_INL_H_ #endif // V8_PROFILE_GENERATOR_INL_H_
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // 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" #include "v8.h"
...@@ -522,4 +522,4 @@ void ProfileGenerator::RecordTickSample(const TickSample& sample) { ...@@ -522,4 +522,4 @@ void ProfileGenerator::RecordTickSample(const TickSample& sample) {
} } // namespace v8::internal } } // namespace v8::internal
#endif // ENABLE_CPP_PROFILES_PROCESSOR #endif // ENABLE_LOGGING_AND_PROFILING
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
#ifndef V8_PROFILE_GENERATOR_H_ #ifndef V8_PROFILE_GENERATOR_H_
#define V8_PROFILE_GENERATOR_H_ #define V8_PROFILE_GENERATOR_H_
#ifdef ENABLE_CPP_PROFILES_PROCESSOR #ifdef ENABLE_LOGGING_AND_PROFILING
#include "hashmap.h" #include "hashmap.h"
...@@ -304,6 +304,6 @@ class ProfileGenerator { ...@@ -304,6 +304,6 @@ class ProfileGenerator {
} } // namespace v8::internal } } // namespace v8::internal
#endif // ENABLE_CPP_PROFILES_PROCESSOR #endif // ENABLE_LOGGING_AND_PROFILING
#endif // V8_PROFILE_GENERATOR_H_ #endif // V8_PROFILE_GENERATOR_H_
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// //
// Tests of profiles generator and utilities. // Tests of profiles generator and utilities.
#ifdef ENABLE_CPP_PROFILES_PROCESSOR #ifdef ENABLE_LOGGING_AND_PROFILING
#include "v8.h" #include "v8.h"
#include "cpu-profiler-inl.h" #include "cpu-profiler-inl.h"
...@@ -222,4 +222,4 @@ TEST(TickEvents) { ...@@ -222,4 +222,4 @@ TEST(TickEvents) {
CHECK_EQ("bbb", bottom_up_ddd_stub_children->last()->entry()->name()); CHECK_EQ("bbb", bottom_up_ddd_stub_children->last()->entry()->name());
} }
#endif // ENABLE_CPP_PROFILES_PROCESSOR #endif // ENABLE_LOGGING_AND_PROFILING
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// //
// Tests of profiles generator and utilities. // Tests of profiles generator and utilities.
#ifdef ENABLE_CPP_PROFILES_PROCESSOR #ifdef ENABLE_LOGGING_AND_PROFILING
#include "v8.h" #include "v8.h"
#include "profile-generator-inl.h" #include "profile-generator-inl.h"
...@@ -443,4 +443,4 @@ TEST(RecordTickSample) { ...@@ -443,4 +443,4 @@ TEST(RecordTickSample) {
CHECK_EQ(entry1, node4->entry()); CHECK_EQ(entry1, node4->entry());
} }
#endif // ENABLE_CPP_PROFILES_PROCESSOR #endif // ENABLE_LOGGING_AND_PROFILING
...@@ -38,7 +38,6 @@ ...@@ -38,7 +38,6 @@
'ENABLE_LOGGING_AND_PROFILING', 'ENABLE_LOGGING_AND_PROFILING',
'ENABLE_DEBUGGER_SUPPORT', 'ENABLE_DEBUGGER_SUPPORT',
'ENABLE_VMSTATE_TRACKING', 'ENABLE_VMSTATE_TRACKING',
'ENABLE_CPP_PROFILES_PROCESSOR',
], ],
'conditions': [ 'conditions': [
['target_arch=="arm"', { ['target_arch=="arm"', {
......
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