com php-src: Move asserts to better places: ext/opcache/jit/zen d_jit_trace.c
| From: | Dmitry Stogov | Date: | Tue, 28 Jul 2020 10:38:43 +0000 |
| Subject: | com php-src: Move asserts to better places: ext/opcache/jit/zen d_jit_trace.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-112404@lists.php.net to get a copy of this message | ||
Commit: f41bceb94ef85b962b43e82e2787c8669df50466
Author: Dmitry Stogov <dmitry@zend.com> Tue, 28 Jul 2020 13:38:43 +0300
Parents: b71b696826e35e7899f356dc78a9492d6aec0779
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=f41bceb94ef85b962b43e82e2787c8669df50466
Log:
Move asserts to better places
Changed paths:
M ext/opcache/jit/zend_jit_trace.c
Diff:
diff --git a/ext/opcache/jit/zend_jit_trace.c b/ext/opcache/jit/zend_jit_trace.c
index d1215b3734..a018c31c2e 100644
--- a/ext/opcache/jit/zend_jit_trace.c
+++ b/ext/opcache/jit/zend_jit_trace.c
@@ -2612,6 +2612,7 @@ static void zend_jit_trace_setup_ret_counter(const zend_op *opline, size_t
offse
zend_op *next_opline = (zend_op*)(opline + 1);
if (JIT_G(hot_return) && !ZEND_OP_TRACE_INFO(next_opline, offset)->trace_flags) {
+ ZEND_ASSERT(zend_jit_ret_trace_counter_handler != NULL);
if (!ZEND_OP_TRACE_INFO(next_opline, offset)->counter) {
ZEND_OP_TRACE_INFO(next_opline, offset)->counter =
&zend_jit_hot_counters[ZEND_JIT_COUNTER_NUM];
@@ -5693,9 +5694,6 @@ static int zend_jit_setup_hot_trace_counters(zend_op_array *op_array)
zend_jit_op_array_trace_extension *jit_extension;
uint32_t i;
- ZEND_ASSERT(zend_jit_func_trace_counter_handler != NULL);
- ZEND_ASSERT(zend_jit_ret_trace_counter_handler != NULL);
- ZEND_ASSERT(zend_jit_loop_trace_counter_handler != NULL);
ZEND_ASSERT(sizeof(zend_op_trace_info) == sizeof(zend_op));
jit_extension =
(zend_jit_op_array_trace_extension*)zend_shared_alloc(sizeof(zend_jit_op_array_trace_extension) +
(op_array->last - 1) * sizeof(zend_op_trace_info));
@@ -5716,6 +5714,8 @@ static int zend_jit_setup_hot_trace_counters(zend_op_array *op_array)
if (JIT_G(hot_loop)) {
zend_cfg cfg;
+ ZEND_ASSERT(zend_jit_loop_trace_counter_handler != NULL);
+
if (zend_jit_build_cfg(op_array, &cfg) != SUCCESS) {
return FAILURE;
}
@@ -5741,6 +5741,7 @@ static int zend_jit_setup_hot_trace_counters(zend_op_array *op_array)
}
if (JIT_G(hot_func)) {
+ ZEND_ASSERT(zend_jit_func_trace_counter_handler != NULL);
opline = op_array->opcodes;
if (!(op_array->fn_flags & ZEND_ACC_HAS_TYPE_HINTS)) {
while (opline->opcode == ZEND_RECV || opline->opcode == ZEND_RECV_INIT) {