diff options
author | Lijuan Xiao <lijuan.xiao@intel.com> | 2012-05-15 18:58:42 +0800 |
---|---|---|
committer | Lijuan Xiao <lijuan.xiao@intel.com> | 2012-05-15 18:58:42 +0800 |
commit | 9a7009c496e0b8faef298cc7063545692ae3ba3f (patch) | |
tree | 48c83ecefef0722be9a24fdda2e094672dffd238 | |
parent | d5ee4b89f462d11f8027aba6409b41aa94a4056a (diff) | |
download | android_external_v8-9a7009c496e0b8faef298cc7063545692ae3ba3f.tar.gz android_external_v8-9a7009c496e0b8faef298cc7063545692ae3ba3f.tar.bz2 android_external_v8-9a7009c496e0b8faef298cc7063545692ae3ba3f.zip |
Fix profiling functionality provided by V8 for x86
Change-Id: I0af645b60f7aa90472ff9c9ddff6b3b2df92e914
Signed-off-by: Lijuan Xiao <lijuan.xiao@intel.com>
-rw-r--r-- | src/platform-linux.cc | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/src/platform-linux.cc b/src/platform-linux.cc index 474c5406..39633a24 100644 --- a/src/platform-linux.cc +++ b/src/platform-linux.cc @@ -808,7 +808,7 @@ Semaphore* OS::CreateSemaphore(int count) { #ifdef ENABLE_LOGGING_AND_PROFILING -#if !defined(__GLIBC__) && (defined(__arm__) || defined(__thumb__) || defined(__i386__)) +#if !defined(__GLIBC__) && (defined(__arm__) || defined(__thumb__)) // Android runs a fairly new Linux kernel, so signal info is there, // but the C library doesn't have the structs defined. @@ -830,10 +830,27 @@ typedef struct ucontext { __sigset_t uc_sigmask; } ucontext_t; enum ArmRegisters {R15 = 15, R13 = 13, R11 = 11}; -enum X86Registers {REG_EIP = 14, REG_ESP = 7, REG_EBP = 6}; -#endif +#elif !defined(__GLIBC__) && defined(__i386__) +// x86 version for Android. +struct sigcontext { + uint32_t gregs[19]; + void* fpregs; + uint32_t oldmask; + uint32_t cr2; +}; +typedef uint32_t __sigset_t; +typedef struct sigcontext mcontext_t; +typedef struct ucontext { + uint32_t uc_flags; + struct ucontext* uc_link; + stack_t uc_stack; + mcontext_t uc_mcontext; + __sigset_t uc_sigmask; +} ucontext_t; +enum { REG_EBP = 6, REG_ESP = 7, REG_EIP = 14 }; +#endif static int GetThreadID() { // Glibc doesn't provide a wrapper for gettid(2). |