Skip to content

Commit 838c437

Browse files
committed
Collect filename/lineno only when ZEND_JIT_DEBUG_TRACE_EXIT_INFO flag is set
1 parent e5b7fc0 commit 838c437

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

ext/opcache/jit/zend_jit_trace.c

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,9 @@ static uint32_t _zend_jit_trace_get_exit_point(const zend_op *to_opline, uint32_
180180
&& t->exit_info[i].flags == flags
181181
&& t->exit_info[i].stack_size == stack_size
182182
#if ZEND_DEBUG
183-
&& strcmp(t->exit_info[i].filename, __zend_filename) == 0
184-
&& t->exit_info[i].lineno == __zend_lineno
183+
&& (((JIT_G(debug) & ZEND_JIT_DEBUG_TRACE_EXIT_INFO) == 0)
184+
|| (strcmp(t->exit_info[i].filename, __zend_filename) == 0
185+
&& t->exit_info[i].lineno == __zend_lineno))
185186
#endif
186187
) {
187188
return i;
@@ -208,8 +209,13 @@ static uint32_t _zend_jit_trace_get_exit_point(const zend_op *to_opline, uint32_
208209
t->exit_info[exit_point].poly_func = (zend_jit_ref_snapshot){.reg = ZREG_NONE};
209210
t->exit_info[exit_point].poly_this = (zend_jit_ref_snapshot){.reg = ZREG_NONE};
210211
#if ZEND_DEBUG
211-
t->exit_info[exit_point].filename = __zend_filename;
212-
t->exit_info[exit_point].lineno = __zend_lineno;
212+
if ((JIT_G(debug) & ZEND_JIT_DEBUG_TRACE_EXIT_INFO) != 0) {
213+
t->exit_info[exit_point].filename = __zend_filename;
214+
t->exit_info[exit_point].lineno = __zend_lineno;
215+
} else {
216+
t->exit_info[exit_point].filename = NULL;
217+
t->exit_info[exit_point].lineno = 0;
218+
}
213219
#endif
214220
}
215221

@@ -8106,7 +8112,9 @@ static void zend_jit_dump_exit_info(zend_jit_trace_info *t)
81068112
}
81078113
}
81088114
#if ZEND_DEBUG
8109-
fprintf(stderr, " %s:%d", t->exit_info[i].filename, t->exit_info[i].lineno);
8115+
if ((JIT_G(debug) & ZEND_JIT_DEBUG_TRACE_EXIT_INFO) != 0) {
8116+
fprintf(stderr, " %s:%d", t->exit_info[i].filename, t->exit_info[i].lineno);
8117+
}
81108118
#endif
81118119
fprintf(stderr, "\n");
81128120
}

0 commit comments

Comments
 (0)