Fix building with profilingsupport=off
authorsgjesse@chromium.org <sgjesse@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Mon, 30 May 2011 14:33:23 +0000 (14:33 +0000)
committersgjesse@chromium.org <sgjesse@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Mon, 30 May 2011 14:33:23 +0000 (14:33 +0000)
Using profilingsupport=off is not recommended as it will turn off crankshaft. With this change it will build though.

R=erik.corry@gmail.com

BUG=none
TEST=none

Review URL: http://codereview.chromium.org//7085025

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8113 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

src/SConscript
src/api.cc
src/heap.cc
src/isolate.cc
src/log.cc

index fe21d02..68a7d56 100755 (executable)
@@ -311,7 +311,10 @@ def ConfigureObjectFiles():
   env.Replace(**context.flags['v8'])
   context.ApplyEnvOverrides(env)
   env['BUILDERS']['JS2C'] = Builder(action=js2c.JS2C)
-  env['BUILDERS']['Snapshot'] = Builder(action='$SOURCE $TARGET --logfile "$LOGFILE" --log-snapshot-positions')
+  if 'ENABLE_LOGGING_AND_PROFILING' in env['CPPDEFINES']:
+    env['BUILDERS']['Snapshot'] = Builder(action='$SOURCE $TARGET --logfile "$LOGFILE" --log-snapshot-positions')
+  else:
+    env['BUILDERS']['Snapshot'] = Builder(action='$SOURCE $TARGET')
 
   # Build the standard platform-independent source files.
   source_files = context.GetRelevantSources(SOURCES)
index 5980854..31aa1e0 100644 (file)
@@ -925,6 +925,7 @@ Local<TypeSwitch> TypeSwitch::New(int argc, Handle<FunctionTemplate> types[]) {
 int TypeSwitch::match(v8::Handle<Value> value) {
   i::Isolate* isolate = i::Isolate::Current();
   LOG_API(isolate, "TypeSwitch::match");
+  USE(isolate);
   i::Handle<i::Object> obj = Utils::OpenHandle(*value);
   i::Handle<i::TypeSwitchInfo> info = Utils::OpenHandle(this);
   i::FixedArray* types = i::FixedArray::cast(info->types());
@@ -3392,6 +3393,7 @@ Local<v8::Value> Function::Call(v8::Handle<v8::Object> recv, int argc,
 void Function::SetName(v8::Handle<v8::String> name) {
   i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
   ENTER_V8(isolate);
+  USE(isolate);
   i::Handle<i::JSFunction> func = Utils::OpenHandle(this);
   func->shared()->set_name(*Utils::OpenHandle(*name));
 }
index 54359d6..1b46184 100644 (file)
@@ -1528,6 +1528,7 @@ static void InitializeScavengingVisitorsTables() {
 
 
 void Heap::SwitchScavengingVisitorsTableIfProfilingWasEnabled() {
+#ifdef ENABLE_LOGGING_AND_PROFILING
   if (scavenging_visitors_table_mode_ == LOGGING_AND_PROFILING_ENABLED) {
     // Table was already updated by some isolate.
     return;
@@ -1553,6 +1554,7 @@ void Heap::SwitchScavengingVisitorsTableIfProfilingWasEnabled() {
     Release_Store(&scavenging_visitors_table_mode_,
                   LOGGING_AND_PROFILING_ENABLED);
   }
+#endif
 }
 
 
index a7bf7d9..2003d9b 100644 (file)
@@ -1279,9 +1279,11 @@ Handle<Context> Isolate::GetCallingGlobalContext() {
 
 
 char* Isolate::ArchiveThread(char* to) {
+#ifdef ENABLE_LOGGING_AND_PROFILING
   if (RuntimeProfiler::IsEnabled() && current_vm_state() == JS) {
     RuntimeProfiler::IsolateExitedJS(this);
   }
+#endif
   memcpy(to, reinterpret_cast<char*>(thread_local_top()),
          sizeof(ThreadLocalTop));
   InitializeThreadLocal();
@@ -1301,9 +1303,11 @@ char* Isolate::RestoreThread(char* from) {
   thread_local_top()->simulator_ = Simulator::current(this);
 #endif
 #endif
+#ifdef ENABLE_LOGGING_AND_PROFILING
   if (RuntimeProfiler::IsEnabled() && current_vm_state() == JS) {
     RuntimeProfiler::IsolateEnteredJS(this);
   }
+#endif
   return from + sizeof(ThreadLocalTop);
 }
 
index 0474ce0..298ef6e 100644 (file)
@@ -1878,7 +1878,11 @@ bool Logger::Setup() {
 
 
 Sampler* Logger::sampler() {
+#ifdef ENABLE_LOGGING_AND_PROFILING
   return ticker_;
+#else
+  return NULL;
+#endif
 }
 
 
@@ -1955,8 +1959,10 @@ bool SamplerRegistry::IterateActiveSamplers(VisitSampler func, void* param) {
 
 
 static void ComputeCpuProfiling(Sampler* sampler, void* flag_ptr) {
+#ifdef ENABLE_LOGGING_AND_PROFILING
   bool* flag = reinterpret_cast<bool*>(flag_ptr);
   *flag |= sampler->IsProfiling();
+#endif
 }