Skip to content

JIT/AArch64: [macos] Fix arguments to variadic function #7023

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 21, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 31 additions & 1 deletion ext/opcache/jit/zend_jit_arm64.dasc
Original file line number Diff line number Diff line change
Expand Up @@ -1981,6 +1981,10 @@ static int zend_jit_undefined_offset_ex_stub(dasm_State **Dst)
static int zend_jit_undefined_offset_stub(dasm_State **Dst)
{
|->undefined_offset:
#ifdef __APPLE__
| stp x29, x30, [sp, # -16]!
| mov x29, sp
#endif
| //sub r4, 8
| ldr REG0, EX->opline
| ldr REG1w, OP:REG0->result.var
Expand All @@ -1999,9 +2003,17 @@ static int zend_jit_undefined_offset_stub(dasm_State **Dst)
| mov CARG1, #E_WARNING
| LOAD_ADDR CARG2, "Undefined array key " ZEND_LONG_FMT
| ldr CARG3, [REG0]
#ifdef __APPLE__
| str CARG3, [sp, #-16]!
| EXT_CALL zend_error, REG0
| add sp, sp, #16
| ldp x29, x30, [sp], #16
| ret
#else
| EXT_JMP zend_error, REG0 // tail call
| //add r4, 8 // stack alignment
| //ret
#endif

return 1;
}
Expand All @@ -2018,6 +2030,10 @@ static int zend_jit_undefined_index_ex_stub(dasm_State **Dst)
static int zend_jit_undefined_index_stub(dasm_State **Dst)
{
|->undefined_index:
#ifdef __APPLE__
| stp x29, x30, [sp, # -16]!
| mov x29, sp
#endif
| //sub r4, 8
| ldr REG0, EX->opline
| ldr REG1w, OP:REG0->result.var
Expand All @@ -2037,9 +2053,17 @@ static int zend_jit_undefined_index_stub(dasm_State **Dst)
| LOAD_ADDR CARG2, "Undefined array key \"%s\""
| ldr CARG3, [REG0]
| add CARG3, CARG3, #offsetof(zend_string, val)
| EXT_JMP zend_error,REG0 // tail call
#ifdef __APPLE__
| str CARG3, [sp, #-16]!
| EXT_CALL zend_error, REG0
| add sp, sp, #16
| ldp x29, x30, [sp], #16
| ret
#else
| EXT_JMP zend_error, REG0 // tail call
| //add r4, 8
| //ret
#endif

return 1;
}
Expand Down Expand Up @@ -2083,7 +2107,13 @@ static int zend_jit_undefined_function_stub(dasm_State **Dst)
| ldrsw CARG3, [REG0, #offsetof(zend_op, op2.constant)]
| ldr CARG3, [REG0, CARG3]
| add CARG3, CARG3, #offsetof(zend_string, val)
#ifdef __APPLE__
| str CARG3, [sp, #-16]!
#endif
| EXT_CALL zend_throw_error, REG0
#ifdef __APPLE__
| add sp, sp, #16
#endif
| b ->exception_handler
return 1;
}
Expand Down