Line 0
Link Here
|
|
|
1 |
--- jit/AsmJSSignalHandlers.cpp~ |
2 |
+++ jit/AsmJSSignalHandlers.cpp |
3 |
@@ -64,7 +64,6 @@ using JS::GenericNaN; |
4 |
# define EIP_sig(p) ((p)->uc_mcontext.gregs[REG_PC]) |
5 |
# endif |
6 |
# define RIP_sig(p) ((p)->uc_mcontext.gregs[REG_RIP]) |
7 |
-# define PC_sig(p) ((p)->uc_mcontext.arm_pc) |
8 |
# define RAX_sig(p) ((p)->uc_mcontext.gregs[REG_RAX]) |
9 |
# define RCX_sig(p) ((p)->uc_mcontext.gregs[REG_RCX]) |
10 |
# define RDX_sig(p) ((p)->uc_mcontext.gregs[REG_RDX]) |
11 |
@@ -80,7 +79,11 @@ using JS::GenericNaN; |
12 |
# define R12_sig(p) ((p)->uc_mcontext.gregs[REG_R12]) |
13 |
# define R13_sig(p) ((p)->uc_mcontext.gregs[REG_R13]) |
14 |
# define R14_sig(p) ((p)->uc_mcontext.gregs[REG_R14]) |
15 |
-# define R15_sig(p) ((p)->uc_mcontext.gregs[REG_R15]) |
16 |
+# if defined(__linux__) && defined(__arm__) |
17 |
+# define R15_sig(p) ((p)->uc_mcontext.arm_pc) |
18 |
+# else |
19 |
+# define R15_sig(p) ((p)->uc_mcontext.gregs[REG_R15]) |
20 |
+# endif |
21 |
#elif defined(__NetBSD__) |
22 |
# define XMM_sig(p,i) (((struct fxsave64 *)(p)->uc_mcontext.__fpregs)->fx_xmm[i]) |
23 |
# define EIP_sig(p) ((p)->uc_mcontext.__gregs[_REG_EIP]) |
24 |
@@ -124,7 +127,11 @@ using JS::GenericNaN; |
25 |
# define R12_sig(p) ((p)->uc_mcontext.mc_r12) |
26 |
# define R13_sig(p) ((p)->uc_mcontext.mc_r13) |
27 |
# define R14_sig(p) ((p)->uc_mcontext.mc_r14) |
28 |
-# define R15_sig(p) ((p)->uc_mcontext.mc_r15) |
29 |
+# if defined(__FreeBSD__) && defined(__arm__) |
30 |
+# define R15_sig(p) ((p)->uc_mcontext.__gregs[_REG_R15]) |
31 |
+# else |
32 |
+# define R15_sig(p) ((p)->uc_mcontext.mc_r15) |
33 |
+# endif |
34 |
#elif defined(XP_MACOSX) |
35 |
// Mach requires special treatment. |
36 |
#else |
37 |
@@ -325,20 +332,20 @@ enum { REG_EIP = 14 }; |
38 |
# define CONTEXT ucontext_t |
39 |
# endif |
40 |
|
41 |
+# if defined(JS_CPU_X64) |
42 |
+# define PC_sig(p) RIP_sig(p) |
43 |
+# elif defined(JS_CPU_X86) |
44 |
+# define PC_sig(p) EIP_sig(p) |
45 |
+# elif defined(JS_CPU_ARM) |
46 |
+# define PC_sig(p) R15_sig(p) |
47 |
+# endif |
48 |
+ |
49 |
# if !defined(XP_MACOSX) |
50 |
static uint8_t ** |
51 |
ContextToPC(CONTEXT *context) |
52 |
{ |
53 |
-# if defined(JS_CPU_X64) |
54 |
- JS_STATIC_ASSERT(sizeof(RIP_sig(context)) == sizeof(void*)); |
55 |
- return reinterpret_cast<uint8_t**>(&RIP_sig(context)); |
56 |
-# elif defined(JS_CPU_X86) |
57 |
- JS_STATIC_ASSERT(sizeof(EIP_sig(context)) == sizeof(void*)); |
58 |
- return reinterpret_cast<uint8_t**>(&EIP_sig(context)); |
59 |
-# elif defined(JS_CPU_ARM) |
60 |
JS_STATIC_ASSERT(sizeof(PC_sig(context)) == sizeof(void*)); |
61 |
return reinterpret_cast<uint8_t**>(&PC_sig(context)); |
62 |
-# endif |
63 |
} |
64 |
|
65 |
# if defined(JS_CPU_X64) |