diff options
author | Joshua Haberman <jhaberman@gmail.com> | 2011-04-06 00:36:30 -0700 |
---|---|---|
committer | Joshua Haberman <jhaberman@gmail.com> | 2011-04-06 00:36:30 -0700 |
commit | 813bc74be61e910d3fe9e013d0ee5cca1cce6fd0 (patch) | |
tree | 7fc01f86565b334eaed10290c0a1cb9c5444c749 /src | |
parent | 91a7da602db23319abada5bd0f7fc739f978c941 (diff) |
JIT now works on OS X!
Had to fix the case where the jump table was
allocated in a >4GB address.
Diffstat (limited to 'src')
-rw-r--r-- | src/upb_decoder_x86.dasc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/upb_decoder_x86.dasc b/src/upb_decoder_x86.dasc index d350719..fac0dcf 100644 --- a/src/upb_decoder_x86.dasc +++ b/src/upb_decoder_x86.dasc @@ -184,7 +184,12 @@ void upb_reg_jit_gdb(void *addr, size_t size) { | and edx, 0x7 | cmp ecx, m->max_field_number // Bounds-check the field. | ja ->exit_jit // In the future; could be unknown label -| mov rax, qword [rcx*8 + m->tablearray] // TODO: support hybrid array/hash tables. +|| if ((uintptr_t)m->tablearray < 0xffffffff) { +| mov rax, qword [rcx*8 + m->tablearray] // TODO: support hybrid array/hash tables. +|| } else { +| mov64 rax, (uintptr_t)m->tablearray +| mov rax, qword [rax + rcx*8] +|| } | jmp rax // Dispatch: unpredictable jump. |.endmacro | |