summaryrefslogtreecommitdiffstats
path: root/V8Binding/v8/src/platform-macos.cc
diff options
context:
space:
mode:
authorFeng Qian <fqian@google.com>2009-06-30 15:26:06 -0700
committerFeng Qian <fqian@google.com>2009-06-30 15:26:06 -0700
commitcedffe365f5cf0dfb63dc9d9c592a6ab6620bdcc (patch)
treea96ddd4a13a1ba4dbbc4693bceced74203f6dab7 /V8Binding/v8/src/platform-macos.cc
parent67bf3b454483a7d8c1636969f4bb26c90c1ca8a2 (diff)
downloadexternal_webkit-cedffe365f5cf0dfb63dc9d9c592a6ab6620bdcc.zip
external_webkit-cedffe365f5cf0dfb63dc9d9c592a6ab6620bdcc.tar.gz
external_webkit-cedffe365f5cf0dfb63dc9d9c592a6ab6620bdcc.tar.bz2
Pickup the latest V8 revision, prepare for snapshotting.
http://v8.googlecode.com/svn/branches/bleeding_edge@2313
Diffstat (limited to 'V8Binding/v8/src/platform-macos.cc')
-rw-r--r--V8Binding/v8/src/platform-macos.cc25
1 files changed, 16 insertions, 9 deletions
diff --git a/V8Binding/v8/src/platform-macos.cc b/V8Binding/v8/src/platform-macos.cc
index 3e0e284..f5b6458 100644
--- a/V8Binding/v8/src/platform-macos.cc
+++ b/V8Binding/v8/src/platform-macos.cc
@@ -35,10 +35,6 @@
#include <AvailabilityMacros.h>
-#ifdef MAC_OS_X_VERSION_10_5
-# include <execinfo.h> // backtrace, backtrace_symbols
-#endif
-
#include <pthread.h>
#include <semaphore.h>
#include <signal.h>
@@ -58,6 +54,17 @@
#include "platform.h"
+// Manually define these here as weak imports, rather than including execinfo.h.
+// This lets us launch on 10.4 which does not have these calls.
+extern "C" {
+ extern int backtrace(void**, int) __attribute__((weak_import));
+ extern char** backtrace_symbols(void* const*, int)
+ __attribute__((weak_import));
+ extern void backtrace_symbols_fd(void* const*, int, int)
+ __attribute__((weak_import));
+}
+
+
namespace v8 {
namespace internal {
@@ -214,9 +221,10 @@ int OS::ActivationFrameAlignment() {
int OS::StackWalk(Vector<StackFrame> frames) {
-#ifndef MAC_OS_X_VERSION_10_5
- return 0;
-#else
+ // If weak link to execinfo lib has failed, ie because we are on 10.4, abort.
+ if (backtrace == NULL)
+ return 0;
+
int frames_size = frames.length();
void** addresses = NewArray<void*>(frames_size);
int frames_count = backtrace(addresses, frames_size);
@@ -244,7 +252,6 @@ int OS::StackWalk(Vector<StackFrame> frames) {
free(symbols);
return frames_count;
-#endif
}
@@ -500,7 +507,7 @@ static void ProfilerSignalHandler(int signal, siginfo_t* info, void* context) {
#endif // __DARWIN_UNIX03
#else
#error Unsupported Mac OS X host architecture.
-#endif // V8_TARGET_ARCH_IA32
+#endif // V8_HOST_ARCH_IA32
}
// We always sample the VM state.