Update V8 to r7427: Fix ENABLE_LOGGING_AND_PROFILING guards
Partial cherry-pick of
http://code.google.com/p/v8/source/detail?r=8113 pulled into trunk in
http://code.google.com/p/v8/source/detail?r=8130
We can't cherry-pick the entire change because it touches code we
don't yet have. The change to top.cc is taken from the patch for
isolate.cc, to where this code has now moved.
Change-Id: I06a98ff82221a5a9bf64253f7dc5730a2ba603a6
diff --git a/src/SConscript b/src/SConscript
index 3b9968e..a740584 100755
--- a/src/SConscript
+++ b/src/SConscript
@@ -329,7 +329,10 @@
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)
diff --git a/src/api.cc b/src/api.cc
index 0d5e4f0..2bfa598 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -856,6 +856,7 @@
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());
@@ -3203,6 +3204,7 @@
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));
}
diff --git a/src/log.cc b/src/log.cc
index 6991f3d..6a601c6 100644
--- a/src/log.cc
+++ b/src/log.cc
@@ -1550,7 +1550,11 @@
Sampler* Logger::sampler() {
+#ifdef ENABLE_LOGGING_AND_PROFILING
return ticker_;
+#else
+ return NULL;
+#endif
}
@@ -1627,8 +1631,10 @@
static void ComputeCpuProfiling(Sampler* sampler, void* flag_ptr) {
+#ifdef ENABLE_LOGGING_AND_PROFILING
bool* flag = reinterpret_cast<bool*>(flag_ptr);
*flag |= sampler->IsProfiling();
+#endif
}
diff --git a/src/top.cc b/src/top.cc
index ff29cad..4a2a00b 100644
--- a/src/top.cc
+++ b/src/top.cc
@@ -949,9 +949,11 @@
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();
@@ -971,9 +973,11 @@
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);
}