Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Expose the origin of exit points in zend_jit_dump_exit_info() #19700

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

Open
arnaud-lb wants to merge 1 commit into php:master
base: master
Choose a base branch
Loading
from arnaud-lb:exit-point-dbg
Open
Show file tree
Hide file tree
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
3 changes: 2 additions & 1 deletion ext/opcache/jit/zend_jit.c
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_FUNC_CCONV zend_runtime_jit(Z

static int zend_jit_trace_op_len(const zend_op *opline);
static int zend_jit_trace_may_exit(const zend_op_array *op_array, const zend_op *opline);
static uint32_t zend_jit_trace_get_exit_point(const zend_op *to_opline, uint32_t flags);
static uint32_t _zend_jit_trace_get_exit_point(const zend_op *to_opline, uint32_t flags ZEND_FILE_LINE_DC);
#define zend_jit_trace_get_exit_point(to_opline, flags) _zend_jit_trace_get_exit_point(to_opline, flags ZEND_FILE_LINE_CC)
static const void *zend_jit_trace_get_exit_addr(uint32_t n);
static void zend_jit_trace_add_code(const void *start, uint32_t size);
static zend_string *zend_jit_func_name(const zend_op_array *op_array);
Expand Down
4 changes: 4 additions & 0 deletions ext/opcache/jit/zend_jit_internal.h
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,10 @@ typedef struct _zend_jit_trace_exit_info {
uint32_t stack_offset;
zend_jit_ref_snapshot poly_func;
zend_jit_ref_snapshot poly_this;
#if ZEND_DEBUG
const char *filename;
int lineno;
#endif
} zend_jit_trace_exit_info;

typedef struct _zend_jit_trace_stack {
Expand Down
16 changes: 14 additions & 2 deletions ext/opcache/jit/zend_jit_trace.c
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ static uint32_t zend_jit_exit_point_by_addr(const void *addr)
return (uint32_t)-1;
}

static uint32_t zend_jit_trace_get_exit_point(const zend_op *to_opline, uint32_t flags)
static uint32_t _zend_jit_trace_get_exit_point(const zend_op *to_opline, uint32_t flags ZEND_FILE_LINE_DC)
{
zend_jit_trace_info *t = &zend_jit_traces[ZEND_JIT_TRACE_NUM];
uint32_t exit_point;
Expand Down Expand Up @@ -178,7 +178,12 @@ static uint32_t zend_jit_trace_get_exit_point(const zend_op *to_opline, uint32_t
&& memcmp(t->stack_map + t->exit_info[i].stack_offset, stack, stack_size * sizeof(zend_jit_trace_stack)) == 0)) {
if (t->exit_info[i].opline == to_opline
&& t->exit_info[i].flags == flags
&& t->exit_info[i].stack_size == stack_size) {
&& t->exit_info[i].stack_size == stack_size
#if ZEND_DEBUG
&& strcmp(t->exit_info[i].filename, __zend_filename) == 0
&& t->exit_info[i].lineno == __zend_lineno
#endif
) {
return i;
}
}
Expand All @@ -202,6 +207,10 @@ static uint32_t zend_jit_trace_get_exit_point(const zend_op *to_opline, uint32_t
t->exit_info[exit_point].stack_offset = stack_offset;
t->exit_info[exit_point].poly_func = (zend_jit_ref_snapshot){.reg = ZREG_NONE};
t->exit_info[exit_point].poly_this = (zend_jit_ref_snapshot){.reg = ZREG_NONE};
#if ZEND_DEBUG
t->exit_info[exit_point].filename = __zend_filename;
t->exit_info[exit_point].lineno = __zend_lineno;
#endif
}

return exit_point;
Expand Down Expand Up @@ -8096,6 +8105,9 @@ static void zend_jit_dump_exit_info(zend_jit_trace_info *t)
fprintf(stderr, ":unknown(zval_copy(%s))", zend_reg_name(STACK_REG(stack, j)));
}
}
#if ZEND_DEBUG
fprintf(stderr, " %s:%d", t->exit_info[i].filename, t->exit_info[i].lineno);
#endif
fprintf(stderr, "\n");
}
}
Expand Down

AltStyle によって変換されたページ (->オリジナル) /