Commit e4978961 authored by sgjesse@chromium.org's avatar sgjesse@chromium.org

Fix building with profilingsupport=off

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