Revision: 6044 Author: [email protected] Date: Thu Dec 16 04:14:56 2010 Log: Make V8 compilable with profiling support turned off.
BUG=990 Review URL: http://codereview.chromium.org/5890003 http://code.google.com/p/v8/source/detail?r=6044 Modified: /branches/bleeding_edge/src/log.cc /branches/bleeding_edge/src/runtime-profiler.cc /branches/bleeding_edge/src/top.cc /branches/bleeding_edge/tools/test.py ======================================= --- /branches/bleeding_edge/src/log.cc Tue Dec 7 05:24:22 2010 +++ /branches/bleeding_edge/src/log.cc Thu Dec 16 04:14:56 2010 @@ -709,6 +709,7 @@ } +#ifdef ENABLE_LOGGING_AND_PROFILING static const char* ComputeMarker(Code* code) { switch (code->kind()) { case Code::FUNCTION: return code->optimizable() ? "~" : ""; @@ -716,6 +717,7 @@ default: return ""; } } +#endif void Logger::CodeCreateEvent(LogEventsAndTags tag, @@ -1577,13 +1579,17 @@ void Logger::EnsureTickerStarted() { +#ifdef ENABLE_LOGGING_AND_PROFILING ASSERT(ticker_ != NULL); if (!ticker_->IsActive()) ticker_->Start(); +#endif } void Logger::EnsureTickerStopped() { +#ifdef ENABLE_LOGGING_AND_PROFILING if (ticker_ != NULL && ticker_->IsActive()) ticker_->Stop(); +#endif } ======================================= --- /branches/bleeding_edge/src/runtime-profiler.cc Fri Dec 10 06:49:24 2010 +++ /branches/bleeding_edge/src/runtime-profiler.cc Thu Dec 16 04:14:56 2010 @@ -350,6 +350,7 @@ } +#ifdef ENABLE_LOGGING_AND_PROFILING static void UpdateStateRatio(SamplerState current_state) { static const int kStateWindowSize = 128; static SamplerState state_window[kStateWindowSize]; @@ -366,15 +367,18 @@ NoBarrier_Store(&js_ratio, state_counts[IN_JS_STATE] * 100 / kStateWindowSize); } +#endif void RuntimeProfiler::NotifyTick() { +#ifdef ENABLE_LOGGING_AND_PROFILING // Record state sample. SamplerState state = Top::IsInJSState() ? IN_JS_STATE : IN_NON_JS_STATE; UpdateStateRatio(state); StackGuard::RequestRuntimeProfilerTick(); +#endif } @@ -428,6 +432,7 @@ bool RuntimeProfilerRateLimiter::SuspendIfNecessary() { +#ifdef ENABLE_LOGGING_AND_PROFILING static const int kNonJSTicksThreshold = 100; // We suspend the runtime profiler thread when not running // JavaScript. If the CPU profiler is active we must not do this @@ -445,6 +450,7 @@ } } } +#endif return false; } ======================================= --- /branches/bleeding_edge/src/top.cc Tue Dec 7 03:31:57 2010 +++ /branches/bleeding_edge/src/top.cc Thu Dec 16 04:14:56 2010 @@ -40,7 +40,9 @@ namespace v8 { namespace internal { +#ifdef ENABLE_LOGGING_AND_PROFILING Semaphore* Top::runtime_profiler_semaphore_ = NULL; +#endif ThreadLocalTop Top::thread_local_; Mutex* Top::break_access_ = OS::CreateMutex(); @@ -277,9 +279,11 @@ void Top::Initialize() { CHECK(!initialized); +#ifdef ENABLE_LOGGING_AND_PROFILING ASSERT(runtime_profiler_semaphore_ == NULL); runtime_profiler_semaphore_ = OS::CreateSemaphore(0); - +#endif + InitializeThreadLocal(); // Only preallocate on the first initialization. @@ -297,9 +301,11 @@ void Top::TearDown() { if (initialized) { +#ifdef ENABLE_LOGGING_AND_PROFILING delete runtime_profiler_semaphore_; runtime_profiler_semaphore_ = NULL; - +#endif + // Remove the external reference to the preallocated stack memory. if (preallocated_message_space != NULL) { delete preallocated_message_space; ======================================= --- /branches/bleeding_edge/tools/test.py Fri Dec 10 04:05:28 2010 +++ /branches/bleeding_edge/tools/test.py Thu Dec 16 04:14:56 2010 @@ -1181,6 +1181,8 @@ result.add_option("--crankshaft", help="Run with the --crankshaft flag", default=False, action="store_true") + result.add_option("--noprof", help="Disable profiling support", + default=False) return result @@ -1220,6 +1222,9 @@ options.special_command += " --crankshaft" else: options.special_command = "@--crankshaft" + if options.noprof: + options.scons_flags.append("prof=off") + options.scons_flags.append("profilingsupport=off") return True -- v8-dev mailing list [email protected] http://groups.google.com/group/v8-dev
