JIT: Align JIT stubs (#11149)

Fixed phpGH-11120

Signed-off-by: PeterYang12 <yuhan.yang@intel.com>
This commit is contained in:
yang yuhan 2023-05-02 17:34:49 +08:00 committed by GitHub
parent f0122664fe
commit f127e6581a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 14 additions and 0 deletions

View File

@ -4696,6 +4696,7 @@ static int zend_jit_make_stubs(void)
for (i = 0; i < sizeof(zend_jit_stubs)/sizeof(zend_jit_stubs[0]); i++) {
dasm_setup(&dasm_state, dasm_actions);
zend_jit_align_stub(&dasm_state);
if (!zend_jit_stubs[i].stub(&dasm_state)) {
return 0;
}

View File

@ -2854,6 +2854,12 @@ static int zend_jit_align_func(dasm_State **Dst)
return 1;
}
static int zend_jit_align_stub(dasm_State **Dst)
{
|.align 16
return 1;
}
static int zend_jit_prologue(dasm_State **Dst)
{
if (zend_jit_vm_kind == ZEND_VM_KIND_HYBRID) {

View File

@ -94,6 +94,7 @@ static const void *zend_jit_trace_allocate_exit_group(uint32_t n)
dasm_init(&dasm_state, DASM_MAXSECTION);
dasm_setupglobal(&dasm_state, dasm_labels, zend_lb_MAX);
dasm_setup(&dasm_state, dasm_actions);
zend_jit_align_stub(&dasm_state);
zend_jit_trace_exit_group_stub(&dasm_state, n);
sprintf(name, "jit$$trace_exit_%d", n);

View File

@ -3070,6 +3070,12 @@ static int zend_jit_align_func(dasm_State **Dst)
return 1;
}
static int zend_jit_align_stub(dasm_State **Dst)
{
|.align 16
return 1;
}
static int zend_jit_prologue(dasm_State **Dst)
{
| ENDBR