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
This commit is contained in:
sgjesse@chromium.org 2011-05-30 14:33:23 +00:00
parent cd67929b0b
commit e497896181
5 changed files with 18 additions and 1 deletions

View File

@ -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)

View 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));
}

View 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
}

View 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);
}

View 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
}