Skip to content

Commit 67982fb

Browse files
committed
Revert "Fix jit on darwin x86_64"
This reverts commit efefa5d.
1 parent e1dadf4 commit 67982fb

File tree

1 file changed

+6
-13
lines changed

1 file changed

+6
-13
lines changed

ext/opcache/jit/tls/zend_jit_tls_darwin.c

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,12 @@ zend_result zend_jit_resolve_tsrm_ls_cache_offsets(
3737
}
3838

3939
#if defined(__x86_64__)
40-
*module_index = (size_t)-1;
41-
*module_offset = (size_t)-1;
40+
size_t *ti;
41+
__asm__ __volatile__(
42+
"leaq __tsrm_ls_cache(%%rip),%0"
43+
: "=r" (ti));
44+
*module_offset = ti[2];
45+
*module_index = ti[1] * 8;
4246

4347
return SUCCESS;
4448
#endif
@@ -63,17 +67,6 @@ void *zend_jit_tsrm_ls_cache_address(
6367
);
6468
return addr;
6569
}
66-
if (module_index == (size_t)-1 && module_offset == (size_t)-1) {
67-
void *tlvp;
68-
__asm__ __volatile__(
69-
"leaq __tsrm_ls_cache@TLVP(%%rip), %0\n"
70-
: "=&r" (tlvp)
71-
:
72-
: "memory"
73-
);
74-
void *(*thunk)(void*) = *(void **)tlvp;
75-
return thunk(tlvp);
76-
}
7770
if (module_index != (size_t)-1 && module_offset != (size_t)-1) {
7871
char *base;
7972
__asm__ __volatile__(

0 commit comments

Comments
 (0)