Lines Matching refs:opline

177 				if (t->exit_info[i].opline == to_opline  in zend_jit_trace_get_exit_point()
196 t->exit_info[exit_point].opline = to_opline; in zend_jit_trace_get_exit_point()
261 static int zend_jit_trace_may_exit(const zend_op_array *op_array, const zend_op *opline) in zend_jit_trace_may_exit() argument
263 switch (opline->opcode) { in zend_jit_trace_may_exit()
282 if (opline->result_type & (IS_SMART_BRANCH_JMPNZ | IS_SMART_BRANCH_JMPZ)) { in zend_jit_trace_may_exit()
307 if (opline->extended_value == 0 && (opline+1)->opcode == ZEND_DO_FCALL) { in zend_jit_trace_may_exit()
401 if (!zend_jit_type_guard(&ctx, opline, _var, op_type)) { \
424 CHECK_OP_TRACE_TYPE(opline->op1.var, ssa_op->op1_use, op1_info, op1_type)
426 CHECK_OP_TRACE_TYPE(opline->op2.var, ssa_op->op2_use, op2_info, op2_type)
428 CHECK_OP_TRACE_TYPE((opline+1)->op1.var, (ssa_op+1)->op1_use, op1_data_info, op3_type)
451 static void zend_jit_trace_send_type(const zend_op *opline, zend_jit_trace_stack_frame *call, uint8… in zend_jit_trace_send_type() argument
455 uint32_t arg_num = opline->op2.num; in zend_jit_trace_send_type()
472 SET_STACK_TYPE(stack, EX_VAR_TO_NUM(opline->result.var), type, 1); in zend_jit_trace_send_type()
498 if (call_info && arg_num < call_info->num_args && call_info->arg_info[arg_num].opline) { in zend_jit_needs_arg_dtor()
499 const zend_op *opline = call_info->arg_info[arg_num].opline; in zend_jit_needs_arg_dtor() local
501 if (opline->opcode == ZEND_SEND_VAL && opline->op1_type == IS_CONST) { in zend_jit_needs_arg_dtor()
502 zval *zv = RT_CONSTANT(opline, opline->op1); in zend_jit_needs_arg_dtor()
588 static zend_always_inline int zend_jit_trace_op_len(const zend_op *opline) in zend_jit_trace_op_len() argument
592 switch (opline->opcode) { in zend_jit_trace_op_len()
605 opline++; in zend_jit_trace_op_len()
606 while (opline->opcode == ZEND_RECV_INIT) { in zend_jit_trace_op_len()
608 opline++; in zend_jit_trace_op_len()
613 opline++; in zend_jit_trace_op_len()
614 while (opline->opcode == ZEND_BIND_GLOBAL) { in zend_jit_trace_op_len()
616 opline++; in zend_jit_trace_op_len()
637 if ((opline->result_type & (IS_SMART_BRANCH_JMPZ|IS_SMART_BRANCH_JMPNZ)) != 0) { in zend_jit_trace_op_len()
664 const zend_op *opline = p->opline; in zend_jit_trace_add_phis() local
667 zend_dfg_add_use_def_op(op_array, opline, build_flags, use, def); in zend_jit_trace_add_phis()
668 len = zend_jit_trace_op_len(opline); in zend_jit_trace_add_phis()
670 opline++; in zend_jit_trace_add_phis()
671 if (opline->opcode != ZEND_OP_DATA) { in zend_jit_trace_add_phis()
672 zend_dfg_add_use_def_op(op_array, opline, build_flags, use, def); in zend_jit_trace_add_phis()
733 const zend_op *opline = trace_buffer[1].opline; in zend_jit_trace_add_call_phis() local
734 int count = opline - op_array->opcodes; in zend_jit_trace_add_call_phis()
764 const zend_op *opline = trace_buffer[1].opline - 1; in zend_jit_trace_add_ret_phis() local
767 if (RETURN_VALUE_USED(opline)) { in zend_jit_trace_add_ret_phis()
773 i = EX_VAR_TO_NUM(opline->result.var); in zend_jit_trace_add_ret_phis()
791 const zend_op *opline; in zend_jit_trace_is_false_loop() local
799 opline = tssa_opcodes[tssa->cfg.blocks[1].len - 1]; in zend_jit_trace_is_false_loop()
800 if (opline >= op_array->opcodes && opline < op_array->opcodes + op_array->last) { in zend_jit_trace_is_false_loop()
801 bb = ssa->cfg.blocks + ssa->cfg.map[opline - op_array->opcodes]; in zend_jit_trace_is_false_loop()
813 const zend_op *opline) in zend_jit_trace_copy_ssa_var_info() argument
921 if (opline) { in zend_jit_trace_copy_ssa_var_info()
924 uint32_t op_num = opline - op_array->opcodes; in zend_jit_trace_copy_ssa_var_info()
1105 if (p->opline->opcode == ZEND_DO_UCALL in find_return_ssa_var()
1106 || p->opline->opcode == ZEND_DO_FCALL_BY_NAME in find_return_ssa_var()
1107 || p->opline->opcode == ZEND_DO_FCALL) { in find_return_ssa_var()
1108 if (p->opline->result_type != IS_UNUSED) { in find_return_ssa_var()
1128 if (p->opline->opcode == ZEND_INIT_FCALL in zend_jit_trace_find_init_fcall_op()
1129 || p->opline->opcode == ZEND_INIT_FCALL_BY_NAME in zend_jit_trace_find_init_fcall_op()
1130 || p->opline->opcode == ZEND_INIT_NS_FCALL_BY_NAME in zend_jit_trace_find_init_fcall_op()
1131 || p->opline->opcode == ZEND_INIT_DYNAMIC_CALL in zend_jit_trace_find_init_fcall_op()
1132 || p->opline->opcode == ZEND_INIT_USER_CALL in zend_jit_trace_find_init_fcall_op()
1133 || p->opline->opcode == ZEND_NEW in zend_jit_trace_find_init_fcall_op()
1134 || p->opline->opcode == ZEND_INIT_METHOD_CALL in zend_jit_trace_find_init_fcall_op()
1135 || p->opline->opcode == ZEND_INIT_STATIC_METHOD_CALL in zend_jit_trace_find_init_fcall_op()
1136 || p->opline->opcode == ZEND_INIT_PARENT_PROPERTY_HOOK_CALL) { in zend_jit_trace_find_init_fcall_op()
1137 return p->opline; in zend_jit_trace_find_init_fcall_op()
1148 const zend_op *opline = NULL; in zend_jit_trace_find_init_fcall_op() local
1154 opline = p->opline; in zend_jit_trace_find_init_fcall_op()
1164 if (opline) { in zend_jit_trace_find_init_fcall_op()
1165 while (opline > op_array->opcodes) { in zend_jit_trace_find_init_fcall_op()
1166 opline--; in zend_jit_trace_find_init_fcall_op()
1167 switch (opline->opcode) { in zend_jit_trace_find_init_fcall_op()
1178 return opline; in zend_jit_trace_find_init_fcall_op()
1204 const zend_op *opline = ssa_opcodes[idx]; in is_checked_guard() local
1205 if (opline->opcode == ZEND_PRE_DEC in is_checked_guard()
1206 || opline->opcode == ZEND_PRE_INC in is_checked_guard()
1207 || opline->opcode == ZEND_POST_DEC in is_checked_guard()
1208 || opline->opcode == ZEND_POST_INC) { in is_checked_guard()
1217 } else if (opline->opcode == ZEND_ASSIGN_OP in is_checked_guard()
1218 && (opline->extended_value == ZEND_ADD in is_checked_guard()
1219 || opline->extended_value == ZEND_SUB in is_checked_guard()
1220 || opline->extended_value == ZEND_MUL)) { in is_checked_guard()
1221 if ((opline->op2_type & (IS_VAR|IS_CV)) in is_checked_guard()
1229 if (opline->op2_type == IS_CONST) { in is_checked_guard()
1230 zval *zv = RT_CONSTANT(opline, opline->op2); in is_checked_guard()
1241 const zend_op *opline = ssa_opcodes[idx]; in is_checked_guard() local
1242 if (opline->opcode == ZEND_ADD in is_checked_guard()
1243 || opline->opcode == ZEND_SUB in is_checked_guard()
1244 || opline->opcode == ZEND_MUL) { in is_checked_guard()
1245 if ((opline->op1_type & (IS_VAR|IS_CV)) in is_checked_guard()
1250 if ((opline->op2_type & (IS_VAR|IS_CV)) in is_checked_guard()
1255 if (opline->op1_type == IS_CONST) { in is_checked_guard()
1256 zval *zv = RT_CONSTANT(opline, opline->op1); in is_checked_guard()
1263 if (opline->op2_type == IS_CONST) { in is_checked_guard()
1264 zval *zv = RT_CONSTANT(opline, opline->op2); in is_checked_guard()
1272 } else if (opline->opcode == ZEND_PRE_DEC in is_checked_guard()
1273 || opline->opcode == ZEND_PRE_INC in is_checked_guard()
1274 || opline->opcode == ZEND_POST_DEC in is_checked_guard()
1275 || opline->opcode == ZEND_POST_INC) { in is_checked_guard()
1276 if ((opline->op1_type & (IS_VAR|IS_CV)) in is_checked_guard()
1340 const zend_op *opline; in zend_jit_trace_build_tssa() local
1373 const zend_op *opline = p->opline; in zend_jit_trace_build_tssa() local
1375 switch (opline->opcode) { in zend_jit_trace_build_tssa()
1387 if (opline->extended_value & ZEND_FETCH_LOCAL) { in zend_jit_trace_build_tssa()
1389 } else if ((opline->extended_value & (ZEND_FETCH_GLOBAL | ZEND_FETCH_GLOBAL_LOCK)) && in zend_jit_trace_build_tssa()
1396 ssa_ops_count += zend_jit_trace_op_len(p->opline); in zend_jit_trace_build_tssa()
1560 opline = p->opline; in zend_jit_trace_build_tssa()
1561 ssa_opcodes[idx] = opline; in zend_jit_trace_build_tssa()
1562 …ssa_vars_count = zend_ssa_rename_op(op_array, opline, idx, build_flags, ssa_vars_count, ssa_ops, (… in zend_jit_trace_build_tssa()
1564 len = zend_jit_trace_op_len(p->opline); in zend_jit_trace_build_tssa()
1566 opline++; in zend_jit_trace_build_tssa()
1567 ssa_opcodes[idx] = opline; in zend_jit_trace_build_tssa()
1568 if (opline->opcode != ZEND_OP_DATA) { in zend_jit_trace_build_tssa()
1569 …ssa_vars_count = zend_ssa_rename_op(op_array, opline, idx, build_flags, ssa_vars_count, ssa_ops, (… in zend_jit_trace_build_tssa()
1650 opline = ssa_opcodes[idx]; in zend_jit_trace_build_tssa()
1664 ssa_vars[op->op1_def].var = EX_VAR_TO_NUM(opline->op1.var); in zend_jit_trace_build_tssa()
1668 ssa_vars[op->op2_def].var = EX_VAR_TO_NUM(opline->op2.var); in zend_jit_trace_build_tssa()
1672 ssa_vars[op->result_def].var = EX_VAR_TO_NUM(opline->result.var); in zend_jit_trace_build_tssa()
1681 opline = trace_buffer[1].opline; in zend_jit_trace_build_tssa()
1702 if (op_array->arg_info && i < trace_buffer[1].opline - op_array->opcodes) { in zend_jit_trace_build_tssa()
1748 || !zend_jit_trace_copy_ssa_var_info(op_array, ssa, ssa_opcodes, tssa, i, opline)) { in zend_jit_trace_build_tssa()
1810 opline = NULL; in zend_jit_trace_build_tssa()
1818 opline = p->opline; in zend_jit_trace_build_tssa()
1849 switch (opline->opcode) { in zend_jit_trace_build_tssa()
1851 if (opline->extended_value == ZEND_POW in zend_jit_trace_build_tssa()
1852 || opline->extended_value == ZEND_DIV) { in zend_jit_trace_build_tssa()
1856 if (opline->op1_type != IS_CV || opline->result_type != IS_UNUSED) { in zend_jit_trace_build_tssa()
1863 if (opline->result_type != IS_UNUSED) { in zend_jit_trace_build_tssa()
1868 opline->extended_value, MAY_BE_ANY, (1<<op3_type))) { in zend_jit_trace_build_tssa()
1873 if (opline->opcode == ZEND_ASSIGN_DIM in zend_jit_trace_build_tssa()
1874 && opline->op1_type == IS_CV in zend_jit_trace_build_tssa()
1875 && (opline+1)->op1_type == IS_CV in zend_jit_trace_build_tssa()
1876 && (opline+1)->op1.var == opline->op1.var) { in zend_jit_trace_build_tssa()
1880 if (opline->op1_type == IS_CV || opline->opcode == ZEND_ASSIGN_DIM_OP) { in zend_jit_trace_build_tssa()
1886 && ((opline->op2_type == IS_CONST in zend_jit_trace_build_tssa()
1887 && Z_TYPE_P(RT_CONSTANT(opline, opline->op2)) == IS_LONG) in zend_jit_trace_build_tssa()
1888 || (opline->op2_type != IS_CONST in zend_jit_trace_build_tssa()
1898 } else if (opline->opcode == ZEND_ASSIGN_DIM_OP in zend_jit_trace_build_tssa()
1911 if (opline->extended_value == ZEND_POW in zend_jit_trace_build_tssa()
1912 || opline->extended_value == ZEND_DIV) { in zend_jit_trace_build_tssa()
1916 if (opline->result_type != IS_UNUSED) { in zend_jit_trace_build_tssa()
1925 if (opline->op2_type != IS_CONST in zend_jit_trace_build_tssa()
1926 || Z_TYPE_P(RT_CONSTANT(opline, opline->op2)) != IS_STRING in zend_jit_trace_build_tssa()
1927 || Z_STRVAL_P(RT_CONSTANT(opline, opline->op2))[0] == '\0') { in zend_jit_trace_build_tssa()
1930 if (opline->opcode == ZEND_ASSIGN_OBJ in zend_jit_trace_build_tssa()
1931 || opline->opcode == ZEND_ASSIGN_OBJ_OP) { in zend_jit_trace_build_tssa()
1932 if (opline->op1_type == IS_CV in zend_jit_trace_build_tssa()
1933 && (opline+1)->op1_type == IS_CV in zend_jit_trace_build_tssa()
1934 && (opline+1)->op1.var == opline->op1.var) { in zend_jit_trace_build_tssa()
1944 if ((opline->op1_type == IS_CONST || orig_op1_type == IS_STRING) in zend_jit_trace_build_tssa()
1945 && (opline->op2_type == IS_CONST || orig_op2_type == IS_STRING)) { in zend_jit_trace_build_tssa()
1998 if (opline->op1_type == IS_UNUSED) { in zend_jit_trace_build_tssa()
2002 if (opline->op1_type == IS_CONST) { in zend_jit_trace_build_tssa()
2026 if (opline->op1_type != IS_CV) { in zend_jit_trace_build_tssa()
2032 if (opline->op1_type != IS_CV) { in zend_jit_trace_build_tssa()
2042 if (opline->extended_value != op1_type) { in zend_jit_trace_build_tssa()
2056 if ((opline->extended_value & ZEND_ISEMPTY)) { in zend_jit_trace_build_tssa()
2063 if (opline->op1_type == IS_VAR || opline->op1_type == IS_TMP_VAR) { in zend_jit_trace_build_tssa()
2069 if ((opline->extended_value & ZEND_ISEMPTY)) { in zend_jit_trace_build_tssa()
2081 && opline->op1_type != IS_CONST in zend_jit_trace_build_tssa()
2082 && ((opline->op2_type == IS_CONST in zend_jit_trace_build_tssa()
2083 && Z_TYPE_P(RT_CONSTANT(opline, opline->op2)) == IS_LONG) in zend_jit_trace_build_tssa()
2084 || (opline->op2_type != IS_CONST in zend_jit_trace_build_tssa()
2103 if (opline->op1_type != IS_CV in zend_jit_trace_build_tssa()
2112 && ((opline->op2_type == IS_CONST in zend_jit_trace_build_tssa()
2113 && Z_TYPE_P(RT_CONSTANT(opline, opline->op2)) == IS_LONG) in zend_jit_trace_build_tssa()
2114 || (opline->op2_type != IS_CONST in zend_jit_trace_build_tssa()
2128 if (opline->op2_type == IS_CONST) { in zend_jit_trace_build_tssa()
2132 if (opline->op2.num > MAX_ARG_FLAG_NUM) { in zend_jit_trace_build_tssa()
2140 if (opline->op2_type == IS_CONST) { in zend_jit_trace_build_tssa()
2150 && opline->op2.num <= frame->call->func->op_array.num_args) { in zend_jit_trace_build_tssa()
2153 if (opline->op1_type == IS_CONST) { in zend_jit_trace_build_tssa()
2154 info = _const_op_type(RT_CONSTANT(opline, opline->op1)); in zend_jit_trace_build_tssa()
2163 arg_info = &frame->call->func->op_array.arg_info[opline->op2.num - 1]; in zend_jit_trace_build_tssa()
2173 if (opline->op1_type == IS_CV && (info & MAY_BE_RC1)) { in zend_jit_trace_build_tssa()
2180 if (ARG_SHOULD_BE_SENT_BY_REF(frame->call->func, opline->op2.num)) { in zend_jit_trace_build_tssa()
2183 SET_STACK_INFO(frame->call->stack, opline->op2.num - 1, info); in zend_jit_trace_build_tssa()
2189 if (opline->op1_type == IS_UNUSED) { in zend_jit_trace_build_tssa()
2191 } else if (opline->op1_type == IS_CONST) { in zend_jit_trace_build_tssa()
2192 return_value_info.type = _const_op_type(RT_CONSTANT(opline, opline->op1)); in zend_jit_trace_build_tssa()
2214 if (opline->op2_type == IS_CONST in zend_jit_trace_build_tssa()
2215 || opline->op2.num > MAX_ARG_FLAG_NUM) { in zend_jit_trace_build_tssa()
2220 if (ARG_SHOULD_BE_SENT_BY_REF(frame->call->func, opline->op2.num)) { in zend_jit_trace_build_tssa()
2237 if (opline->op2_type != IS_CONST in zend_jit_trace_build_tssa()
2238 || Z_TYPE_P(RT_CONSTANT(opline, opline->op2)) != IS_STRING in zend_jit_trace_build_tssa()
2239 || Z_STRVAL_P(RT_CONSTANT(opline, opline->op2))[0] == '\0') { in zend_jit_trace_build_tssa()
2242 if (opline->op1_type != IS_UNUSED && op1_type == IS_OBJECT) { in zend_jit_trace_build_tssa()
2247 if (opline->op2_type != IS_CONST in zend_jit_trace_build_tssa()
2248 || Z_TYPE_P(RT_CONSTANT(opline, opline->op2)) != IS_STRING) { in zend_jit_trace_build_tssa()
2265 if (opline->extended_value == MAY_BE_RESOURCE) { in zend_jit_trace_build_tssa()
2270 && (opline->extended_value == (1 << op1_type) in zend_jit_trace_build_tssa()
2271 || opline->extended_value == MAY_BE_ANY - (1 << op1_type))) { in zend_jit_trace_build_tssa()
2286 len = zend_jit_trace_op_len(opline); in zend_jit_trace_build_tssa()
2298 if (len == 2 && (opline+1)->opcode == ZEND_OP_DATA) { in zend_jit_trace_build_tssa()
2311 …sa_ops[idx].op1_def].alias = zend_jit_var_may_alias(op_array, ssa, EX_VAR_TO_NUM(opline->op1.var)); in zend_jit_trace_build_tssa()
2317 …sa_ops[idx].op2_def].alias = zend_jit_var_may_alias(op_array, ssa, EX_VAR_TO_NUM(opline->op2.var)); in zend_jit_trace_build_tssa()
2323 …[idx].result_def].alias = zend_jit_var_may_alias(op_array, ssa, EX_VAR_TO_NUM(opline->result.var)); in zend_jit_trace_build_tssa()
2328 if (len == 2 && (opline+1)->opcode == ZEND_OP_DATA) { in zend_jit_trace_build_tssa()
2330 …[idx+1].op1_def].alias = zend_jit_var_may_alias(op_array, ssa, EX_VAR_TO_NUM((opline+1)->op1.var)); in zend_jit_trace_build_tssa()
2336 …[idx+1].op2_def].alias = zend_jit_var_may_alias(op_array, ssa, EX_VAR_TO_NUM((opline+1)->op2.var)); in zend_jit_trace_build_tssa()
2342 …].result_def].alias = zend_jit_var_may_alias(op_array, ssa, EX_VAR_TO_NUM((opline+1)->result.var)); in zend_jit_trace_build_tssa()
2349 if (opline->opcode == ZEND_RECV_INIT in zend_jit_trace_build_tssa()
2352 ssa_var_info[ssa_ops[idx].result_def].type = _const_op_type(RT_CONSTANT(opline, opline->op2)); in zend_jit_trace_build_tssa()
2353 } else if ((opline->opcode == ZEND_FE_FETCH_R || opline->opcode == ZEND_FE_FETCH_RW) in zend_jit_trace_build_tssa()
2354 && ssa_opcodes[idx + 1] == ZEND_OFFSET_TO_OPLINE(opline, opline->extended_value)) { in zend_jit_trace_build_tssa()
2359 …if (zend_update_type_info(op_array, tssa, script, (zend_op*)opline, ssa_ops + idx, ssa_opcodes, op… in zend_jit_trace_build_tssa()
2363 if (opline->opcode == ZEND_ASSIGN_DIM_OP in zend_jit_trace_build_tssa()
2369 && ((opline->op2_type == IS_CONST in zend_jit_trace_build_tssa()
2370 && Z_TYPE_P(RT_CONSTANT(opline, opline->op2)) == IS_LONG) in zend_jit_trace_build_tssa()
2371 || (opline->op2_type != IS_CONST in zend_jit_trace_build_tssa()
2381 if (opline->opcode == ZEND_SEND_VAR_EX in zend_jit_trace_build_tssa()
2385 && !ARG_SHOULD_BE_SENT_BY_REF(frame->call->func, opline->op2.num)) { in zend_jit_trace_build_tssa()
2396 if ((opline->opcode != ZEND_FE_FETCH_R && opline->opcode != ZEND_FE_FETCH_RW) in zend_jit_trace_build_tssa()
2397 || ssa_opcodes[idx + 1] != ZEND_OFFSET_TO_OPLINE(opline, opline->extended_value)) { in zend_jit_trace_build_tssa()
2407 opline++; in zend_jit_trace_build_tssa()
2408 if (opline->opcode != ZEND_OP_DATA) { in zend_jit_trace_build_tssa()
2422 …sa_ops[idx].op1_def].alias = zend_jit_var_may_alias(op_array, ssa, EX_VAR_TO_NUM(opline->op1.var)); in zend_jit_trace_build_tssa()
2428 …sa_ops[idx].op2_def].alias = zend_jit_var_may_alias(op_array, ssa, EX_VAR_TO_NUM(opline->op2.var)); in zend_jit_trace_build_tssa()
2434 …[idx].result_def].alias = zend_jit_var_may_alias(op_array, ssa, EX_VAR_TO_NUM(opline->result.var)); in zend_jit_trace_build_tssa()
2440 if (opline->opcode == ZEND_RECV_INIT in zend_jit_trace_build_tssa()
2443 ssa_var_info[ssa_ops[idx].result_def].type = _const_op_type(RT_CONSTANT(opline, opline->op2)); in zend_jit_trace_build_tssa()
2445 …if (zend_update_type_info(op_array, tssa, script, (zend_op*)opline, ssa_ops + idx, ssa_opcodes, op… in zend_jit_trace_build_tssa()
2569 const zend_op *opline = q->opline - 1; in zend_jit_trace_build_tssa() local
2570 if (opline->result_type != IS_UNUSED) { in zend_jit_trace_build_tssa()
2573 EX_VAR_TO_NUM(opline->result.var)] = return_value_info; in zend_jit_trace_build_tssa()
2582 const zend_op *opline = (p+1)->opline - 1; in zend_jit_trace_build_tssa() local
2583 if (opline->result_type != IS_UNUSED) { in zend_jit_trace_build_tssa()
2625 const zend_op *opline = (p-1)->opline; in zend_jit_trace_build_tssa() local
2627 switch (opline->opcode) { in zend_jit_trace_build_tssa()
2637 frame->used_stack = zend_vm_calc_used_stack(opline->extended_value, (zend_function*)p->func); in zend_jit_trace_build_tssa()
2660 ZEND_ASSERT(ssa_opcodes[idx-1] == opline); in zend_jit_trace_build_tssa()
2661 ZEND_ASSERT(opline->opcode == ZEND_DO_ICALL || in zend_jit_trace_build_tssa()
2662 opline->opcode == ZEND_DO_FCALL || in zend_jit_trace_build_tssa()
2663 opline->opcode == ZEND_DO_FCALL_BY_NAME); in zend_jit_trace_build_tssa()
2665 if (opline->result_type != IS_UNDEF) { in zend_jit_trace_build_tssa()
2783 trace_buffer[1].opline->lineno); in zend_jit_trace_build_tssa()
2793 trace_buffer[1].opline->lineno); in zend_jit_trace_build_tssa()
2798 uint32_t link_to = zend_jit_find_trace(trace_buffer[idx].opline->handler); in zend_jit_trace_build_tssa()
2949 const zend_op *opline = p->opline; in zend_jit_trace_allocate_registers() local
2954 zend_jit_opline_supports_reg(op_array, ssa, opline, ssa_op, p); in zend_jit_trace_allocate_registers()
2957 && opline->opcode == ZEND_ASSIGN in zend_jit_trace_allocate_registers()
2958 && opline->op1_type == IS_CV in zend_jit_trace_allocate_registers()
2970 } else if (!zend_ssa_is_no_val_use(opline, ssa_op, ssa_op->op1_use)) { in zend_jit_trace_allocate_registers()
2974 if (opline->op1_type != IS_CV) { in zend_jit_trace_allocate_registers()
2975 if (opline->opcode == ZEND_CASE in zend_jit_trace_allocate_registers()
2976 || opline->opcode == ZEND_CASE_STRICT in zend_jit_trace_allocate_registers()
2977 || opline->opcode == ZEND_SWITCH_LONG in zend_jit_trace_allocate_registers()
2978 || opline->opcode == ZEND_MATCH in zend_jit_trace_allocate_registers()
2979 || opline->opcode == ZEND_FETCH_LIST_R in zend_jit_trace_allocate_registers()
2980 || opline->opcode == ZEND_COPY_TMP in zend_jit_trace_allocate_registers()
2981 || opline->opcode == ZEND_SWITCH_STRING in zend_jit_trace_allocate_registers()
2982 || opline->opcode == ZEND_FE_FETCH_R in zend_jit_trace_allocate_registers()
2983 || opline->opcode == ZEND_FE_FETCH_RW in zend_jit_trace_allocate_registers()
2984 || opline->opcode == ZEND_FETCH_LIST_W in zend_jit_trace_allocate_registers()
2985 || opline->opcode == ZEND_VERIFY_RETURN_TYPE in zend_jit_trace_allocate_registers()
2986 || opline->opcode == ZEND_BIND_LEXICAL in zend_jit_trace_allocate_registers()
2987 || opline->opcode == ZEND_ROPE_ADD) { in zend_jit_trace_allocate_registers()
3002 } else if (!zend_ssa_is_no_val_use(opline, ssa_op, ssa_op->op2_use)) { in zend_jit_trace_allocate_registers()
3006 if (opline->op2_type != IS_CV) { in zend_jit_trace_allocate_registers()
3018 } else if (!zend_ssa_is_no_val_use(opline, ssa_op, ssa_op->result_use)) { in zend_jit_trace_allocate_registers()
3026 RA_IVAL_CLOSE(EX_VAR_TO_NUM(opline->op1.var), idx); in zend_jit_trace_allocate_registers()
3027 SET_STACK_VAR(stack, EX_VAR_TO_NUM(opline->op1.var), ssa_op->op1_def); in zend_jit_trace_allocate_registers()
3030 RA_IVAL_CLOSE(EX_VAR_TO_NUM(opline->op2.var), idx); in zend_jit_trace_allocate_registers()
3031 SET_STACK_VAR(stack, EX_VAR_TO_NUM(opline->op2.var), ssa_op->op2_def); in zend_jit_trace_allocate_registers()
3034 RA_IVAL_CLOSE(EX_VAR_TO_NUM(opline->result.var), idx); in zend_jit_trace_allocate_registers()
3035 SET_STACK_VAR(stack, EX_VAR_TO_NUM(opline->result.var), ssa_op->result_def); in zend_jit_trace_allocate_registers()
3045 || opline->opcode == ZEND_PRE_INC in zend_jit_trace_allocate_registers()
3046 || opline->opcode == ZEND_PRE_DEC in zend_jit_trace_allocate_registers()
3047 || opline->opcode == ZEND_POST_INC in zend_jit_trace_allocate_registers()
3048 || opline->opcode == ZEND_POST_DEC in zend_jit_trace_allocate_registers()
3049 || opline->opcode == ZEND_ADD in zend_jit_trace_allocate_registers()
3050 || opline->opcode == ZEND_SUB in zend_jit_trace_allocate_registers()
3051 || opline->opcode == ZEND_MUL in zend_jit_trace_allocate_registers()
3052 || opline->opcode == ZEND_FETCH_DIM_R in zend_jit_trace_allocate_registers()
3053 || opline->opcode == ZEND_FETCH_OBJ_R in zend_jit_trace_allocate_registers()
3054 || opline->opcode == ZEND_FETCH_CONSTANT) { in zend_jit_trace_allocate_registers()
3056 || (opline->opcode != ZEND_PRE_INC && opline->opcode != ZEND_PRE_DEC)) { in zend_jit_trace_allocate_registers()
3069 || opline->opcode == ZEND_PRE_INC in zend_jit_trace_allocate_registers()
3070 || opline->opcode == ZEND_PRE_DEC in zend_jit_trace_allocate_registers()
3071 || opline->opcode == ZEND_POST_INC in zend_jit_trace_allocate_registers()
3072 || opline->opcode == ZEND_POST_DEC)) { in zend_jit_trace_allocate_registers()
3089 len = zend_jit_trace_op_len(opline); in zend_jit_trace_allocate_registers()
3090 switch (opline->opcode) { in zend_jit_trace_allocate_registers()
3102 opline++; in zend_jit_trace_allocate_registers()
3105 && !zend_ssa_is_no_val_use(opline, ssa_op, ssa_op->op1_use)) { in zend_jit_trace_allocate_registers()
3110 if (opline->op1_type != IS_CV) { in zend_jit_trace_allocate_registers()
3119 RA_IVAL_CLOSE(EX_VAR_TO_NUM(opline->op1.var), idx); in zend_jit_trace_allocate_registers()
3120 SET_STACK_VAR(stack, EX_VAR_TO_NUM(opline->op1.var), ssa_op->op1_def); in zend_jit_trace_allocate_registers()
3133 opline++; in zend_jit_trace_allocate_registers()
3138 opline++; in zend_jit_trace_allocate_registers()
3140 while (opline->opcode == ZEND_RECV_INIT) { in zend_jit_trace_allocate_registers()
3147 RA_IVAL_CLOSE(EX_VAR_TO_NUM(opline->result.var), idx); in zend_jit_trace_allocate_registers()
3148 SET_STACK_VAR(stack, EX_VAR_TO_NUM(opline->result.var), ssa_op->result_def); in zend_jit_trace_allocate_registers()
3151 opline++; in zend_jit_trace_allocate_registers()
3157 opline++; in zend_jit_trace_allocate_registers()
3159 while (opline->opcode == ZEND_BIND_GLOBAL) { in zend_jit_trace_allocate_registers()
3162 RA_IVAL_CLOSE(EX_VAR_TO_NUM(opline->op1.var), idx); in zend_jit_trace_allocate_registers()
3163 SET_STACK_VAR(stack, EX_VAR_TO_NUM(opline->op1.var), ssa_op->op1_def); in zend_jit_trace_allocate_registers()
3166 opline++; in zend_jit_trace_allocate_registers()
3382 …nup_stack(zend_jit_ctx *jit, zend_jit_trace_stack *stack, const zend_op *opline, const zend_ssa_op… in zend_jit_trace_cleanup_stack() argument
3389 CLEAR_STACK_REF(stack, EX_VAR_TO_NUM(opline->op1.var)); in zend_jit_trace_cleanup_stack()
3397 CLEAR_STACK_REF(stack, EX_VAR_TO_NUM(opline->op2.var)); in zend_jit_trace_cleanup_stack()
3406 CLEAR_STACK_REF(stack, EX_VAR_TO_NUM(opline->result.var)); in zend_jit_trace_cleanup_stack()
3410 static void zend_jit_trace_setup_ret_counter(const zend_op *opline, size_t offset) in zend_jit_trace_setup_ret_counter() argument
3412 zend_op *next_opline = (zend_op*)(opline + 1); in zend_jit_trace_setup_ret_counter()
3431 const zend_op *opline; in zend_jit_may_delay_fetch_this() local
3440 opline = ssa_opcodes[use]; in zend_jit_may_delay_fetch_this()
3441 if (opline->opcode == ZEND_INIT_METHOD_CALL) { in zend_jit_may_delay_fetch_this()
3442 return (opline->op2_type == IS_CONST && in zend_jit_may_delay_fetch_this()
3443 Z_TYPE_P(RT_CONSTANT(opline, opline->op2)) == IS_STRING); in zend_jit_may_delay_fetch_this()
3444 } else if (opline->opcode == ZEND_FETCH_OBJ_FUNC_ARG) { in zend_jit_may_delay_fetch_this()
3451 } else if (opline->opcode != ZEND_FETCH_OBJ_R in zend_jit_may_delay_fetch_this()
3452 && opline->opcode != ZEND_FETCH_OBJ_IS in zend_jit_may_delay_fetch_this()
3453 && opline->opcode != ZEND_FETCH_OBJ_W in zend_jit_may_delay_fetch_this()
3454 && opline->opcode != ZEND_ASSIGN_OBJ in zend_jit_may_delay_fetch_this()
3455 && opline->opcode != ZEND_ASSIGN_OBJ_OP in zend_jit_may_delay_fetch_this()
3456 && opline->opcode != ZEND_PRE_INC_OBJ in zend_jit_may_delay_fetch_this()
3457 && opline->opcode != ZEND_PRE_DEC_OBJ in zend_jit_may_delay_fetch_this()
3458 && opline->opcode != ZEND_POST_INC_OBJ in zend_jit_may_delay_fetch_this()
3459 && opline->opcode != ZEND_POST_DEC_OBJ) { in zend_jit_may_delay_fetch_this()
3463 if (opline->op2_type != IS_CONST in zend_jit_may_delay_fetch_this()
3464 || Z_TYPE_P(RT_CONSTANT(opline, opline->op2)) != IS_STRING in zend_jit_may_delay_fetch_this()
3465 || Z_STRVAL_P(RT_CONSTANT(opline, opline->op2))[0] == '\0') { in zend_jit_may_delay_fetch_this()
3469 if (opline->opcode == ZEND_ASSIGN_OBJ_OP) { in zend_jit_may_delay_fetch_this()
3470 if (opline->op1_type == IS_CV in zend_jit_may_delay_fetch_this()
3471 && (opline+1)->op1_type == IS_CV in zend_jit_may_delay_fetch_this()
3472 && (opline+1)->op1.var == opline->op1.var) { in zend_jit_may_delay_fetch_this()
3477 opline->extended_value, MAY_BE_ANY, OP1_DATA_INFO())) { in zend_jit_may_delay_fetch_this()
3510 const zend_op *opline = zend_jit_traces[trace_num].exit_info[exit_num].opline; in zend_jit_trace_exit_needs_deoptimization() local
3515 …if (opline || (flags & (ZEND_JIT_EXIT_RESTORE_CALL|ZEND_JIT_EXIT_FREE_OP1|ZEND_JIT_EXIT_FREE_OP2))… in zend_jit_trace_exit_needs_deoptimization()
3527 const zend_op *opline, in zend_jit_trace_deoptimization() argument
3645 if (!zend_jit_escape_if_undef(jit, check2, flags, opline, reg)) { in zend_jit_trace_deoptimization()
3660 const zend_op *op = opline - 1; in zend_jit_trace_deoptimization()
3668 const zend_op *op = opline - 1; in zend_jit_trace_deoptimization()
3697 static void zend_jit_trace_update_condition_ranges(const zend_op *opline, const zend_ssa_op *ssa_op… in zend_jit_trace_update_condition_ranges() argument
3711 switch (opline->opcode) { in zend_jit_trace_update_condition_ranges()
3815 static bool zend_jit_may_skip_comparison(const zend_op *opline, const zend_ssa_op *ssa_op, const ze… in zend_jit_may_skip_comparison() argument
3819 if (opline->op1_type == IS_CONST in zend_jit_may_skip_comparison()
3820 && Z_TYPE_P(RT_CONSTANT(opline, opline->op1)) == IS_LONG in zend_jit_may_skip_comparison()
3821 && Z_LVAL_P(RT_CONSTANT(opline, opline->op1)) == 0) { in zend_jit_may_skip_comparison()
3825 opline = ssa_opcodes[ssa_op - ssa->ops]; in zend_jit_may_skip_comparison()
3826 prev_opcode = opline->opcode; in zend_jit_may_skip_comparison()
3835 opline = ssa_opcodes[ssa_op - ssa->ops]; in zend_jit_may_skip_comparison()
3836 prev_opcode = opline->opcode; in zend_jit_may_skip_comparison()
3844 } else if (opline->op2_type == IS_CONST in zend_jit_may_skip_comparison()
3845 && Z_TYPE_P(RT_CONSTANT(opline, opline->op2)) == IS_LONG in zend_jit_may_skip_comparison()
3846 && Z_LVAL_P(RT_CONSTANT(opline, opline->op2)) == 0) { in zend_jit_may_skip_comparison()
3850 opline = ssa_opcodes[ssa_op - ssa->ops]; in zend_jit_may_skip_comparison()
3851 prev_opcode = opline->opcode; in zend_jit_may_skip_comparison()
3860 opline = ssa_opcodes[ssa_op - ssa->ops]; in zend_jit_may_skip_comparison()
3861 prev_opcode = opline->opcode; in zend_jit_may_skip_comparison()
3892 …if (RT_CONSTANT(opline, opline->op1) != RT_CONSTANT(&ssa_opcodes[prev_ssa_op - ssa->ops], ssa_opco… in zend_jit_may_skip_comparison()
3897 …if (RT_CONSTANT(opline, opline->op2) != RT_CONSTANT(&ssa_opcodes[prev_ssa_op - ssa->ops], ssa_opco… in zend_jit_may_skip_comparison()
3908 static bool zend_jit_trace_next_is_send_result(const zend_op *opline, in zend_jit_trace_next_is_send_result() argument
3912 if (opline->result_type == IS_TMP_VAR in zend_jit_trace_next_is_send_result()
3914 && (p+1)->opline == opline + 1 in zend_jit_trace_next_is_send_result()
3915 && ((opline+1)->opcode == ZEND_SEND_VAL in zend_jit_trace_next_is_send_result()
3916 || ((opline+1)->opcode == ZEND_SEND_VAL_EX in zend_jit_trace_next_is_send_result()
3920 && !ARG_MUST_BE_SENT_BY_REF(frame->call->func, (opline+1)->op2.num))) in zend_jit_trace_next_is_send_result()
3921 && (opline+1)->op1_type == IS_TMP_VAR in zend_jit_trace_next_is_send_result()
3922 && (opline+1)->op2_type != IS_CONST /* Named parameters not supported in JIT */ in zend_jit_trace_next_is_send_result()
3923 && (opline+1)->op1.var == opline->result.var) { in zend_jit_trace_next_is_send_result()
3929 zend_jit_trace_send_type(opline+1, frame->call, res_type); in zend_jit_trace_next_is_send_result()
4057 static bool zend_jit_trace_may_throw(const zend_op *opline, in zend_jit_trace_may_throw() argument
4066 switch (opline->opcode) { in zend_jit_trace_may_throw()
4068 if (opline->extended_value != ZEND_CONCAT in zend_jit_trace_may_throw()
4081 return zend_may_throw_ex(opline, ssa_op, op_array, ssa, t1, t2); in zend_jit_trace_may_throw()
4119 const zend_op *opline, *orig_opline; in zend_jit_trace() local
4138 opline = trace_buffer[1].opline; in zend_jit_trace()
4139 name = zend_jit_trace_name(op_array, opline->lineno); in zend_jit_trace()
4162 opline = p[1].opline; in zend_jit_trace()
4170 zend_jit_set_last_valid_opline(&ctx, opline); in zend_jit_trace()
4173 if (zend_jit_traces[parent_trace].exit_info[exit_num].opline == NULL) { in zend_jit_trace()
4174 zend_jit_trace_opline_guard(&ctx, opline); in zend_jit_trace()
4188 if (!zend_jit_stack_check(&ctx, opline, used_stack)) { in zend_jit_trace()
4236 && EX_VAR_TO_NUM((opline-1)->result.var) == i)) in zend_jit_trace()
4241 if (!zend_jit_type_guard(&ctx, opline, EX_NUM_TO_VAR(i), concrete_type(info))) { in zend_jit_trace()
4262 if (!zend_jit_packed_guard(&ctx, opline, EX_NUM_TO_VAR(i), info)) { in zend_jit_trace()
4274 zend_jit_traces[parent_trace].exit_info[exit_num].opline, in zend_jit_trace()
4297 if (!zend_jit_type_guard(&ctx, opline, EX_NUM_TO_VAR(i), op_type)) { in zend_jit_trace()
4342 if (!zend_jit_type_guard(&ctx, opline, EX_NUM_TO_VAR(phi->var), concrete_type(info))) { in zend_jit_trace()
4396 opline = p->opline; in zend_jit_trace()
4425 switch (opline->opcode) { in zend_jit_trace()
4439 switch (opline->opcode) { in zend_jit_trace()
4444 if (opline->op1_type != IS_CV) { in zend_jit_trace()
4452 if (opline->result_type != IS_UNUSED) { in zend_jit_trace()
4454 STACK_MEM_TYPE(stack, EX_VAR_TO_NUM(opline->result.var))); in zend_jit_trace()
4455 if (opline->result_type == IS_CV) { in zend_jit_trace()
4470 if (!zend_jit_inc_dec(&ctx, opline, in zend_jit_trace()
4475 … (op1_def_info & (MAY_BE_DOUBLE|MAY_BE_GUARD)) && zend_may_overflow(opline, ssa_op, op_array, ssa), in zend_jit_trace()
4476 zend_may_throw(opline, ssa_op, op_array, ssa))) { in zend_jit_trace()
4482 if (opline->result_type != IS_UNUSED) { in zend_jit_trace()
4488 if (opline->result_type != IS_UNUSED) { in zend_jit_trace()
4492 if (opline->result_type != IS_UNUSED in zend_jit_trace()
4496 } else if (opline->result_type != IS_UNUSED in zend_jit_trace()
4518 && zend_jit_trace_next_is_send_result(opline, p, frame)) { in zend_jit_trace()
4521 res_addr = ZEND_ADDR_MEM_ZVAL(ZREG_RX, (opline+1)->result.var); in zend_jit_trace()
4527 STACK_MEM_TYPE(stack, EX_VAR_TO_NUM(opline->result.var))); in zend_jit_trace()
4528 if (opline->result_type == IS_CV) { in zend_jit_trace()
4533 if (!zend_jit_long_math(&ctx, opline, in zend_jit_trace()
4537 zend_may_throw(opline, ssa_op, op_array, ssa))) { in zend_jit_trace()
4552 if (opline->opcode == ZEND_ADD && in zend_jit_trace()
4562 && opline->op1_type == IS_CV in zend_jit_trace()
4564 if (!zend_jit_fetch_reference(&ctx, opline, orig_op1_type, &op1_info, &op1_addr, in zend_jit_trace()
4576 && opline->op2_type == IS_CV in zend_jit_trace()
4578 if (!zend_jit_fetch_reference(&ctx, opline, orig_op2_type, &op2_info, &op2_addr, in zend_jit_trace()
4590 && zend_jit_trace_next_is_send_result(opline, p, frame)) { in zend_jit_trace()
4593 res_addr = ZEND_ADDR_MEM_ZVAL(ZREG_RX, (opline+1)->result.var); in zend_jit_trace()
4599 STACK_MEM_TYPE(stack, EX_VAR_TO_NUM(opline->result.var))); in zend_jit_trace()
4600 if (opline->result_type == IS_CV) { in zend_jit_trace()
4605 if (opline->opcode == ZEND_ADD && in zend_jit_trace()
4608 if (!zend_jit_add_arrays(&ctx, opline, op1_info, op1_addr, op2_info, op2_addr, res_addr)) { in zend_jit_trace()
4612 …_LONG) && (res_info & (MAY_BE_DOUBLE|MAY_BE_GUARD)) && zend_may_overflow(opline, ssa_op, op_array,… in zend_jit_trace()
4618 && ((opline->opcode == ZEND_ADD in zend_jit_trace()
4620 || (opline->opcode == ZEND_SUB in zend_jit_trace()
4622 zend_jit_trace_cleanup_stack(&ctx, stack, opline, ssa_op, ssa, ssa_opcodes); in zend_jit_trace()
4624 if (!zend_jit_math(&ctx, opline, in zend_jit_trace()
4629 zend_may_throw(opline, ssa_op, op_array, ssa))) { in zend_jit_trace()
4656 if (zend_jit_trace_next_is_send_result(opline, p, frame)) { in zend_jit_trace()
4658 res_addr = ZEND_ADDR_MEM_ZVAL(ZREG_RX, (opline+1)->result.var); in zend_jit_trace()
4663 if (!zend_jit_concat(&ctx, opline, in zend_jit_trace()
4665 zend_may_throw(opline, ssa_op, op_array, ssa))) { in zend_jit_trace()
4670 if (opline->op1_type != IS_CV || opline->result_type != IS_UNUSED) { in zend_jit_trace()
4678 opline->extended_value, op1_info, op2_info)) { in zend_jit_trace()
4688 STACK_MEM_TYPE(stack, EX_VAR_TO_NUM(opline->op1.var))); in zend_jit_trace()
4695 if (!zend_jit_assign_op(&ctx, opline, in zend_jit_trace()
4699 …G) && (op1_def_info & (MAY_BE_DOUBLE|MAY_BE_GUARD)) && zend_may_overflow(opline, ssa_op, op_array,… in zend_jit_trace()
4700 zend_may_throw(opline, ssa_op, op_array, ssa))) { in zend_jit_trace()
4707 if (opline->result_type != IS_UNUSED) { in zend_jit_trace()
4713 if (opline->result_type != IS_UNUSED) { in zend_jit_trace()
4717 opline->extended_value, MAY_BE_ANY, OP1_DATA_INFO())) { in zend_jit_trace()
4720 if (opline->op1_type == IS_CV in zend_jit_trace()
4721 && (opline+1)->op1_type == IS_CV in zend_jit_trace()
4722 && (opline+1)->op1.var == opline->op1.var) { in zend_jit_trace()
4729 if (opline->op1_type == IS_VAR) { in zend_jit_trace()
4733 if (!zend_jit_fetch_indirect_var(&ctx, opline, orig_op1_type, in zend_jit_trace()
4741 if (!zend_jit_fetch_reference(&ctx, opline, orig_op1_type, &op1_info, &op1_addr, in zend_jit_trace()
4745 if (opline->op1_type == IS_CV in zend_jit_trace()
4757 if (!zend_jit_assign_dim_op(&ctx, opline, in zend_jit_trace()
4759 op2_info, (opline->op2_type != IS_UNUSED) ? OP2_REG_ADDR() : 0, in zend_jit_trace()
4760 (opline->op2_type != IS_UNUSED) ? OP2_RANGE() : NULL, in zend_jit_trace()
4762 zend_jit_trace_may_throw(opline, ssa_op, op_array, ssa, in zend_jit_trace()
4766 if (opline->op1_type == IS_VAR && !(op1_info & (MAY_BE_ANY-MAY_BE_NULL))) { in zend_jit_trace()
4767 SET_STACK_TYPE(stack, EX_VAR_TO_NUM(opline->op1.var), IS_ARRAY, 1); in zend_jit_trace()
4774 if (opline->op2_type != IS_CONST in zend_jit_trace()
4775 || Z_TYPE_P(RT_CONSTANT(opline, opline->op2)) != IS_STRING in zend_jit_trace()
4776 || Z_STRVAL_P(RT_CONSTANT(opline, opline->op2))[0] == '\0') { in zend_jit_trace()
4783 if (opline->op1_type == IS_UNUSED) { in zend_jit_trace()
4801 if (opline->op1_type == IS_VAR) { in zend_jit_trace()
4805 if (!zend_jit_fetch_indirect_var(&ctx, opline, orig_op1_type, in zend_jit_trace()
4813 if (!zend_jit_fetch_reference(&ctx, opline, orig_op1_type, &op1_info, &op1_addr, in zend_jit_trace()
4817 if (opline->op1_type == IS_CV in zend_jit_trace()
4842 && op_array_ssa->ops[opline-op_array->opcodes].op1_use >= 0 in zend_jit_trace()
4843 … && op_array_ssa->vars[op_array_ssa->ops[opline-op_array->opcodes].op1_use].definition >= 0) { in zend_jit_trace()
4844 …on_this = op_array->opcodes[op_array_ssa->vars[op_array_ssa->ops[opline-op_array->opcodes].op1_use… in zend_jit_trace()
4847 if (!zend_jit_incdec_obj(&ctx, opline, op_array, ssa, ssa_op, in zend_jit_trace()
4855 if (opline->result_type != IS_UNUSED) { in zend_jit_trace()
4858 if (opline->op2_type != IS_CONST in zend_jit_trace()
4859 || Z_TYPE_P(RT_CONSTANT(opline, opline->op2)) != IS_STRING in zend_jit_trace()
4860 || Z_STRVAL_P(RT_CONSTANT(opline, opline->op2))[0] == '\0') { in zend_jit_trace()
4863 if (opline->op1_type == IS_CV in zend_jit_trace()
4864 && (opline+1)->op1_type == IS_CV in zend_jit_trace()
4865 && (opline+1)->op1.var == opline->op1.var) { in zend_jit_trace()
4870 opline->extended_value, MAY_BE_ANY, OP1_DATA_INFO())) { in zend_jit_trace()
4877 if (opline->op1_type == IS_UNUSED) { in zend_jit_trace()
4895 if (opline->op1_type == IS_VAR) { in zend_jit_trace()
4899 if (!zend_jit_fetch_indirect_var(&ctx, opline, orig_op1_type, in zend_jit_trace()
4907 if (!zend_jit_fetch_reference(&ctx, opline, orig_op1_type, &op1_info, &op1_addr, in zend_jit_trace()
4911 if (opline->op1_type == IS_CV in zend_jit_trace()
4936 && op_array_ssa->ops[opline-op_array->opcodes].op1_use >= 0 in zend_jit_trace()
4937 … && op_array_ssa->vars[op_array_ssa->ops[opline-op_array->opcodes].op1_use].definition >= 0) { in zend_jit_trace()
4938 …on_this = op_array->opcodes[op_array_ssa->vars[op_array_ssa->ops[opline-op_array->opcodes].op1_use… in zend_jit_trace()
4943 if (!zend_jit_assign_obj_op(&ctx, opline, op_array, ssa, ssa_op, in zend_jit_trace()
4951 if (opline->op2_type != IS_CONST in zend_jit_trace()
4952 || Z_TYPE_P(RT_CONSTANT(opline, opline->op2)) != IS_STRING in zend_jit_trace()
4953 || Z_STRVAL_P(RT_CONSTANT(opline, opline->op2))[0] == '\0') { in zend_jit_trace()
4960 if (opline->op1_type == IS_UNUSED) { in zend_jit_trace()
4978 if (opline->op1_type == IS_VAR) { in zend_jit_trace()
4982 if (!zend_jit_fetch_indirect_var(&ctx, opline, orig_op1_type, in zend_jit_trace()
4990 if (!zend_jit_fetch_reference(&ctx, opline, orig_op1_type, &op1_info, &op1_addr, in zend_jit_trace()
4994 if (opline->op1_type == IS_CV in zend_jit_trace()
5019 && op_array_ssa->ops[opline-op_array->opcodes].op1_use >= 0 in zend_jit_trace()
5020 … && op_array_ssa->vars[op_array_ssa->ops[opline-op_array->opcodes].op1_use].definition >= 0) { in zend_jit_trace()
5021 …on_this = op_array->opcodes[op_array_ssa->vars[op_array_ssa->ops[opline-op_array->opcodes].op1_use… in zend_jit_trace()
5026 if (!zend_jit_assign_obj(&ctx, opline, op_array, ssa, ssa_op, in zend_jit_trace()
5028 (opline->result_type != IS_UNUSED) ? RES_REG_ADDR() : 0, in zend_jit_trace()
5031 zend_may_throw(opline, ssa_op, op_array, ssa))) { in zend_jit_trace()
5034 if ((opline+1)->op1_type == IS_CV in zend_jit_trace()
5044 if (opline->op1_type == IS_CV in zend_jit_trace()
5045 && (opline+1)->op1_type == IS_CV in zend_jit_trace()
5046 && (opline+1)->op1.var == opline->op1.var) { in zend_jit_trace()
5050 if (opline->op1_type == IS_VAR) { in zend_jit_trace()
5054 if (!zend_jit_fetch_indirect_var(&ctx, opline, orig_op1_type, in zend_jit_trace()
5062 if (!zend_jit_fetch_reference(&ctx, opline, orig_op1_type, &op1_info, &op1_addr, in zend_jit_trace()
5066 if (opline->op1_type == IS_CV in zend_jit_trace()
5077 if (!zend_jit_assign_dim(&ctx, opline, in zend_jit_trace()
5079 op2_info, (opline->op2_type != IS_UNUSED) ? OP2_REG_ADDR() : 0, in zend_jit_trace()
5080 (opline->op2_type != IS_UNUSED) ? OP2_RANGE() : NULL, in zend_jit_trace()
5083 (opline->result_type != IS_UNUSED) ? RES_REG_ADDR() : 0, in zend_jit_trace()
5085 zend_may_throw_ex(opline, ssa_op, op_array, ssa, op1_info, op2_info))) { in zend_jit_trace()
5088 if ((opline+1)->op1_type == IS_CV in zend_jit_trace()
5093 if (opline->op1_type == IS_VAR && !(op1_info & (MAY_BE_ANY-MAY_BE_NULL))) { in zend_jit_trace()
5094 SET_STACK_TYPE(stack, EX_VAR_TO_NUM(opline->op1.var), IS_ARRAY, 1); in zend_jit_trace()
5098 if (opline->op1_type != IS_CV) { in zend_jit_trace()
5116 if (!zend_jit_scalar_type_guard(&ctx, opline, opline->op1.var)) { in zend_jit_trace()
5127 STACK_TYPE(stack, EX_VAR_TO_NUM(opline->op1.var)) != in zend_jit_trace()
5128 STACK_MEM_TYPE(stack, EX_VAR_TO_NUM(opline->op1.var))) { in zend_jit_trace()
5134 if (!zend_jit_guard_reference(&ctx, opline, &op1_addr, &ref_addr, in zend_jit_trace()
5139 if (opline->op1_type == IS_CV in zend_jit_trace()
5143 if (opline->result_type == IS_UNUSED) { in zend_jit_trace()
5148 && zend_jit_trace_next_is_send_result(opline, p, frame)) { in zend_jit_trace()
5150 res_addr = ZEND_ADDR_MEM_ZVAL(ZREG_RX, (opline+1)->result.var); in zend_jit_trace()
5159 if (!zend_jit_noref_guard(&ctx, opline, op1_addr)) { in zend_jit_trace()
5166 if (opline->result_type == IS_UNUSED) { in zend_jit_trace()
5173 && zend_jit_trace_next_is_send_result(opline, p, frame)) { in zend_jit_trace()
5175 res_addr = ZEND_ADDR_MEM_ZVAL(ZREG_RX, (opline+1)->result.var); in zend_jit_trace()
5181 if (!zend_jit_assign(&ctx, opline, in zend_jit_trace()
5187 zend_may_throw_ex(opline, ssa_op, op_array, ssa, op1_info, op2_info))) { in zend_jit_trace()
5194 uint32_t var_num = EX_VAR_TO_NUM(opline->op2.var); in zend_jit_trace()
5205 if (opline->op2_type == IS_CV in zend_jit_trace()
5212 if (opline->extended_value != op1_type) { in zend_jit_trace()
5227 STACK_MEM_TYPE(stack, EX_VAR_TO_NUM(opline->result.var))); in zend_jit_trace()
5228 if (opline->result_type == IS_CV) { in zend_jit_trace()
5233 STACK_TYPE(stack, EX_VAR_TO_NUM(opline->result.var)) != in zend_jit_trace()
5234 STACK_MEM_TYPE(stack, EX_VAR_TO_NUM(opline->result.var))) { in zend_jit_trace()
5238 if (!zend_jit_qm_assign(&ctx, opline, in zend_jit_trace()
5247 uint32_t var_num = EX_VAR_TO_NUM(opline->op1.var); in zend_jit_trace()
5258 if (opline->op1_type == IS_CV in zend_jit_trace()
5268 …if (!zend_jit_init_fcall(&ctx, opline, op_array_ssa->cfg.map ? op_array_ssa->cfg.map[opline - op_a… in zend_jit_trace()
5274 if (opline->op2_type == IS_CONST) { in zend_jit_trace()
5278 if (opline->opcode == ZEND_SEND_VAL_EX in zend_jit_trace()
5279 && opline->op2.num > MAX_ARG_FLAG_NUM) { in zend_jit_trace()
5284 if (!zend_jit_send_val(&ctx, opline, in zend_jit_trace()
5289 if (opline->op1_type == IS_CONST) { in zend_jit_trace()
5290 zend_jit_trace_send_type(opline, frame->call, Z_TYPE_P(RT_CONSTANT(opline, opline->op1))); in zend_jit_trace()
5295 zend_jit_trace_send_type(opline, frame->call, op1_type); in zend_jit_trace()
5300 if (opline->op2_type == IS_CONST) { in zend_jit_trace()
5305 if (!zend_jit_send_ref(&ctx, opline, op_array, in zend_jit_trace()
5309 if (opline->op1_type == IS_CV in zend_jit_trace()
5319 if (opline->op2_type == IS_CONST) { in zend_jit_trace()
5323 if ((opline->opcode == ZEND_SEND_VAR_EX in zend_jit_trace()
5324 || opline->opcode == ZEND_SEND_VAR_NO_REF_EX) in zend_jit_trace()
5325 && opline->op2.num > MAX_ARG_FLAG_NUM) { in zend_jit_trace()
5336 if (!zend_jit_send_var(&ctx, opline, op_array, in zend_jit_trace()
5344 uint32_t var_num = EX_VAR_TO_NUM(opline->op1.var); in zend_jit_trace()
5355 if (opline->op1_type == IS_CV in zend_jit_trace()
5361 if ((opline->opcode == ZEND_SEND_VAR_EX in zend_jit_trace()
5362 || opline->opcode == ZEND_SEND_FUNC_ARG) in zend_jit_trace()
5363 && ARG_SHOULD_BE_SENT_BY_REF(frame->call->func, opline->op2.num)) { in zend_jit_trace()
5370 zend_jit_trace_send_type(opline, frame->call, op1_type); in zend_jit_trace()
5380 if (opline->op2_type == IS_CONST in zend_jit_trace()
5381 || opline->op2.num > MAX_ARG_FLAG_NUM) { in zend_jit_trace()
5386 if (!zend_jit_check_func_arg(&ctx, opline)) { in zend_jit_trace()
5395 if (!zend_jit_check_undef_args(&ctx, opline)) { in zend_jit_trace()
5403 if (!zend_jit_do_fcall(&ctx, opline, op_array, op_array_ssa, frame->call_level, -1, p + 1)) { in zend_jit_trace()
5418 zend_jit_may_skip_comparison(opline, ssa_op, ssa, ssa_opcodes, op_array); in zend_jit_trace()
5421 if ((opline->result_type & (IS_SMART_BRANCH_JMPZ|IS_SMART_BRANCH_JMPNZ)) != 0) { in zend_jit_trace()
5423 … const zend_op *exit_opline = zend_jit_trace_get_exit_opline(p + 1, opline + 1, &exit_if_true); in zend_jit_trace()
5427 zend_jit_trace_cleanup_stack(&ctx, stack, opline, ssa_op, ssa, ssa_opcodes); in zend_jit_trace()
5435 if (!zend_jit_cmp(&ctx, opline, in zend_jit_trace()
5439 zend_may_throw(opline, ssa_op, op_array, ssa), in zend_jit_trace()
5443 zend_jit_trace_update_condition_ranges(opline, ssa_op, op_array, ssa, exit_if_true); in zend_jit_trace()
5447 if (!zend_jit_cmp(&ctx, opline, in zend_jit_trace()
5451 zend_may_throw(opline, ssa_op, op_array, ssa), in zend_jit_trace()
5466 zend_jit_may_skip_comparison(opline, ssa_op, ssa, ssa_opcodes, op_array); in zend_jit_trace()
5469 if ((opline->result_type & (IS_SMART_BRANCH_JMPZ|IS_SMART_BRANCH_JMPNZ)) != 0) { in zend_jit_trace()
5471 … const zend_op *exit_opline = zend_jit_trace_get_exit_opline(p + 1, opline + 1, &exit_if_true); in zend_jit_trace()
5475 zend_jit_trace_cleanup_stack(&ctx, stack, opline, ssa_op, ssa, ssa_opcodes); in zend_jit_trace()
5482 if (opline->opcode == ZEND_IS_NOT_IDENTICAL) { in zend_jit_trace()
5486 if (!zend_jit_identical(&ctx, opline, in zend_jit_trace()
5490 zend_may_throw(opline, ssa_op, op_array, ssa), in zend_jit_trace()
5494 zend_jit_trace_update_condition_ranges(opline, ssa_op, op_array, ssa, exit_if_true); in zend_jit_trace()
5498 if (!zend_jit_identical(&ctx, opline, in zend_jit_trace()
5502 zend_may_throw(opline, ssa_op, op_array, ssa), in zend_jit_trace()
5509 if ((opline->result_type & (IS_SMART_BRANCH_JMPZ|IS_SMART_BRANCH_JMPNZ)) != 0) { in zend_jit_trace()
5511 … const zend_op *exit_opline = zend_jit_trace_get_exit_opline(p + 1, opline + 1, &exit_if_true); in zend_jit_trace()
5523 if (!zend_jit_defined(&ctx, opline, smart_branch_opcode, -1, -1, exit_addr)) { in zend_jit_trace()
5528 if (opline->extended_value == MAY_BE_RESOURCE) { in zend_jit_trace()
5534 if ((opline->result_type & (IS_SMART_BRANCH_JMPZ|IS_SMART_BRANCH_JMPNZ)) != 0) { in zend_jit_trace()
5536 … const zend_op *exit_opline = zend_jit_trace_get_exit_opline(p + 1, opline + 1, &exit_if_true); in zend_jit_trace()
5540 zend_jit_trace_cleanup_stack(&ctx, stack, opline, ssa_op, ssa, ssa_opcodes); in zend_jit_trace()
5552 if (!zend_jit_type_check(&ctx, opline, op1_info, smart_branch_opcode, -1, -1, exit_addr)) { in zend_jit_trace()
5559 if (opline->op1_type == IS_CONST) { in zend_jit_trace()
5560 res_type = Z_TYPE_P(RT_CONSTANT(opline, opline->op1)); in zend_jit_trace()
5572 …if (!zend_jit_trace_handler(&ctx, op_array, opline, zend_may_throw(opline, ssa_op, op_array, ssa),… in zend_jit_trace()
5580 if (!zend_jit_return(&ctx, opline, op_array, in zend_jit_trace()
5599 if (opline->op1_type == IS_CV in zend_jit_trace()
5600 && EX_VAR_TO_NUM(opline->op1.var) == j in zend_jit_trace()
5627 if (!zend_jit_leave_func(&ctx, op_array, opline, op1_info, left_frame, in zend_jit_trace()
5638 if (!zend_jit_bool_jmpznz(&ctx, opline, in zend_jit_trace()
5641 zend_may_throw(opline, ssa_op, op_array, ssa), in zend_jit_trace()
5642 opline->opcode, NULL)) { in zend_jit_trace()
5656 if ((p+1)->opline == OP_JMP_ADDR(opline, opline->op2)) { in zend_jit_trace()
5658 if (opline->opcode == ZEND_JMPNZ_EX) { in zend_jit_trace()
5660 } else if (opline->opcode == ZEND_JMPZ_EX) { in zend_jit_trace()
5662 } else if (opline->opcode == ZEND_JMPNZ) { in zend_jit_trace()
5667 exit_opline = opline + 1; in zend_jit_trace()
5668 } else if ((p+1)->opline == opline + 1) { in zend_jit_trace()
5670 smart_branch_opcode = opline->opcode; in zend_jit_trace()
5671 exit_opline = OP_JMP_ADDR(opline, opline->op2); in zend_jit_trace()
5676 zend_jit_trace_cleanup_stack(&ctx, stack, opline, ssa_op, ssa, ssa_opcodes); in zend_jit_trace()
5683 } else if (opline->result_type == IS_TMP_VAR) { in zend_jit_trace()
5684 uint32_t old_info = STACK_INFO(stack, EX_VAR_TO_NUM(opline->result.var)); in zend_jit_trace()
5686 SET_STACK_TYPE(stack, EX_VAR_TO_NUM(opline->result.var), IS_UNKNOWN, 1); in zend_jit_trace()
5688 SET_STACK_INFO(stack, EX_VAR_TO_NUM(opline->result.var), old_info); in zend_jit_trace()
5703 if (opline->result_type == IS_UNDEF) { in zend_jit_trace()
5708 if (!zend_jit_bool_jmpznz(&ctx, opline, in zend_jit_trace()
5711 zend_may_throw(opline, ssa_op, op_array, ssa), in zend_jit_trace()
5723 if ((p+1)->opline == OP_JMP_ADDR(opline, opline->op2)) { in zend_jit_trace()
5726 exit_opline = opline + 1; in zend_jit_trace()
5727 } else if ((p+1)->opline == opline + 1) { in zend_jit_trace()
5730 exit_opline = OP_JMP_ADDR(opline, opline->op2); in zend_jit_trace()
5739 if (!zend_jit_jmp_frameless(&ctx, opline, exit_addr, guard)) { in zend_jit_trace()
5744 if ((opline->extended_value & ZEND_ISEMPTY)) { in zend_jit_trace()
5752 if (!zend_jit_fetch_reference(&ctx, opline, orig_op1_type, &op1_info, &op1_addr, in zend_jit_trace()
5756 if (opline->op1_type == IS_CV in zend_jit_trace()
5763 if ((opline->result_type & (IS_SMART_BRANCH_JMPZ|IS_SMART_BRANCH_JMPNZ)) != 0) { in zend_jit_trace()
5765 … const zend_op *exit_opline = zend_jit_trace_get_exit_opline(p + 1, opline + 1, &exit_if_true); in zend_jit_trace()
5777 if (!zend_jit_isset_isempty_cv(&ctx, opline, in zend_jit_trace()
5784 if (opline->op1_type == IS_VAR || opline->op1_type == IS_TMP_VAR) { in zend_jit_trace()
5793 if ((opline->result_type & (IS_SMART_BRANCH_JMPZ|IS_SMART_BRANCH_JMPNZ)) != 0) { in zend_jit_trace()
5795 … const zend_op *exit_opline = zend_jit_trace_get_exit_opline(p + 1, opline + 1, &exit_if_true); in zend_jit_trace()
5807 if (!zend_jit_in_array(&ctx, opline, in zend_jit_trace()
5828 if (!zend_jit_fetch_reference(&ctx, opline, orig_op1_type, &op1_info, &op1_addr, in zend_jit_trace()
5832 if (opline->op1_type == IS_CV in zend_jit_trace()
5868 if (!zend_jit_fetch_dim_read(&ctx, opline, ssa, ssa_op, in zend_jit_trace()
5882 if (opline->op1_type != IS_CV in zend_jit_trace()
5889 if (opline->op1_type == IS_VAR) { in zend_jit_trace()
5892 if (!zend_jit_fetch_indirect_var(&ctx, opline, orig_op1_type, in zend_jit_trace()
5902 if (!zend_jit_fetch_reference(&ctx, opline, orig_op1_type, &op1_info, &op1_addr, in zend_jit_trace()
5906 if (opline->op1_type == IS_CV in zend_jit_trace()
5916 if (!zend_jit_fetch_dim(&ctx, opline, in zend_jit_trace()
5918 op2_info, (opline->op2_type != IS_UNUSED) ? OP2_REG_ADDR() : 0, in zend_jit_trace()
5919 (opline->op2_type != IS_UNUSED) ? OP2_RANGE() : NULL, in zend_jit_trace()
5924 && (opline->opcode == ZEND_FETCH_DIM_W || opline->opcode == ZEND_FETCH_LIST_W) in zend_jit_trace()
5931 if ((opline->extended_value & ZEND_ISEMPTY)) { in zend_jit_trace()
5939 if (!zend_jit_fetch_reference(&ctx, opline, orig_op1_type, &op1_info, &op1_addr, in zend_jit_trace()
5943 if (opline->op1_type == IS_CV in zend_jit_trace()
5952 if ((opline->result_type & (IS_SMART_BRANCH_JMPZ|IS_SMART_BRANCH_JMPNZ)) != 0) { in zend_jit_trace()
5954 … const zend_op *exit_opline = zend_jit_trace_get_exit_opline(p + 1, opline + 1, &exit_if_true); in zend_jit_trace()
5960 if (opline->op2_type != IS_CONST) { in zend_jit_trace()
5961 old_ref = STACK_REF(stack, EX_VAR_TO_NUM(opline->op2.var)); in zend_jit_trace()
5962 old_flags = STACK_FLAGS(stack, EX_VAR_TO_NUM(opline->op2.var)); in zend_jit_trace()
5964 zend_jit_trace_cleanup_stack(&ctx, stack, opline, ssa_op, ssa, ssa_opcodes); in zend_jit_trace()
5969 uint32_t old_info = STACK_INFO(stack, EX_VAR_TO_NUM(opline->op1.var)); in zend_jit_trace()
5971 SET_STACK_REG(stack, EX_VAR_TO_NUM(opline->op1.var), ZREG_NONE); in zend_jit_trace()
5973 SET_STACK_INFO(stack, EX_VAR_TO_NUM(opline->op1.var), old_info); in zend_jit_trace()
5982 SET_STACK_REF_EX(stack, EX_VAR_TO_NUM(opline->op2.var), old_ref, old_flags); in zend_jit_trace()
6006 if (!zend_jit_isset_isempty_dim(&ctx, opline, in zend_jit_trace()
6009 zend_may_throw_ex(opline, ssa_op, op_array, ssa, op1_info, op2_info), in zend_jit_trace()
6028 if (opline->op2_type != IS_CONST in zend_jit_trace()
6029 || Z_TYPE_P(RT_CONSTANT(opline, opline->op2)) != IS_STRING in zend_jit_trace()
6030 || Z_STRVAL_P(RT_CONSTANT(opline, opline->op2))[0] == '\0') { in zend_jit_trace()
6036 if (opline->op1_type == IS_UNUSED) { in zend_jit_trace()
6051 if (opline->op1_type == IS_VAR in zend_jit_trace()
6052 && opline->opcode == ZEND_FETCH_OBJ_W) { in zend_jit_trace()
6056 if (!zend_jit_fetch_indirect_var(&ctx, opline, orig_op1_type, in zend_jit_trace()
6064 if (!zend_jit_fetch_reference(&ctx, opline, orig_op1_type, &op1_info, &op1_addr, in zend_jit_trace()
6068 if (opline->op1_type == IS_CV in zend_jit_trace()
6097 && op_array_ssa->ops[opline-op_array->opcodes].op1_use >= 0 in zend_jit_trace()
6098 … && op_array_ssa->vars[op_array_ssa->ops[opline-op_array->opcodes].op1_use].definition >= 0) { in zend_jit_trace()
6099 …on_this = op_array->opcodes[op_array_ssa->vars[op_array_ssa->ops[opline-op_array->opcodes].op1_use… in zend_jit_trace()
6102 if (!zend_jit_fetch_obj(&ctx, opline, op_array, ssa, ssa_op, in zend_jit_trace()
6106 zend_may_throw_ex(opline, ssa_op, op_array, ssa, op1_info, MAY_BE_STRING))) { in zend_jit_trace()
6122 if (!(opline->op1_type == IS_CONST in zend_jit_trace()
6123 && (opline->op2_type == IS_CONST in zend_jit_trace()
6124 || (opline->op2_type == IS_UNUSED in zend_jit_trace()
6125 && ((opline->op2.num & ZEND_FETCH_CLASS_MASK) == ZEND_FETCH_CLASS_SELF in zend_jit_trace()
6126 || (opline->op2.num & ZEND_FETCH_CLASS_MASK) == ZEND_FETCH_CLASS_PARENT))))) { in zend_jit_trace()
6129 if (!zend_jit_fetch_static_prop(&ctx, opline, op_array)) { in zend_jit_trace()
6134 orig_opline = opline; in zend_jit_trace()
6145 if (!zend_jit_bind_global(&ctx, opline, op1_info)) { in zend_jit_trace()
6148 if ((opline+1)->opcode == ZEND_BIND_GLOBAL) { in zend_jit_trace()
6149 opline++; in zend_jit_trace()
6155 opline = orig_opline; in zend_jit_trace()
6159 if (!zend_jit_recv(&ctx, opline, op_array)) { in zend_jit_trace()
6164 orig_opline = opline; in zend_jit_trace()
6167 if (!zend_jit_recv_init(&ctx, opline, op_array, in zend_jit_trace()
6168 (opline + 1)->opcode != ZEND_RECV_INIT, in zend_jit_trace()
6169 zend_may_throw(opline, ssa_op, op_array, ssa))) { in zend_jit_trace()
6172 if ((opline+1)->opcode == ZEND_RECV_INIT) { in zend_jit_trace()
6173 opline++; in zend_jit_trace()
6179 opline = orig_opline; in zend_jit_trace()
6185 if (!zend_jit_free(&ctx, opline, op1_info, in zend_jit_trace()
6186 zend_may_throw(opline, ssa_op, op_array, ssa))) { in zend_jit_trace()
6196 if (!zend_jit_echo(&ctx, opline, op1_info)) { in zend_jit_trace()
6204 if (!zend_jit_fetch_reference(&ctx, opline, orig_op1_type, &op1_info, &op1_addr, in zend_jit_trace()
6208 if (opline->op1_type == IS_CV in zend_jit_trace()
6218 if (!zend_jit_strlen(&ctx, opline, op1_info, op1_addr, RES_REG_ADDR())) { in zend_jit_trace()
6226 if (!zend_jit_fetch_reference(&ctx, opline, orig_op1_type, &op1_info, &op1_addr, in zend_jit_trace()
6230 if (opline->op1_type == IS_CV in zend_jit_trace()
6240 …if (!zend_jit_count(&ctx, opline, op1_info, op1_addr, RES_REG_ADDR(), zend_may_throw(opline, ssa_o… in zend_jit_trace()
6246 if (ssa_op->result_def >= 0 && opline->result_type != IS_CV) { in zend_jit_trace()
6252 if (!zend_jit_fetch_this(&ctx, opline, op_array, delayed_fetch_this)) { in zend_jit_trace()
6259 …if (!zend_jit_switch(&ctx, opline, op_array, op_array_ssa, p+1, &zend_jit_traces[ZEND_JIT_TRACE_NU… in zend_jit_trace()
6264 if (opline->op1_type == IS_UNUSED) { in zend_jit_trace()
6268 if (opline->op1_type == IS_CONST) { in zend_jit_trace()
6282 if (!zend_jit_verify_return_type(&ctx, opline, op_array, op1_info)) { in zend_jit_trace()
6292 if (!zend_jit_fe_reset(&ctx, opline, op1_info)) { in zend_jit_trace()
6303 const zend_op *exit_opline = ZEND_OFFSET_TO_OPLINE(opline, opline->extended_value); in zend_jit_trace()
6306 if ((p+1)->opline == exit_opline) { in zend_jit_trace()
6308 exit_opline = opline; in zend_jit_trace()
6310 } else if ((p+1)->opline == opline + 1) { in zend_jit_trace()
6324 if (!zend_jit_fe_fetch(&ctx, opline, op1_info, OP2_INFO(), in zend_jit_trace()
6330 if (!zend_jit_fetch_constant(&ctx, opline, op_array, ssa, ssa_op, RES_REG_ADDR())) { in zend_jit_trace()
6335 if (opline->op2_type != IS_CONST in zend_jit_trace()
6336 || Z_TYPE_P(RT_CONSTANT(opline, opline->op2)) != IS_STRING) { in zend_jit_trace()
6342 if (opline->op1_type == IS_UNUSED) { in zend_jit_trace()
6358 if (!zend_jit_fetch_reference(&ctx, opline, orig_op1_type, &op1_info, &op1_addr, in zend_jit_trace()
6362 if (opline->op1_type == IS_CV in zend_jit_trace()
6387 && op_array_ssa->ops[opline-op_array->opcodes].op1_use >= 0 in zend_jit_trace()
6388 … && op_array_ssa->vars[op_array_ssa->ops[opline-op_array->opcodes].op1_use].definition >= 0) { in zend_jit_trace()
6389 …on_this = op_array->opcodes[op_array_ssa->vars[op_array_ssa->ops[opline-op_array->opcodes].op1_use… in zend_jit_trace()
6393 if (!zend_jit_init_method_call(&ctx, opline, in zend_jit_trace()
6394 op_array_ssa->cfg.map ? op_array_ssa->cfg.map[opline - op_array->opcodes] : -1, in zend_jit_trace()
6405 if (!(opline->op2_type == IS_CONST in zend_jit_trace()
6406 && (opline->op1_type == IS_CONST in zend_jit_trace()
6407 || (opline->op1_type == IS_UNUSED in zend_jit_trace()
6408 && ((opline->op1.num & ZEND_FETCH_CLASS_MASK) == ZEND_FETCH_CLASS_SELF in zend_jit_trace()
6409 || (opline->op1.num & ZEND_FETCH_CLASS_MASK) == ZEND_FETCH_CLASS_PARENT))))) { in zend_jit_trace()
6412 if (!zend_jit_init_static_method_call(&ctx, opline, in zend_jit_trace()
6413 op_array_ssa->cfg.map ? op_array_ssa->cfg.map[opline - op_array->opcodes] : -1, in zend_jit_trace()
6426 …if (!zend_jit_init_closure_call(&ctx, opline, op_array_ssa->cfg.map ? op_array_ssa->cfg.map[opline in zend_jit_trace()
6445 if (!zend_jit_rope(&ctx, opline, op2_info)) { in zend_jit_trace()
6450 jit_frameless_icall0(jit, opline); in zend_jit_trace()
6454 jit_frameless_icall1(jit, opline, op1_info); in zend_jit_trace()
6459 jit_frameless_icall2(jit, opline, op1_info, op2_info); in zend_jit_trace()
6464 jit_frameless_icall3(jit, opline, op1_info, op2_info, OP1_DATA_INFO()); in zend_jit_trace()
6471 if (opline->opcode != ZEND_NOP && opline->opcode != ZEND_JMP) { in zend_jit_trace()
6481 if (!zend_jit_trace_handler(&ctx, op_array, opline, in zend_jit_trace()
6482 zend_may_throw_ex(opline, ssa_op, op_array, ssa, op1_info, op2_info), p + 1)) { in zend_jit_trace()
6486 if (opline->opcode == ZEND_NEW && opline->result_type != IS_UNUSED) { in zend_jit_trace()
6487 SET_STACK_TYPE(stack, EX_VAR_TO_NUM(opline->result.var), IS_OBJECT, 1); in zend_jit_trace()
6489 if (zend_jit_may_be_polymorphic_call(opline) || in zend_jit_trace()
6491 if (!zend_jit_init_fcall_guard(&ctx, 0, (p+1)->func, opline+1)) { in zend_jit_trace()
6500 switch (opline->opcode) { in zend_jit_trace()
6510 zend_jit_trace_cleanup_stack(&ctx, stack, opline, ssa_op, ssa, ssa_opcodes); in zend_jit_trace()
6513 if ((opline->op1_type & (IS_VAR|IS_TMP_VAR)) in zend_jit_trace()
6514 && STACK_FLAGS(stack, EX_VAR_TO_NUM(opline->op1.var)) & (ZREG_ZVAL_ADDREF|ZREG_THIS)) { in zend_jit_trace()
6515 SET_STACK_REG(stack, EX_VAR_TO_NUM(opline->op1.var), ZREG_NONE); in zend_jit_trace()
6518 if (opline->opcode == ZEND_ROPE_INIT) { in zend_jit_trace()
6520 uint32_t var = EX_VAR_TO_NUM(opline->result.var); in zend_jit_trace()
6522 ((opline->extended_value * sizeof(void*)) + (sizeof(zval)-1)) / sizeof(zval); in zend_jit_trace()
6538 if ((opline->result_type & (IS_SMART_BRANCH_JMPZ|IS_SMART_BRANCH_JMPNZ)) != 0 in zend_jit_trace()
6545 } else if (opline->opcode == ZEND_QM_ASSIGN) { in zend_jit_trace()
6546 if (opline->op1_type != IS_CONST) { in zend_jit_trace()
6548 type = STACK_TYPE(stack, EX_VAR_TO_NUM(opline->op1.var)); in zend_jit_trace()
6550 } else if (opline->opcode == ZEND_ASSIGN) { in zend_jit_trace()
6551 if (opline->op2_type != IS_CONST in zend_jit_trace()
6556 type = STACK_TYPE(stack, EX_VAR_TO_NUM(opline->op2.var)); in zend_jit_trace()
6558 } else if (opline->opcode == ZEND_POST_INC in zend_jit_trace()
6559 || opline->opcode == ZEND_POST_DEC) { in zend_jit_trace()
6561 type = STACK_TYPE(stack, EX_VAR_TO_NUM(opline->op1.var)); in zend_jit_trace()
6563 if (opline->opcode == ZEND_JMP_SET in zend_jit_trace()
6564 || opline->opcode == ZEND_COALESCE in zend_jit_trace()
6565 || opline->opcode == ZEND_JMP_NULL) { in zend_jit_trace()
6567 SET_STACK_TYPE(stack, EX_VAR_TO_NUM(opline->result.var), IS_UNKNOWN, 1); in zend_jit_trace()
6568 } else if ((p+1)->opline != (opline + 1)) { in zend_jit_trace()
6569 SET_STACK_TYPE(stack, EX_VAR_TO_NUM(opline->result.var), type, 1); in zend_jit_trace()
6572 SET_STACK_TYPE(stack, EX_VAR_TO_NUM(opline->result.var), type, in zend_jit_trace()
6576 && opline->result.var > op_array->last_var in zend_jit_trace()
6577 && STACK_MEM_TYPE(stack, EX_VAR_TO_NUM(opline->result.var)) != type) { in zend_jit_trace()
6579 uint32_t var_num = opline->result.var; in zend_jit_trace()
6580 uint32_t op_num = opline - op_array->opcodes; in zend_jit_trace()
6584 op_num += zend_jit_trace_op_len(opline); in zend_jit_trace()
6592 const zend_ssa_op *next_ssa_op = ssa_op + zend_jit_trace_op_len(opline); in zend_jit_trace()
6600 op_num = q->opline - op_array->opcodes; in zend_jit_trace()
6604 if (zend_may_throw(q->opline, next_ssa_op, op_array, ssa)) { in zend_jit_trace()
6608 next_ssa_op += zend_jit_trace_op_len(q->opline); in zend_jit_trace()
6625 RESET_STACK_MEM_TYPE(stack, EX_VAR_TO_NUM(opline->result.var)); in zend_jit_trace()
6629 if (opline->opcode == ZEND_FETCH_THIS in zend_jit_trace()
6631 SET_STACK_REG_EX(stack, EX_VAR_TO_NUM(opline->result.var), ZREG_NONE, ZREG_THIS); in zend_jit_trace()
6633 SET_STACK_REG_EX(stack, EX_VAR_TO_NUM(opline->result.var), ZREG_NONE, ZREG_ZVAL_ADDREF); in zend_jit_trace()
6635 SET_STACK_REF_EX(stack, EX_VAR_TO_NUM(opline->result.var), ra[ssa_op->result_def].ref, in zend_jit_trace()
6642 && zend_inference_propagate_range(op_array, ssa, opline, ssa_op, ssa_op->result_def, &tmp)) { in zend_jit_trace()
6651 && ((opline->opcode != ZEND_QM_ASSIGN && opline->opcode != ZEND_CAST) in zend_jit_trace()
6652 || opline->result_type != IS_CV in zend_jit_trace()
6653 || opline->result.var != opline->op1.var)) { in zend_jit_trace()
6659 } else if (opline->opcode == ZEND_ASSIGN) { in zend_jit_trace()
6661 || STACK_TYPE(stack, EX_VAR_TO_NUM(opline->op1.var)) != IS_UNKNOWN) { in zend_jit_trace()
6662 if (opline->op2_type != IS_CONST) { in zend_jit_trace()
6664 type = STACK_TYPE(stack, EX_VAR_TO_NUM(opline->op2.var)); in zend_jit_trace()
6667 } else if (opline->opcode == ZEND_SEND_VAR in zend_jit_trace()
6668 || opline->opcode == ZEND_CAST in zend_jit_trace()
6669 || opline->opcode == ZEND_QM_ASSIGN in zend_jit_trace()
6670 || opline->opcode == ZEND_JMP_SET in zend_jit_trace()
6671 || opline->opcode == ZEND_COALESCE in zend_jit_trace()
6672 || opline->opcode == ZEND_JMP_NULL in zend_jit_trace()
6673 || opline->opcode == ZEND_FE_RESET_R) { in zend_jit_trace()
6675 type = STACK_TYPE(stack, EX_VAR_TO_NUM(opline->op1.var)); in zend_jit_trace()
6677 SET_STACK_TYPE(stack, EX_VAR_TO_NUM(opline->op1.var), type, in zend_jit_trace()
6682 (opline->opcode == ZEND_QM_ASSIGN || in zend_jit_trace()
6683 opline->opcode == ZEND_SEND_VAR || in zend_jit_trace()
6684 opline->opcode == ZEND_SEND_VAR_EX || in zend_jit_trace()
6685 opline->opcode == ZEND_SEND_VAR_NO_REF || in zend_jit_trace()
6686 opline->opcode == ZEND_SEND_VAR_NO_REF_EX || in zend_jit_trace()
6687 opline->opcode == ZEND_SEND_FUNC_ARG))))); in zend_jit_trace()
6694 if (opline->opcode == ZEND_SEND_VAR in zend_jit_trace()
6695 || opline->opcode == ZEND_CAST in zend_jit_trace()
6696 || opline->opcode == ZEND_QM_ASSIGN in zend_jit_trace()
6697 || opline->opcode == ZEND_JMP_SET in zend_jit_trace()
6698 || opline->opcode == ZEND_COALESCE in zend_jit_trace()
6699 || opline->opcode == ZEND_JMP_NULL in zend_jit_trace()
6700 || opline->opcode == ZEND_FE_RESET_R) { in zend_jit_trace()
6706 SET_STACK_REF_EX(stack, EX_VAR_TO_NUM(opline->op1.var), ra[ssa_op->op1_def].ref, flags); in zend_jit_trace()
6710 && zend_inference_propagate_range(op_array, ssa, opline, ssa_op, ssa_op->op1_def, &tmp)) { in zend_jit_trace()
6719 && (opline->opcode != ZEND_ASSIGN in zend_jit_trace()
6720 || opline->op1_type != IS_CV in zend_jit_trace()
6721 || opline->op1.var != opline->op2.var)) { in zend_jit_trace()
6727 } else if (opline->opcode == ZEND_ASSIGN) { in zend_jit_trace()
6729 type = STACK_TYPE(stack, EX_VAR_TO_NUM(opline->op2.var)); in zend_jit_trace()
6731 SET_STACK_TYPE(stack, EX_VAR_TO_NUM(opline->op2.var), type, in zend_jit_trace()
6736 opline->opcode == ZEND_ASSIGN)))); in zend_jit_trace()
6743 if (opline->opcode == ZEND_ASSIGN) { in zend_jit_trace()
6750 SET_STACK_REF_EX(stack, EX_VAR_TO_NUM(opline->op2.var), ra[ssa_op->op2_def].ref, flags); in zend_jit_trace()
6754 && zend_inference_propagate_range(op_array, ssa, opline, ssa_op, ssa_op->op2_def, &tmp)) { in zend_jit_trace()
6763 switch (opline->opcode) { in zend_jit_trace()
6774 opline++; in zend_jit_trace()
6781 } else if ((opline-1)->opcode == ZEND_ASSIGN_DIM in zend_jit_trace()
6782 || (opline-1)->opcode == ZEND_ASSIGN_OBJ in zend_jit_trace()
6783 || (opline-1)->opcode == ZEND_ASSIGN_STATIC_PROP) { in zend_jit_trace()
6785 type = STACK_TYPE(stack, EX_VAR_TO_NUM(opline->op1.var)); in zend_jit_trace()
6787 SET_STACK_TYPE(stack, EX_VAR_TO_NUM(opline->op1.var), type, in zend_jit_trace()
6792 SET_STACK_REF_EX(stack, EX_VAR_TO_NUM(opline->op1.var), ra[ssa_op->op1_def].ref, in zend_jit_trace()
6797 && zend_inference_propagate_range(op_array, ssa, opline, ssa_op, ssa_op->op1_def, &tmp)) { in zend_jit_trace()
6809 opline++; in zend_jit_trace()
6810 while (opline->opcode == ZEND_RECV_INIT) { in zend_jit_trace()
6818 SET_STACK_TYPE(stack, EX_VAR_TO_NUM(opline->result.var), type, in zend_jit_trace()
6821 SET_STACK_REF_EX(stack, EX_VAR_TO_NUM(opline->result.var), ra[ssa_op->result_def].ref, in zend_jit_trace()
6826 opline++; in zend_jit_trace()
6831 opline++; in zend_jit_trace()
6832 while (opline->opcode == ZEND_BIND_GLOBAL) { in zend_jit_trace()
6840 SET_STACK_TYPE(stack, EX_VAR_TO_NUM(opline->op1.var), type, in zend_jit_trace()
6843 SET_STACK_REF_EX(stack, EX_VAR_TO_NUM(opline->op1.var), ra[ssa_op->op1_def].ref, in zend_jit_trace()
6848 opline++; in zend_jit_trace()
6852 ssa_op += zend_jit_trace_op_len(opline); in zend_jit_trace()
6869 if (opline->opcode == ZEND_DO_UCALL in zend_jit_trace()
6870 || opline->opcode == ZEND_DO_FCALL_BY_NAME in zend_jit_trace()
6871 || opline->opcode == ZEND_DO_FCALL) { in zend_jit_trace()
6873 frame->call_opline = opline; in zend_jit_trace()
6876 if (opline > op_array->opcodes) { in zend_jit_trace()
6877 const zend_op *prev_opline = opline - 1; in zend_jit_trace()
6892 && !zend_jit_trace_opline_guard(&ctx, (p+1)->opline)) { in zend_jit_trace()
6934 if (!zend_jit_type_guard(&ctx, opline, EX_NUM_TO_VAR(i), op_type)) { in zend_jit_trace()
6992 opline = NULL; in zend_jit_trace()
6997 const zend_op *opline = (p+1)->opline - 1; in zend_jit_trace() local
6998 if (opline->result_type != IS_UNUSED) { in zend_jit_trace()
6999 SET_STACK_TYPE(stack, EX_VAR_TO_NUM(opline->result.var), res_type, 1); in zend_jit_trace()
7113 if (!opline) { in zend_jit_trace()
7118 opline = q->opline; in zend_jit_trace()
7119 ZEND_ASSERT(opline != NULL); in zend_jit_trace()
7122 ZEND_JIT_TRACE_FAKE_LEVEL(p->info), p->func, opline)) { in zend_jit_trace()
7201 && !zend_jit_set_ip(&ctx, p->opline)) { in zend_jit_trace()
7219 … uint32_t exit_point = zend_jit_trace_get_exit_point(trace_buffer[1].opline, ZEND_JIT_EXIT_TO_VM); in zend_jit_trace()
7236 && opline->opcode != ZEND_DO_UCALL in zend_jit_trace()
7237 && opline->opcode != ZEND_DO_FCALL in zend_jit_trace()
7238 && opline->opcode != ZEND_DO_FCALL_BY_NAME in zend_jit_trace()
7239 && opline->opcode != ZEND_INCLUDE_OR_EVAL) { in zend_jit_trace()
7252 … && zend_jit_trace_must_store_type(op_array, op_array_ssa, opline - op_array->opcodes, i, type)) { in zend_jit_trace()
7264 t->link = zend_jit_find_trace(p->opline->handler); in zend_jit_trace()
7275 && !zend_jit_set_ip(&ctx, p->opline)) { in zend_jit_trace()
7290 … exit_point = zend_jit_trace_get_exit_point(zend_jit_traces[t->link].opline, ZEND_JIT_EXIT_TO_VM); in zend_jit_trace()
7326 opline = p->opline; in zend_jit_trace()
7329 zend_jit_trace_setup_ret_counter(opline, jit_extension->offset); in zend_jit_trace()
7343 if (opline in zend_jit_trace()
7344 && (opline->opcode == ZEND_DO_UCALL in zend_jit_trace()
7345 || opline->opcode == ZEND_DO_FCALL in zend_jit_trace()
7346 || opline->opcode == ZEND_DO_FCALL_BY_NAME in zend_jit_trace()
7347 || opline->opcode == ZEND_YIELD in zend_jit_trace()
7348 || opline->opcode == ZEND_YIELD_FROM in zend_jit_trace()
7349 || opline->opcode == ZEND_INCLUDE_OR_EVAL)) { in zend_jit_trace()
7350 zend_jit_trace_setup_ret_counter(opline, jit_extension->offset); in zend_jit_trace()
7416 const zend_op *opline; in zend_jit_trace_exit_to_vm() local
7442 zend_jit_traces[trace_num].exit_info[exit_num].opline, in zend_jit_trace_exit_to_vm()
7450 opline = zend_jit_traces[trace_num].exit_info[exit_num].opline; in zend_jit_trace_exit_to_vm()
7451 if (opline) { in zend_jit_trace_exit_to_vm()
7452 if (opline == zend_jit_traces[zend_jit_traces[trace_num].root].opline) { in zend_jit_trace_exit_to_vm()
7456 if (ZEND_OP_TRACE_INFO(opline, jit_extension->offset)->orig_handler != opline->handler) { in zend_jit_trace_exit_to_vm()
7461 zend_jit_set_ip_ex(&ctx, opline, original_handler); in zend_jit_trace_exit_to_vm()
7464 zend_jit_trace_return(&ctx, original_handler, opline); in zend_jit_trace_exit_to_vm()
7475 …zend_jit_compile_root_trace(zend_jit_trace_rec *trace_buffer, const zend_op *opline, size_t offset) in zend_jit_compile_root_trace() argument
7487 if ((ZEND_OP_TRACE_INFO(opline, offset)->trace_flags & ZEND_JIT_TRACE_JITED)) { in zend_jit_compile_root_trace()
7514 t->opline = trace_buffer[1].opline; in zend_jit_compile_root_trace()
7585 ((zend_op*)opline)->handler = handler; in zend_jit_compile_root_trace()
7588 ZEND_OP_TRACE_INFO(opline, offset)->trace_flags |= ZEND_JIT_TRACE_JITED; in zend_jit_compile_root_trace()
7717 static void zend_jit_blacklist_root_trace(const zend_op *opline, size_t offset) in zend_jit_blacklist_root_trace() argument
7721 if (!(ZEND_OP_TRACE_INFO(opline, offset)->trace_flags & ZEND_JIT_TRACE_BLACKLISTED)) { in zend_jit_blacklist_root_trace()
7725 ((zend_op*)opline)->handler = in zend_jit_blacklist_root_trace()
7726 ZEND_OP_TRACE_INFO(opline, offset)->orig_handler; in zend_jit_blacklist_root_trace()
7728 ZEND_OP_TRACE_INFO(opline, offset)->trace_flags |= ZEND_JIT_TRACE_BLACKLISTED; in zend_jit_blacklist_root_trace()
7755 static bool zend_jit_trace_is_bad_root(const zend_op *opline, zend_jit_trace_stop stop, size_t offs… in zend_jit_trace_is_bad_root() argument
7764 if (cache_opline[i] == opline) { in zend_jit_trace_is_bad_root()
7770 if (ZEND_OP_TRACE_INFO(opline, offset)->counter) { in zend_jit_trace_is_bad_root()
7771 *ZEND_OP_TRACE_INFO(opline, offset)->counter = in zend_jit_trace_is_bad_root()
7782 cache_opline[i] = opline; in zend_jit_trace_is_bad_root()
7794 const zend_op *opline; in zend_jit_dump_trace() local
7841 opline = p->opline; in zend_jit_dump_trace()
7843 (int)(opline - op_array->opcodes), in zend_jit_dump_trace()
7845 …zend_dump_op(op_array, NULL, opline, ZEND_DUMP_RC_INFERENCE, tssa, (tssa && tssa->ops) ? tssa->ops… in zend_jit_dump_trace()
7908 len = zend_jit_trace_op_len(opline); in zend_jit_dump_trace()
7910 opline++; in zend_jit_dump_trace()
7912 (int)(opline - op_array->opcodes), in zend_jit_dump_trace()
7914 …zend_dump_op(op_array, NULL, opline, ZEND_DUMP_RC_INFERENCE, tssa, (tssa && tssa->ops) ? tssa->ops… in zend_jit_dump_trace()
8006 if (t->exit_info[i].opline) { in zend_jit_dump_exit_info()
8007 fprintf(stderr, " %04d/", (int)(t->exit_info[i].opline - op_array->opcodes)); in zend_jit_dump_exit_info()
8092 int ZEND_FASTCALL zend_jit_trace_hot_root(zend_execute_data *execute_data, const zend_op *opline) in zend_jit_trace_hot_root() argument
8104 ZEND_ASSERT(opline >= EX(func)->op_array.opcodes && in zend_jit_trace_hot_root()
8105 opline < EX(func)->op_array.opcodes + EX(func)->op_array.last); in zend_jit_trace_hot_root()
8109 orig_opline = opline; in zend_jit_trace_hot_root()
8114 EX(opline) = opline; in zend_jit_trace_hot_root()
8117 …if (ZEND_OP_TRACE_INFO(opline, offset)->trace_flags & (ZEND_JIT_TRACE_JITED|ZEND_JIT_TRACE_BLACKLI… in zend_jit_trace_hot_root()
8122 ++(*ZEND_OP_TRACE_INFO(opline, offset)->counter); in zend_jit_trace_hot_root()
8129 zend_jit_trace_star_desc(ZEND_OP_TRACE_INFO(opline, offset)->trace_flags), in zend_jit_trace_hot_root()
8135 opline->lineno); in zend_jit_trace_hot_root()
8145 stop = zend_jit_trace_execute(execute_data, opline, trace_buffer, in zend_jit_trace_hot_root()
8146 ZEND_OP_TRACE_INFO(opline, offset)->trace_flags & ZEND_JIT_TRACE_START_MASK, 0, 0); in zend_jit_trace_hot_root()
8154 if (UNEXPECTED(trace_buffer[1].opline != orig_opline)) { in zend_jit_trace_hot_root()
8155 orig_opline = trace_buffer[1].opline; in zend_jit_trace_hot_root()
8161 const zend_op *opline = trace_buffer[1].opline; in zend_jit_trace_hot_root() local
8168 zend_jit_trace_star_desc(ZEND_OP_TRACE_INFO(opline, offset)->trace_flags), in zend_jit_trace_hot_root()
8174 opline->lineno); in zend_jit_trace_hot_root()
8186 uint32_t link_to = zend_jit_find_trace(trace_buffer[idx].opline->handler); in zend_jit_trace_hot_root()
8223 opline = EX(opline); in zend_jit_trace_hot_root()
8332 t->opline = NULL; in zend_jit_compile_side_trace()
8488 EX(opline)->lineno); in zend_jit_trace_hot_side()
8521 const zend_op *opline = zend_jit_traces[root].opline; in zend_jit_trace_hot_side() local
8525 …if (jit_extension->trace_info[opline - op_array->opcodes].trace_flags & ZEND_JIT_TRACE_START_LOOP)… in zend_jit_trace_hot_side()
8539 …stop = zend_jit_trace_execute(execute_data, EX(opline), trace_buffer, ZEND_JIT_TRACE_START_SIDE, i… in zend_jit_trace_hot_side()
8550 const zend_op *opline = trace_buffer[1].opline; in zend_jit_trace_hot_side() local
8557 zend_jit_trace_star_desc(ZEND_OP_TRACE_INFO(opline, offset)->trace_flags), in zend_jit_trace_hot_side()
8563 opline->lineno); in zend_jit_trace_hot_side()
8575 uint32_t link_to = zend_jit_find_trace(trace_buffer[idx].opline->handler);; in zend_jit_trace_hot_side()
8591 const zend_op *opline = trace_buffer[1].opline; in zend_jit_trace_hot_side() local
8593 stop = zend_jit_compile_root_trace(trace_buffer, opline, jit_extension->offset); in zend_jit_trace_hot_side()
8621 return zend_jit_trace_hot_root(execute_data, EX(opline)); in zend_jit_trace_hot_side()
8636 const zend_op *orig_opline = EX(opline); in zend_jit_trace_exit()
8637 const zend_op *opline; in zend_jit_trace_exit() local
8680 const zend_op *op = t->exit_info[exit_num].opline; in zend_jit_trace_exit()
8717 EX(opline) = t->exit_info[exit_num].opline - 1; in zend_jit_trace_exit()
8718 if ((EX(opline)->op1_type & (IS_VAR|IS_TMP_VAR)) in zend_jit_trace_exit()
8720 && EX(opline)->opcode != ZEND_FETCH_LIST_R) { in zend_jit_trace_exit()
8721 Z_TRY_ADDREF_P(EX_VAR(EX(opline)->op1.var)); in zend_jit_trace_exit()
8726 opline = t->exit_info[exit_num].opline; in zend_jit_trace_exit()
8728 if (opline) { in zend_jit_trace_exit()
8730 ZEND_ASSERT((opline-1)->opcode == ZEND_FETCH_DIM_R in zend_jit_trace_exit()
8731 || (opline-1)->opcode == ZEND_FETCH_DIM_IS in zend_jit_trace_exit()
8732 || (opline-1)->opcode == ZEND_FETCH_LIST_R in zend_jit_trace_exit()
8733 || (opline-1)->opcode == ZEND_FETCH_DIM_FUNC_ARG); in zend_jit_trace_exit()
8734 EX(opline) = opline-1; in zend_jit_trace_exit()
8735 zval_ptr_dtor_nogc(EX_VAR((opline-1)->op2.var)); in zend_jit_trace_exit()
8738 ZEND_ASSERT((opline-1)->opcode == ZEND_FETCH_DIM_R in zend_jit_trace_exit()
8739 || (opline-1)->opcode == ZEND_FETCH_DIM_IS in zend_jit_trace_exit()
8740 || (opline-1)->opcode == ZEND_FETCH_DIM_FUNC_ARG in zend_jit_trace_exit()
8741 || (opline-1)->opcode == ZEND_FETCH_OBJ_R in zend_jit_trace_exit()
8742 || (opline-1)->opcode == ZEND_FETCH_OBJ_IS in zend_jit_trace_exit()
8743 || (opline-1)->opcode == ZEND_FETCH_OBJ_FUNC_ARG); in zend_jit_trace_exit()
8744 EX(opline) = opline-1; in zend_jit_trace_exit()
8745 zval_ptr_dtor_nogc(EX_VAR((opline-1)->op1.var)); in zend_jit_trace_exit()
8759 EX(opline) = opline; in zend_jit_trace_exit()
8765 EX(opline) = opline; in zend_jit_trace_exit()
8776 ZEND_ASSERT(EX(opline) >= EX(func)->op_array.opcodes && in zend_jit_trace_exit()
8777 EX(opline) < EX(func)->op_array.opcodes + EX(func)->op_array.last); in zend_jit_trace_exit()
8788 EX(opline)->lineno); in zend_jit_trace_exit()
8805 …if (!(ZEND_OP_TRACE_INFO(t->opline, jit_extension->offset)->trace_flags & (ZEND_JIT_TRACE_JITED|ZE… in zend_jit_trace_exit()
8809 …if (!(ZEND_OP_TRACE_INFO(t->opline, jit_extension->offset)->trace_flags & ZEND_JIT_TRACE_BLACKLIST… in zend_jit_trace_exit()
8813 ((zend_op*)opline)->handler = in zend_jit_trace_exit()
8814 ZEND_OP_TRACE_INFO(t->opline, jit_extension->offset)->orig_handler; in zend_jit_trace_exit()
8816 ZEND_OP_TRACE_INFO(t->opline, jit_extension->offset)->trace_flags &= ~ZEND_JIT_TRACE_JITED; in zend_jit_trace_exit()
8817 ZEND_OP_TRACE_INFO(t->opline, jit_extension->offset)->trace_flags |= ZEND_JIT_TRACE_BLACKLISTED; in zend_jit_trace_exit()
8826 …if (ZEND_OP_TRACE_INFO(t->opline, jit_extension->offset)->trace_flags & ZEND_JIT_TRACE_START_LOOP)… in zend_jit_trace_exit()
8827 ((zend_op*)(t->opline))->handler = (const void*)zend_jit_loop_trace_counter_handler; in zend_jit_trace_exit()
8828 …} else if (ZEND_OP_TRACE_INFO(t->opline, jit_extension->offset)->trace_flags & ZEND_JIT_TRACE_STAR… in zend_jit_trace_exit()
8829 ((zend_op*)(t->opline))->handler = (const void*)zend_jit_func_trace_counter_handler; in zend_jit_trace_exit()
8830 …} else if (ZEND_OP_TRACE_INFO(t->opline, jit_extension->offset)->trace_flags & ZEND_JIT_TRACE_STAR… in zend_jit_trace_exit()
8831 ((zend_op*)(t->opline))->handler = (const void*)zend_jit_ret_trace_counter_handler; in zend_jit_trace_exit()
8833 ZEND_OP_TRACE_INFO(t->opline, jit_extension->offset)->trace_flags &= in zend_jit_trace_exit()
8859 return (orig_opline == t->opline && EX(opline) == orig_opline); in zend_jit_trace_exit()
8862 static zend_always_inline uint8_t zend_jit_trace_supported(const zend_op *opline) in zend_jit_trace_supported() argument
8864 switch (opline->opcode) { in zend_jit_trace_supported()
8896 zend_op *opline; in zend_jit_setup_hot_trace_counters() local
8932 opline = op_array->opcodes + cfg.blocks[i].start; in zend_jit_setup_hot_trace_counters()
8933 …if (!(ZEND_OP_TRACE_INFO(opline, jit_extension->offset)->trace_flags & ZEND_JIT_TRACE_UNSUPPORTED)… in zend_jit_setup_hot_trace_counters()
8934 opline->handler = (const void*)zend_jit_loop_trace_counter_handler; in zend_jit_setup_hot_trace_counters()
8935 if (!ZEND_OP_TRACE_INFO(opline, jit_extension->offset)->counter) { in zend_jit_setup_hot_trace_counters()
8936 ZEND_OP_TRACE_INFO(opline, jit_extension->offset)->counter = in zend_jit_setup_hot_trace_counters()
8940 ZEND_OP_TRACE_INFO(opline, jit_extension->offset)->trace_flags |= in zend_jit_setup_hot_trace_counters()
8950 opline = op_array->opcodes; in zend_jit_setup_hot_trace_counters()
8952 while (opline->opcode == ZEND_RECV || opline->opcode == ZEND_RECV_INIT) { in zend_jit_setup_hot_trace_counters()
8953 opline++; in zend_jit_setup_hot_trace_counters()
8957 if (!ZEND_OP_TRACE_INFO(opline, jit_extension->offset)->trace_flags) { in zend_jit_setup_hot_trace_counters()
8959 opline->handler = (const void*)zend_jit_func_trace_counter_handler; in zend_jit_setup_hot_trace_counters()
8960 ZEND_OP_TRACE_INFO(opline, jit_extension->offset)->counter = in zend_jit_setup_hot_trace_counters()
8963 ZEND_OP_TRACE_INFO(opline, jit_extension->offset)->trace_flags |= in zend_jit_setup_hot_trace_counters()