Lines Matching refs:ssa
395 …alias_kind zend_jit_var_may_alias(const zend_op_array *op_array, const zend_ssa *ssa, uint32_t var) in zend_jit_var_may_alias() argument
399 } else if ((!op_array->function_name || (ssa->cfg.flags & ZEND_FUNC_INDIRECT_VAR_ACCESS))) { in zend_jit_var_may_alias()
401 } else if (ssa->vars) { in zend_jit_var_may_alias()
402 return ssa->vars[var].alias; in zend_jit_var_may_alias()
436 if (ssa->vars[_ssa_var].alias != NO_ALIAS) { \
442 ssa->var_info[_ssa_var].type &= op_info; \
556 zend_ssa *ssa; in zend_jit_trace_build_ssa() local
565 memset(&jit_extension->func_info.ssa, 0, sizeof(zend_func_info) - offsetof(zend_func_info, ssa)); in zend_jit_trace_build_ssa()
566 ssa = &jit_extension->func_info.ssa; in zend_jit_trace_build_ssa()
570 if (zend_jit_op_array_analyze1(op_array, script, ssa) != SUCCESS) { in zend_jit_trace_build_ssa()
584 if (zend_jit_op_array_analyze2(op_array, script, ssa, 0) != SUCCESS) { in zend_jit_trace_build_ssa()
589 …mp_op_array(op_array, ZEND_DUMP_HIDE_UNREACHABLE|ZEND_DUMP_RC_INFERENCE|ZEND_DUMP_SSA, "JIT", ssa); in zend_jit_trace_build_ssa()
591 return ssa; in zend_jit_trace_build_ssa()
595 memset(ssa, 0, sizeof(zend_ssa)); in zend_jit_trace_build_ssa()
596 ssa->cfg.blocks_count = 1; in zend_jit_trace_build_ssa()
603 ssa->cfg.flags = cfg.flags; in zend_jit_trace_build_ssa()
605 ssa->cfg.flags |= ZEND_FUNC_INDIRECT_VAR_ACCESS; in zend_jit_trace_build_ssa()
610 ssa->cfg.flags |= ZEND_FUNC_INDIRECT_VAR_ACCESS; in zend_jit_trace_build_ssa()
616 return ssa; in zend_jit_trace_build_ssa()
822 static int zend_jit_trace_copy_ssa_var_info(const zend_op_array *op_array, const zend_ssa *ssa, con… in zend_jit_trace_copy_ssa_var_info() argument
839 op = ssa->ops + (tssa_opcodes[use] - op_array->opcodes); in zend_jit_trace_copy_ssa_var_info()
841 no_val = ssa->vars[op->op1_use].no_val; in zend_jit_trace_copy_ssa_var_info()
842 alias = ssa->vars[op->op1_use].alias; in zend_jit_trace_copy_ssa_var_info()
843 info = ssa->var_info + op->op1_use; in zend_jit_trace_copy_ssa_var_info()
845 no_val = ssa->vars[op->op2_use].no_val; in zend_jit_trace_copy_ssa_var_info()
846 alias = ssa->vars[op->op2_use].alias; in zend_jit_trace_copy_ssa_var_info()
847 info = ssa->var_info + op->op2_use; in zend_jit_trace_copy_ssa_var_info()
849 no_val = ssa->vars[op->result_use].no_val; in zend_jit_trace_copy_ssa_var_info()
850 alias = ssa->vars[op->result_use].alias; in zend_jit_trace_copy_ssa_var_info()
851 info = ssa->var_info + op->result_use; in zend_jit_trace_copy_ssa_var_info()
879 static void zend_jit_trace_copy_ssa_var_range(const zend_op_array *op_array, const zend_ssa *ssa, c… in zend_jit_trace_copy_ssa_var_range() argument
890 op = ssa->ops + (tssa_opcodes[def] - op_array->opcodes); in zend_jit_trace_copy_ssa_var_range()
892 no_val = ssa->vars[op->op1_def].no_val; in zend_jit_trace_copy_ssa_var_range()
893 alias = ssa->vars[op->op1_def].alias; in zend_jit_trace_copy_ssa_var_range()
894 info = ssa->var_info + op->op1_def; in zend_jit_trace_copy_ssa_var_range()
896 no_val = ssa->vars[op->op2_def].no_val; in zend_jit_trace_copy_ssa_var_range()
897 alias = ssa->vars[op->op2_def].alias; in zend_jit_trace_copy_ssa_var_range()
898 info = ssa->var_info + op->op2_def; in zend_jit_trace_copy_ssa_var_range()
900 no_val = ssa->vars[op->result_def].no_val; in zend_jit_trace_copy_ssa_var_range()
901 alias = ssa->vars[op->result_def].alias; in zend_jit_trace_copy_ssa_var_range()
902 info = ssa->var_info + op->result_def; in zend_jit_trace_copy_ssa_var_range()
929 static int zend_jit_trace_restrict_ssa_var_info(const zend_op_array *op_array, const zend_ssa *ssa,… in zend_jit_trace_restrict_ssa_var_info() argument
938 op = ssa->ops + (tssa_opcodes[def] - op_array->opcodes); in zend_jit_trace_restrict_ssa_var_info()
940 info = ssa->var_info + op->op1_def; in zend_jit_trace_restrict_ssa_var_info()
942 info = ssa->var_info + op->op2_def; in zend_jit_trace_restrict_ssa_var_info()
944 info = ssa->var_info + op->result_def; in zend_jit_trace_restrict_ssa_var_info()
1174 zend_ssa ssa; member
1198 zend_ssa *ssa; in zend_jit_trace_build_tssa() local
1217 ssa = zend_jit_trace_build_ssa(op_array, script); in zend_jit_trace_build_tssa()
1225 ssa->cfg.flags |= ZEND_FUNC_INDIRECT_VAR_ACCESS; in zend_jit_trace_build_tssa()
1236 ssa->cfg.flags |= ZEND_FUNC_INDIRECT_VAR_ACCESS; in zend_jit_trace_build_tssa()
1239 ssa->cfg.flags |= ZEND_FUNC_INDIRECT_VAR_ACCESS; in zend_jit_trace_build_tssa()
1257 ssa->cfg.flags |= ZEND_FUNC_INDIRECT_VAR_ACCESS; in zend_jit_trace_build_tssa()
1282 ssa = &jit_extension->func_info.ssa; in zend_jit_trace_build_tssa()
1283 if (ssa->cfg.blocks_count) { in zend_jit_trace_build_tssa()
1293 ssa = zend_jit_trace_build_ssa(op_array, script); in zend_jit_trace_build_tssa()
1300 ssa = &jit_extension->func_info.ssa; in zend_jit_trace_build_tssa()
1301 if (ssa->cfg.blocks_count) { in zend_jit_trace_build_tssa()
1311 ssa = zend_jit_trace_build_ssa(op_array, script); in zend_jit_trace_build_tssa()
1523 ssa = &jit_extension->func_info.ssa; in zend_jit_trace_build_tssa()
1531 if (ssa->var_info in zend_jit_trace_build_tssa()
1532 && zend_jit_trace_copy_ssa_var_info(op_array, ssa, ssa_opcodes, tssa, i)) { in zend_jit_trace_build_tssa()
1535 if (ssa->vars) { in zend_jit_trace_build_tssa()
1536 ssa_vars[i].no_val = ssa->vars[i].no_val; in zend_jit_trace_build_tssa()
1537 ssa_vars[i].alias = ssa->vars[i].alias; in zend_jit_trace_build_tssa()
1539 ssa_vars[i].alias = zend_jit_var_may_alias(op_array, ssa, i); in zend_jit_trace_build_tssa()
1557 if (ssa->vars) { in zend_jit_trace_build_tssa()
1558 ssa_vars[i].no_val = ssa->vars[i].no_val; in zend_jit_trace_build_tssa()
1559 ssa_vars[i].alias = ssa->vars[i].alias; in zend_jit_trace_build_tssa()
1561 ssa_vars[i].alias = zend_jit_var_may_alias(op_array, ssa, i); in zend_jit_trace_build_tssa()
1586 if (!ssa->var_info in zend_jit_trace_build_tssa()
1587 || !zend_jit_trace_copy_ssa_var_info(op_array, ssa, ssa_opcodes, tssa, i)) { in zend_jit_trace_build_tssa()
1588 if (ssa->vars && i < ssa->vars_count) { in zend_jit_trace_build_tssa()
1589 ssa_vars[i].alias = ssa->vars[i].alias; in zend_jit_trace_build_tssa()
1591 ssa_vars[i].alias = zend_jit_var_may_alias(op_array, ssa, i); in zend_jit_trace_build_tssa()
1624 if (!ssa->var_info in zend_jit_trace_build_tssa()
1625 || !zend_jit_trace_copy_ssa_var_info(op_array, ssa, ssa_opcodes, tssa, phi->ssa_var)) { in zend_jit_trace_build_tssa()
2120 if (ssa->var_info) { in zend_jit_trace_build_tssa()
2123 zend_jit_trace_copy_ssa_var_range(op_array, ssa, ssa_opcodes, tssa, ssa_ops[idx].op1_def); in zend_jit_trace_build_tssa()
2126 zend_jit_trace_copy_ssa_var_range(op_array, ssa, ssa_opcodes, tssa, ssa_ops[idx].op2_def); in zend_jit_trace_build_tssa()
2129 zend_jit_trace_copy_ssa_var_range(op_array, ssa, ssa_opcodes, tssa, ssa_ops[idx].result_def); in zend_jit_trace_build_tssa()
2133 zend_jit_trace_copy_ssa_var_range(op_array, ssa, ssa_opcodes, tssa, ssa_ops[idx+1].op1_def); in zend_jit_trace_build_tssa()
2136 zend_jit_trace_copy_ssa_var_range(op_array, ssa, ssa_opcodes, tssa, ssa_ops[idx+1].op2_def); in zend_jit_trace_build_tssa()
2139 … zend_jit_trace_copy_ssa_var_range(op_array, ssa, ssa_opcodes, tssa, ssa_ops[idx+1].result_def); in zend_jit_trace_build_tssa()
2144 …ssa_vars[ssa_ops[idx].op1_def].alias = zend_jit_var_may_alias(op_array, ssa, EX_VAR_TO_NUM(opline-… in zend_jit_trace_build_tssa()
2150 …ssa_vars[ssa_ops[idx].op2_def].alias = zend_jit_var_may_alias(op_array, ssa, EX_VAR_TO_NUM(opline-… in zend_jit_trace_build_tssa()
2156 …ssa_vars[ssa_ops[idx].result_def].alias = zend_jit_var_may_alias(op_array, ssa, EX_VAR_TO_NUM(opli… in zend_jit_trace_build_tssa()
2163 …ssa_vars[ssa_ops[idx+1].op1_def].alias = zend_jit_var_may_alias(op_array, ssa, EX_VAR_TO_NUM((opli… in zend_jit_trace_build_tssa()
2169 …ssa_vars[ssa_ops[idx+1].op2_def].alias = zend_jit_var_may_alias(op_array, ssa, EX_VAR_TO_NUM((opli… in zend_jit_trace_build_tssa()
2175 …ssa_vars[ssa_ops[idx+1].result_def].alias = zend_jit_var_may_alias(op_array, ssa, EX_VAR_TO_NUM((o… in zend_jit_trace_build_tssa()
2211 if (ssa->var_info) { in zend_jit_trace_build_tssa()
2225 zend_jit_trace_restrict_ssa_var_info(op_array, ssa, ssa_opcodes, tssa, ssa_ops[idx].op1_def); in zend_jit_trace_build_tssa()
2231 zend_jit_trace_restrict_ssa_var_info(op_array, ssa, ssa_opcodes, tssa, ssa_ops[idx].op2_def); in zend_jit_trace_build_tssa()
2235 … zend_jit_trace_restrict_ssa_var_info(op_array, ssa, ssa_opcodes, tssa, ssa_ops[idx].result_def); in zend_jit_trace_build_tssa()
2242 if (ssa->var_info) { in zend_jit_trace_build_tssa()
2245 zend_jit_trace_copy_ssa_var_range(op_array, ssa, ssa_opcodes, tssa, ssa_ops[idx].op1_def); in zend_jit_trace_build_tssa()
2248 zend_jit_trace_copy_ssa_var_range(op_array, ssa, ssa_opcodes, tssa, ssa_ops[idx].op2_def); in zend_jit_trace_build_tssa()
2251 zend_jit_trace_copy_ssa_var_range(op_array, ssa, ssa_opcodes, tssa, ssa_ops[idx].result_def); in zend_jit_trace_build_tssa()
2255 …ssa_vars[ssa_ops[idx].op1_def].alias = zend_jit_var_may_alias(op_array, ssa, EX_VAR_TO_NUM(opline-… in zend_jit_trace_build_tssa()
2261 …ssa_vars[ssa_ops[idx].op2_def].alias = zend_jit_var_may_alias(op_array, ssa, EX_VAR_TO_NUM(opline-… in zend_jit_trace_build_tssa()
2267 …ssa_vars[ssa_ops[idx].result_def].alias = zend_jit_var_may_alias(op_array, ssa, EX_VAR_TO_NUM(opli… in zend_jit_trace_build_tssa()
2284 if (ssa->var_info) { in zend_jit_trace_build_tssa()
2287 zend_jit_trace_restrict_ssa_var_info(op_array, ssa, ssa_opcodes, tssa, ssa_ops[idx].op1_def); in zend_jit_trace_build_tssa()
2290 zend_jit_trace_restrict_ssa_var_info(op_array, ssa, ssa_opcodes, tssa, ssa_ops[idx].op2_def); in zend_jit_trace_build_tssa()
2293 … zend_jit_trace_restrict_ssa_var_info(op_array, ssa, ssa_opcodes, tssa, ssa_ops[idx].result_def); in zend_jit_trace_build_tssa()
2304 ssa = &jit_extension->func_info.ssa; in zend_jit_trace_build_tssa()
2330 if (ssa->var_info in zend_jit_trace_build_tssa()
2331 && zend_jit_trace_copy_ssa_var_info(op_array, ssa, ssa_opcodes, tssa, v)) { in zend_jit_trace_build_tssa()
2334 ssa_vars[v].alias = zend_jit_var_may_alias(op_array, ssa, i); in zend_jit_trace_build_tssa()
2351 if (ssa->vars) { in zend_jit_trace_build_tssa()
2352 ssa_vars[v].no_val = ssa->vars[i].no_val; in zend_jit_trace_build_tssa()
2353 ssa_vars[v].alias = ssa->vars[i].alias; in zend_jit_trace_build_tssa()
2355 ssa_vars[v].alias = zend_jit_var_may_alias(op_array, ssa, i); in zend_jit_trace_build_tssa()
2375 ssa = &jit_extension->func_info.ssa; in zend_jit_trace_build_tssa()
2381 if (!ssa->var_info in zend_jit_trace_build_tssa()
2382 || !zend_jit_trace_copy_ssa_var_info(op_array, ssa, ssa_opcodes, tssa, v)) { in zend_jit_trace_build_tssa()
2390 if (!ssa->var_info in zend_jit_trace_build_tssa()
2391 || !zend_jit_trace_copy_ssa_var_info(op_array, ssa, ssa_opcodes, tssa, v)) { in zend_jit_trace_build_tssa()
2527 ssa = &jit_extension->func_info.ssa; in zend_jit_trace_build_tssa()
2659 … def, int use_chain, int *start, int *end, uint8_t *flags, const zend_ssa *ssa, const zend_op **ss… in zend_jit_trace_use_var() argument
2668 …} else if (use_chain >= 0 && !zend_ssa_is_no_val_use(ssa_opcodes[use_chain], ssa->ops + use_chain,… in zend_jit_trace_use_var()
2673 if (ssa->ops[line].op1_use == var) { in zend_jit_trace_use_var()
2677 } else if (ssa->ops[line].op2_use == var) { in zend_jit_trace_use_var()
2681 } else if (ssa->ops[line].result_use == var) { in zend_jit_trace_use_var()
2689 …d_jit_trace_allocate_registers(zend_jit_trace_rec *trace_buffer, zend_ssa *ssa, uint32_t parent_tr… in zend_jit_trace_allocate_registers() argument
2691 const zend_op **ssa_opcodes = ((zend_tssa*)ssa)->tssa_opcodes; in zend_jit_trace_allocate_registers()
2713 ZEND_ASSERT(ssa->var_info != NULL); in zend_jit_trace_allocate_registers()
2715 start = do_alloca(sizeof(int) * ssa->vars_count * 2 + in zend_jit_trace_allocate_registers()
2716 ZEND_MM_ALIGNED_SIZE(sizeof(uint8_t) * ssa->vars_count), in zend_jit_trace_allocate_registers()
2721 end = start + ssa->vars_count; in zend_jit_trace_allocate_registers()
2722 flags = (uint8_t*)(end + ssa->vars_count); in zend_jit_trace_allocate_registers()
2724 vars_op_array = zend_arena_calloc(&CG(arena), ssa->vars_count, sizeof(zend_op_array*)); in zend_jit_trace_allocate_registers()
2726 memset(start, -1, sizeof(int) * ssa->vars_count * 2); in zend_jit_trace_allocate_registers()
2727 memset(flags, 0, sizeof(uint8_t) * ssa->vars_count); in zend_jit_trace_allocate_registers()
2728 memset(ZEND_VOIDP(vars_op_array), 0, sizeof(zend_op_array*) * ssa->vars_count); in zend_jit_trace_allocate_registers()
2733 op_array_ssa = &jit_extension->func_info.ssa; in zend_jit_trace_allocate_registers()
2750 if ((ssa->vars[i].use_chain >= 0 /*|| ssa->vars[i].phi_use_chain*/) in zend_jit_trace_allocate_registers()
2751 …&& !zend_ssa_is_no_val_use(ssa_opcodes[ssa->vars[i].use_chain], ssa->ops + ssa->vars[i].use_chain,… in zend_jit_trace_allocate_registers()
2752 && ssa->vars[i].alias == NO_ALIAS in zend_jit_trace_allocate_registers()
2753 && zend_jit_var_supports_reg(ssa, i)) { in zend_jit_trace_allocate_registers()
2780 zend_ssa_phi *phi = ssa->blocks[1].phis; in zend_jit_trace_allocate_registers()
2785 if (ssa->vars[phi->ssa_var].use_chain >= 0 in zend_jit_trace_allocate_registers()
2786 && ssa->vars[phi->ssa_var].alias == NO_ALIAS in zend_jit_trace_allocate_registers()
2787 && zend_jit_var_supports_reg(ssa, phi->ssa_var)) { in zend_jit_trace_allocate_registers()
2797 ssa_op = ssa->ops; in zend_jit_trace_allocate_registers()
2806 zend_jit_opline_supports_reg(op_array, ssa, opline, ssa_op, p); in zend_jit_trace_allocate_registers()
2812 && ssa->vars[ssa_op->op1_def].alias != NO_ALIAS) { in zend_jit_trace_allocate_registers()
2821 …sa_op->op1_use, ssa_op->op1_def, ssa_op->op1_use_chain, start, end, flags, ssa, ssa_opcodes, op_ar… in zend_jit_trace_allocate_registers()
2853 …sa_op->op2_use, ssa_op->op2_def, ssa_op->op2_use_chain, start, end, flags, ssa, ssa_opcodes, op_ar… in zend_jit_trace_allocate_registers()
2869 …>result_use, ssa_op->result_def, ssa_op->res_use_chain, start, end, flags, ssa, ssa_opcodes, op_ar… in zend_jit_trace_allocate_registers()
2892 && (ssa->vars[ssa_op->result_def].use_chain >= 0 in zend_jit_trace_allocate_registers()
2893 || ssa->vars[ssa_op->result_def].phi_use_chain) in zend_jit_trace_allocate_registers()
2894 && ssa->vars[ssa_op->result_def].alias == NO_ALIAS in zend_jit_trace_allocate_registers()
2895 && zend_jit_var_supports_reg(ssa, ssa_op->result_def)) { in zend_jit_trace_allocate_registers()
2896 if (!(ssa->var_info[ssa_op->result_def].type & MAY_BE_GUARD) in zend_jit_trace_allocate_registers()
2906 if (!(ssa->var_info[ssa_op->result_def].type & MAY_BE_DOUBLE) in zend_jit_trace_allocate_registers()
2915 && (ssa->vars[ssa_op->op1_def].use_chain >= 0 in zend_jit_trace_allocate_registers()
2916 || ssa->vars[ssa_op->op1_def].phi_use_chain) in zend_jit_trace_allocate_registers()
2917 && ssa->vars[ssa_op->op1_def].alias == NO_ALIAS in zend_jit_trace_allocate_registers()
2918 && zend_jit_var_supports_reg(ssa, ssa_op->op1_def)) { in zend_jit_trace_allocate_registers()
2924 && (ssa->vars[ssa_op->op2_def].use_chain >= 0 in zend_jit_trace_allocate_registers()
2925 || ssa->vars[ssa_op->op2_def].phi_use_chain) in zend_jit_trace_allocate_registers()
2926 && ssa->vars[ssa_op->op2_def].alias == NO_ALIAS in zend_jit_trace_allocate_registers()
2927 && zend_jit_var_supports_reg(ssa, ssa_op->op2_def)) { in zend_jit_trace_allocate_registers()
2951 …sa_op->op1_use, ssa_op->op1_def, ssa_op->op1_use_chain, start, end, flags, ssa, ssa_opcodes, op_ar… in zend_jit_trace_allocate_registers()
2965 && (ssa->vars[ssa_op->op1_def].use_chain >= 0 in zend_jit_trace_allocate_registers()
2966 || ssa->vars[ssa_op->op1_def].phi_use_chain) in zend_jit_trace_allocate_registers()
2967 && ssa->vars[ssa_op->op1_def].alias == NO_ALIAS in zend_jit_trace_allocate_registers()
2968 && zend_jit_var_supports_reg(ssa, ssa_op->op1_def)) { in zend_jit_trace_allocate_registers()
3024 op_array_ssa = &jit_extension->func_info.ssa; in zend_jit_trace_allocate_registers()
3029 if (ssa->vars[j].use_chain >= 0 in zend_jit_trace_allocate_registers()
3030 && ssa->vars[j].alias == NO_ALIAS in zend_jit_trace_allocate_registers()
3031 && zend_jit_var_supports_reg(ssa, j)) { in zend_jit_trace_allocate_registers()
3050 op_array_ssa = &jit_extension->func_info.ssa; in zend_jit_trace_allocate_registers()
3061 if (ssa->vars[j].use_chain >= 0 in zend_jit_trace_allocate_registers()
3062 && ssa->vars[j].alias == NO_ALIAS in zend_jit_trace_allocate_registers()
3063 && zend_jit_var_supports_reg(ssa, j)) { in zend_jit_trace_allocate_registers()
3081 zend_ssa_phi *phi = ssa->blocks[1].phis; in zend_jit_trace_allocate_registers()
3085 if (start[i] >= 0 && !ssa->vars[phi->ssa_var].no_val) { in zend_jit_trace_allocate_registers()
3094 if (start[i] >= 0 && !ssa->vars[i].phi_use_chain) { in zend_jit_trace_allocate_registers()
3123 intervals = zend_arena_calloc(&CG(arena), ssa->vars_count, sizeof(zend_lifetime_interval)); in zend_jit_trace_allocate_registers()
3124 memset(intervals, 0, sizeof(zend_lifetime_interval*) * ssa->vars_count); in zend_jit_trace_allocate_registers()
3127 for (i = 0; i < ssa->vars_count; i++) { in zend_jit_trace_allocate_registers()
3132 end[i] == ssa->vars[i].use_chain) { in zend_jit_trace_allocate_registers()
3190 zend_ssa_phi *phi = ssa->blocks[1].phis; in zend_jit_trace_allocate_registers()
3195 && (ssa->var_info[phi->sources[1]].type & MAY_BE_ANY) == in zend_jit_trace_allocate_registers()
3196 (ssa->var_info[phi->ssa_var].type & MAY_BE_ANY)) { in zend_jit_trace_allocate_registers()
3204 for (i = 0; i < ssa->vars_count; i++) { in zend_jit_trace_allocate_registers()
3207 if (ssa->vars[i].definition >= 0) { in zend_jit_trace_allocate_registers()
3208 uint32_t line = ssa->vars[i].definition; in zend_jit_trace_allocate_registers()
3215 if (ssa->ops[line].op1_use >= 0 && in zend_jit_trace_allocate_registers()
3216 intervals[ssa->ops[line].op1_use] && in zend_jit_trace_allocate_registers()
3217 (i == ssa->ops[line].op1_def || in zend_jit_trace_allocate_registers()
3218 (i == ssa->ops[line].result_def && in zend_jit_trace_allocate_registers()
3219 (ssa->ops[line].op1_def < 0 || in zend_jit_trace_allocate_registers()
3220 !intervals[ssa->ops[line].op1_def])))) { in zend_jit_trace_allocate_registers()
3221 zend_jit_add_hint(intervals, i, ssa->ops[line].op1_use); in zend_jit_trace_allocate_registers()
3231 if (i == ssa->ops[line].op1_def && in zend_jit_trace_allocate_registers()
3232 ssa->ops[line].op1_use >= 0 && in zend_jit_trace_allocate_registers()
3233 intervals[ssa->ops[line].op1_use]) { in zend_jit_trace_allocate_registers()
3234 zend_jit_add_hint(intervals, i, ssa->ops[line].op1_use); in zend_jit_trace_allocate_registers()
3238 if (ssa->ops[line].op2_use >= 0 && in zend_jit_trace_allocate_registers()
3239 intervals[ssa->ops[line].op2_use] && in zend_jit_trace_allocate_registers()
3240 (i == ssa->ops[line].op2_def || in zend_jit_trace_allocate_registers()
3241 (i == ssa->ops[line].op1_def && in zend_jit_trace_allocate_registers()
3242 (ssa->ops[line].op2_def < 0 || in zend_jit_trace_allocate_registers()
3243 !intervals[ssa->ops[line].op2_def])) || in zend_jit_trace_allocate_registers()
3244 (i == ssa->ops[line].result_def && in zend_jit_trace_allocate_registers()
3245 (ssa->ops[line].op2_def < 0 || in zend_jit_trace_allocate_registers()
3246 !intervals[ssa->ops[line].op2_def]) && in zend_jit_trace_allocate_registers()
3247 (ssa->ops[line].op1_def < 0 || in zend_jit_trace_allocate_registers()
3248 !intervals[ssa->ops[line].op1_def])))) { in zend_jit_trace_allocate_registers()
3249 zend_jit_add_hint(intervals, i, ssa->ops[line].op2_use); in zend_jit_trace_allocate_registers()
3258 if (i == ssa->ops[line].result_def) { in zend_jit_trace_allocate_registers()
3259 if (ssa->ops[line].op1_use >= 0 && in zend_jit_trace_allocate_registers()
3260 intervals[ssa->ops[line].op1_use] && in zend_jit_trace_allocate_registers()
3261 ssa->ops[line].op1_use_chain < 0 && in zend_jit_trace_allocate_registers()
3262 !ssa->vars[ssa->ops[line].op1_use].phi_use_chain && in zend_jit_trace_allocate_registers()
3263 (ssa->var_info[i].type & MAY_BE_ANY) == in zend_jit_trace_allocate_registers()
3264 (ssa->var_info[ssa->ops[line].op1_use].type & MAY_BE_ANY)) { in zend_jit_trace_allocate_registers()
3266 zend_ssa_phi *phi = ssa->vars[ssa->ops[line].op1_use].definition_phi; in zend_jit_trace_allocate_registers()
3269 intervals[phi->sources[1]]->hint == intervals[ssa->ops[line].op1_use]) { in zend_jit_trace_allocate_registers()
3272 zend_jit_add_hint(intervals, i, ssa->ops[line].op1_use); in zend_jit_trace_allocate_registers()
3274 ssa->ops[line].op2_use >= 0 && in zend_jit_trace_allocate_registers()
3275 intervals[ssa->ops[line].op2_use] && in zend_jit_trace_allocate_registers()
3276 ssa->ops[line].op2_use_chain < 0 && in zend_jit_trace_allocate_registers()
3277 !ssa->vars[ssa->ops[line].op2_use].phi_use_chain && in zend_jit_trace_allocate_registers()
3278 (ssa->var_info[i].type & MAY_BE_ANY) == in zend_jit_trace_allocate_registers()
3279 (ssa->var_info[ssa->ops[line].op2_use].type & MAY_BE_ANY)) { in zend_jit_trace_allocate_registers()
3281 zend_ssa_phi *phi = ssa->vars[ssa->ops[line].op2_use].definition_phi; in zend_jit_trace_allocate_registers()
3284 intervals[phi->sources[1]]->hint == intervals[ssa->ops[line].op2_use]) { in zend_jit_trace_allocate_registers()
3287 zend_jit_add_hint(intervals, i, ssa->ops[line].op2_use); in zend_jit_trace_allocate_registers()
3296 list = zend_jit_sort_intervals(intervals, ssa->vars_count); in zend_jit_trace_allocate_registers()
3313 zend_jit_dump_lifetime_interval(vars_op_array[ival->ssa_var], ssa, ival); in zend_jit_trace_allocate_registers()
3320 list = zend_jit_linear_scan(&dummy_op_array, ssa_opcodes, ssa, list); in zend_jit_trace_allocate_registers()
3325 memset(intervals, 0, ssa->vars_count * sizeof(zend_lifetime_interval*)); in zend_jit_trace_allocate_registers()
3363 zend_ssa_phi *phi = ssa->blocks[1].phis; in zend_jit_trace_allocate_registers()
3373 && ssa->vars[def].use_chain >= 0 in zend_jit_trace_allocate_registers()
3374 && ssa->vars[def].use_chain == intervals[def]->range.end) { in zend_jit_trace_allocate_registers()
3381 if (ssa->vars[use].use_chain >= 0) { in zend_jit_trace_allocate_registers()
3402 && (!ssa->vars[def].no_val in zend_jit_trace_allocate_registers()
3403 || ssa->var_info[def].type != ssa->var_info[use].type)) { in zend_jit_trace_allocate_registers()
3404 if (ssa->vars[use].use_chain >= 0) { in zend_jit_trace_allocate_registers()
3414 for (i = 0; i < ssa->vars_count; i++) { in zend_jit_trace_allocate_registers()
3430 for (i = 0; i < ssa->vars_count; i++) { in zend_jit_trace_allocate_registers()
3433 zend_jit_dump_lifetime_interval(vars_op_array[ival->ssa_var], ssa, ival); in zend_jit_trace_allocate_registers()
3446 … *stack, const zend_op *opline, const zend_ssa_op *ssa_op, const zend_ssa *ssa, zend_lifetime_inte… in zend_jit_trace_clenup_stack() argument
3448 uint32_t line = ssa_op - ssa->ops; in zend_jit_trace_clenup_stack()
3483 static bool zend_jit_may_delay_fetch_this(const zend_op_array *op_array, zend_ssa *ssa, const zend_… in zend_jit_may_delay_fetch_this() argument
3487 int use = ssa->vars[var].use_chain; in zend_jit_may_delay_fetch_this()
3491 || ssa->vars[var].phi_use_chain in zend_jit_may_delay_fetch_this()
3492 || ssa->ops[use].op1_use != var in zend_jit_may_delay_fetch_this()
3493 || ssa->ops[use].op1_use_chain != -1) { in zend_jit_may_delay_fetch_this()
3539 for (i = ssa->vars[var].definition; i < use; i++) { in zend_jit_may_delay_fetch_this()
3585 zend_ssa *ssa, in zend_jit_trace_deoptimization() argument
3600 if (ssa && ssa->vars[i].no_val) { in zend_jit_trace_deoptimization()
3635 if (ssa && ssa->vars[i].no_val) { in zend_jit_trace_deoptimization()
3663 ssa->var_info[i].delayed_fetch_this = 1; in zend_jit_trace_deoptimization()
3729 …opline, const zend_ssa_op *ssa_op, const zend_op_array *op_array, zend_ssa *ssa, bool exit_if_true) in zend_jit_trace_update_condition_ranges() argument
3753 &ssa->var_info[ssa_op->op1_use], in zend_jit_trace_update_condition_ranges()
3759 &ssa->var_info[ssa_op->op2_use], in zend_jit_trace_update_condition_ranges()
3770 &ssa->var_info[ssa_op->op1_use], in zend_jit_trace_update_condition_ranges()
3776 &ssa->var_info[ssa_op->op2_use], in zend_jit_trace_update_condition_ranges()
3787 &ssa->var_info[ssa_op->op1_use], in zend_jit_trace_update_condition_ranges()
3793 &ssa->var_info[ssa_op->op2_use], in zend_jit_trace_update_condition_ranges()
3801 &ssa->var_info[ssa_op->op1_use], in zend_jit_trace_update_condition_ranges()
3807 &ssa->var_info[ssa_op->op2_use], in zend_jit_trace_update_condition_ranges()
3818 &ssa->var_info[ssa_op->op1_use], in zend_jit_trace_update_condition_ranges()
3824 &ssa->var_info[ssa_op->op2_use], in zend_jit_trace_update_condition_ranges()
3832 &ssa->var_info[ssa_op->op1_use], in zend_jit_trace_update_condition_ranges()
3838 &ssa->var_info[ssa_op->op2_use], in zend_jit_trace_update_condition_ranges()
3847 …mparison(const zend_op *opline, const zend_ssa_op *ssa_op, const zend_ssa *ssa, const zend_op **ss… in zend_jit_may_skip_comparison() argument
3857 opline = ssa_opcodes[ssa_op - ssa->ops]; in zend_jit_may_skip_comparison()
3867 opline = ssa_opcodes[ssa_op - ssa->ops]; in zend_jit_may_skip_comparison()
3882 opline = ssa_opcodes[ssa_op - ssa->ops]; in zend_jit_may_skip_comparison()
3892 opline = ssa_opcodes[ssa_op - ssa->ops]; in zend_jit_may_skip_comparison()
3903 prev_opcode = ssa_opcodes[prev_ssa_op - ssa->ops]->opcode; in zend_jit_may_skip_comparison()
3906 && prev_ssa_op != ssa->ops in zend_jit_may_skip_comparison()
3910 prev_opcode = ssa_opcodes[prev_ssa_op - ssa->ops]->opcode; in zend_jit_may_skip_comparison()
3924 … opline->op1) != RT_CONSTANT(&ssa_opcodes[prev_ssa_op - ssa->ops], ssa_opcodes[prev_ssa_op - ssa->… in zend_jit_may_skip_comparison()
3929 … opline->op2) != RT_CONSTANT(&ssa_opcodes[prev_ssa_op - ssa->ops], ssa_opcodes[prev_ssa_op - ssa->… in zend_jit_may_skip_comparison()
3978 zend_ssa *ssa, *op_array_ssa; in zend_jit_trace() local
4013 …ssa = zend_jit_trace_build_tssa(trace_buffer, parent_trace, exit_num, script, op_arrays, &num_op_a… in zend_jit_trace()
4015 if (!ssa) { in zend_jit_trace()
4019 ssa_opcodes = ((zend_tssa*)ssa)->tssa_opcodes; in zend_jit_trace()
4024 ra = zend_jit_trace_allocate_registers(trace_buffer, ssa, parent_trace, exit_num); in zend_jit_trace()
4049 op_array_ssa = &jit_extension->func_info.ssa; in zend_jit_trace()
4076 int used_stack = ((zend_tssa*)ssa)->used_stack; in zend_jit_trace()
4101 uint32_t info = ssa->var_info[i].type; in zend_jit_trace()
4117 } else if (ssa->vars[i].alias != NO_ALIAS) { in zend_jit_trace()
4130 && (ssa->vars[i].use_chain != -1 in zend_jit_trace()
4131 || (ssa->vars[i].phi_use_chain in zend_jit_trace()
4132 && !(ssa->var_info[ssa->vars[i].phi_use_chain->ssa_var].type & MAY_BE_GUARD)))) { in zend_jit_trace()
4138 ssa->var_info[i].type = info; in zend_jit_trace()
4152 && (ssa->vars[i].use_chain != -1 in zend_jit_trace()
4153 || (ssa->vars[i].phi_use_chain in zend_jit_trace()
4154 && !(ssa->var_info[ssa->vars[i].phi_use_chain->ssa_var].type & MAY_BE_PACKED_GUARD)))) { in zend_jit_trace()
4159 ssa->var_info[i].type = info; in zend_jit_trace()
4168 parent_stack, parent_vars_count, ssa, stack, ra, in zend_jit_trace()
4182 if ((ssa->var_info[i].type & MAY_BE_GUARD) != 0) { in zend_jit_trace()
4185 ssa->var_info[i].type &= ~MAY_BE_GUARD; in zend_jit_trace()
4186 op_type = concrete_type(ssa->var_info[i].type); in zend_jit_trace()
4194 if (!zend_jit_load_var(&dasm_state, ssa->var_info[i].type, i, ra[i]->reg)) { in zend_jit_trace()
4209 zend_ssa_phi *phi = ssa->blocks[1].phis; in zend_jit_trace()
4216 uint32_t info = ssa->var_info[phi->ssa_var].type; in zend_jit_trace()
4224 ssa->var_info[phi->ssa_var].type = info; in zend_jit_trace()
4228 …if (!zend_jit_load_var(&dasm_state, ssa->var_info[phi->ssa_var].type, ssa->vars[phi->ssa_var].var,… in zend_jit_trace()
4235 …if (!zend_jit_store_var(&dasm_state, ssa->var_info[phi->ssa_var].type, ssa->vars[phi->ssa_var].var… in zend_jit_trace()
4236 STACK_MEM_TYPE(stack, phi->var) != ssa->var_info[phi->ssa_var].type)) { in zend_jit_trace()
4268 if (!zend_jit_load_var(&dasm_state, ssa->var_info[i].type, i, ra[i]->reg)) { in zend_jit_trace()
4276 ssa_op = (JIT_G(opt_level) >= ZEND_JIT_LEVEL_INLINE) ? ssa->ops : NULL; in zend_jit_trace()
4367 … (op1_def_info & (MAY_BE_DOUBLE|MAY_BE_GUARD)) && zend_may_overflow(opline, ssa_op, op_array, ssa), in zend_jit_trace()
4368 zend_may_throw(opline, ssa_op, op_array, ssa))) { in zend_jit_trace()
4373 ssa->var_info[ssa_op->op1_def].type &= ~MAY_BE_GUARD; in zend_jit_trace()
4375 ssa->var_info[ssa_op->result_def].type &= ~MAY_BE_GUARD; in zend_jit_trace()
4381 ssa->var_info[ssa_op->result_def].type &= ~MAY_BE_GUARD; in zend_jit_trace()
4420 zend_may_throw(opline, ssa_op, op_array, ssa))) { in zend_jit_trace()
4438 !ssa->var_info[ssa_op->op1_use].guarded_reference, 1)) { in zend_jit_trace()
4441 if (ssa->vars[ssa_op->op1_use].alias == NO_ALIAS) { in zend_jit_trace()
4442 ssa->var_info[ssa_op->op1_use].guarded_reference = 1; in zend_jit_trace()
4453 !ssa->var_info[ssa_op->op2_use].guarded_reference, 1)) { in zend_jit_trace()
4456 if (ssa->vars[ssa_op->op2_use].alias == NO_ALIAS) { in zend_jit_trace()
4457 ssa->var_info[ssa_op->op2_use].guarded_reference = 1; in zend_jit_trace()
4499 …) && (res_info & (MAY_BE_DOUBLE|MAY_BE_GUARD)) && zend_may_overflow(opline, ssa_op, op_array, ssa), in zend_jit_trace()
4500 zend_may_throw(opline, ssa_op, op_array, ssa))) { in zend_jit_trace()
4507 ssa->var_info[ssa_op->result_def].type &= ~MAY_BE_GUARD; in zend_jit_trace()
4534 zend_may_throw(opline, ssa_op, op_array, ssa))) { in zend_jit_trace()
4558 … (op1_def_info & (MAY_BE_DOUBLE|MAY_BE_GUARD)) && zend_may_overflow(opline, ssa_op, op_array, ssa), in zend_jit_trace()
4559 zend_may_throw(opline, ssa_op, op_array, ssa))) { in zend_jit_trace()
4565 ssa->var_info[ssa_op->op1_def].type &= ~MAY_BE_GUARD; in zend_jit_trace()
4567 ssa->var_info[ssa_op->result_def].type &= ~MAY_BE_GUARD; in zend_jit_trace()
4591 &op1_info, &op1_addr, !ssa->var_info[ssa_op->op1_use].indirect_reference)) { in zend_jit_trace()
4601 !ssa->var_info[ssa_op->op1_use].guarded_reference, 1)) { in zend_jit_trace()
4605 && ssa->vars[ssa_op->op1_def].alias == NO_ALIAS) { in zend_jit_trace()
4606 ssa->var_info[ssa_op->op1_def].guarded_reference = 1; in zend_jit_trace()
4619 zend_may_throw_ex(opline, ssa_op, op_array, ssa, op1_info, op2_info))) { in zend_jit_trace()
4644 delayed_fetch_this = ssa->var_info[ssa_op->op1_use].delayed_fetch_this; in zend_jit_trace()
4656 &op1_info, &op1_addr, !ssa->var_info[ssa_op->op1_use].indirect_reference)) { in zend_jit_trace()
4664 !ssa->var_info[ssa_op->op1_use].guarded_reference, 1)) { in zend_jit_trace()
4668 && ssa->vars[ssa_op->op1_def].alias == NO_ALIAS) { in zend_jit_trace()
4669 ssa->var_info[ssa_op->op1_def].guarded_reference = 1; in zend_jit_trace()
4677 if (ssa->var_info && ssa->ops) { in zend_jit_trace()
4679 zend_ssa_var_info *op1_ssa = ssa->var_info + ssa_op->op1_use; in zend_jit_trace()
4688 } else if (ssa_op->op1_use >= 0 && ssa->vars[ssa_op->op1_use].definition >= 0) { in zend_jit_trace()
4689 on_this = ssa_opcodes[ssa->vars[ssa_op->op1_use].definition]->opcode == ZEND_FETCH_THIS; in zend_jit_trace()
4697 if (!zend_jit_incdec_obj(&dasm_state, opline, op_array, ssa, ssa_op, in zend_jit_trace()
4735 delayed_fetch_this = ssa->var_info[ssa_op->op1_use].delayed_fetch_this; in zend_jit_trace()
4747 &op1_info, &op1_addr, !ssa->var_info[ssa_op->op1_use].indirect_reference)) { in zend_jit_trace()
4755 !ssa->var_info[ssa_op->op1_use].guarded_reference, 1)) { in zend_jit_trace()
4759 && ssa->vars[ssa_op->op1_def].alias == NO_ALIAS) { in zend_jit_trace()
4760 ssa->var_info[ssa_op->op1_def].guarded_reference = 1; in zend_jit_trace()
4768 if (ssa->var_info && ssa->ops) { in zend_jit_trace()
4770 zend_ssa_var_info *op1_ssa = ssa->var_info + ssa_op->op1_use; in zend_jit_trace()
4779 } else if (ssa_op->op1_use >= 0 && ssa->vars[ssa_op->op1_use].definition >= 0) { in zend_jit_trace()
4780 on_this = ssa_opcodes[ssa->vars[ssa_op->op1_use].definition]->opcode == ZEND_FETCH_THIS; in zend_jit_trace()
4790 if (!zend_jit_assign_obj_op(&dasm_state, opline, op_array, ssa, ssa_op, in zend_jit_trace()
4815 delayed_fetch_this = ssa->var_info[ssa_op->op1_use].delayed_fetch_this; in zend_jit_trace()
4827 &op1_info, &op1_addr, !ssa->var_info[ssa_op->op1_use].indirect_reference)) { in zend_jit_trace()
4835 !ssa->var_info[ssa_op->op1_use].guarded_reference, 1)) { in zend_jit_trace()
4839 && ssa->vars[ssa_op->op1_def].alias == NO_ALIAS) { in zend_jit_trace()
4840 ssa->var_info[ssa_op->op1_def].guarded_reference = 1; in zend_jit_trace()
4848 if (ssa->var_info && ssa->ops) { in zend_jit_trace()
4850 zend_ssa_var_info *op1_ssa = ssa->var_info + ssa_op->op1_use; in zend_jit_trace()
4859 } else if (ssa_op->op1_use >= 0 && ssa->vars[ssa_op->op1_use].definition >= 0) { in zend_jit_trace()
4860 on_this = ssa_opcodes[ssa->vars[ssa_op->op1_use].definition]->opcode == ZEND_FETCH_THIS; in zend_jit_trace()
4870 if (!zend_jit_assign_obj(&dasm_state, opline, op_array, ssa, ssa_op, in zend_jit_trace()
4874 zend_may_throw(opline, ssa_op, op_array, ssa))) { in zend_jit_trace()
4879 && ssa->vars[(ssa_op+1)->op1_def].alias == NO_ALIAS) { in zend_jit_trace()
4880 …ssa->var_info[(ssa_op+1)->op1_def].guarded_reference = ssa->var_info[(ssa_op+1)->op1_use].guarded_… in zend_jit_trace()
4897 &op1_info, &op1_addr, !ssa->var_info[ssa_op->op1_use].indirect_reference)) { in zend_jit_trace()
4907 !ssa->var_info[ssa_op->op1_use].guarded_reference, 1)) { in zend_jit_trace()
4911 && ssa->vars[ssa_op->op1_def].alias == NO_ALIAS) { in zend_jit_trace()
4912 ssa->var_info[ssa_op->op1_def].guarded_reference = 1; in zend_jit_trace()
4923 zend_may_throw_ex(opline, ssa_op, op_array, ssa, op1_info, op2_info))) { in zend_jit_trace()
4928 && ssa->vars[(ssa_op+1)->op1_def].alias == NO_ALIAS) { in zend_jit_trace()
4929 …ssa->var_info[(ssa_op+1)->op1_def].guarded_reference = ssa->var_info[(ssa_op+1)->op1_use].guarded_… in zend_jit_trace()
4939 … if (ssa_op->op2_def < 0 || (Z_MODE(op2_addr) == IS_REG && ssa->vars[ssa_op->op2_def].no_val)) { in zend_jit_trace()
4969 !ssa->var_info[ssa_op->op1_use].guarded_reference, 0)) { in zend_jit_trace()
4973 && ssa->vars[ssa_op->op1_def].alias == NO_ALIAS) { in zend_jit_trace()
4974 ssa->var_info[ssa_op->op1_def].guarded_reference = 1; in zend_jit_trace()
5022 zend_may_throw_ex(opline, ssa_op, op_array, ssa, op1_info, op2_info))) { in zend_jit_trace()
5027 && ssa->vars[ssa_op->op2_def].no_val) { in zend_jit_trace()
5032 && ssa->vars[ssa_op->op2_def].use_chain < 0 in zend_jit_trace()
5033 && !ssa->vars[ssa_op->op2_def].phi_use_chain) { in zend_jit_trace()
5042 && ssa->vars[ssa_op->op2_def].alias == NO_ALIAS) { in zend_jit_trace()
5043 …ssa->var_info[ssa_op->op2_def].guarded_reference = ssa->var_info[ssa_op->op2_use].guarded_referenc… in zend_jit_trace()
5053 … if (ssa_op->op1_def < 0 || (Z_MODE(op1_addr) == IS_REG && ssa->vars[ssa_op->op1_def].no_val)) { in zend_jit_trace()
5078 && ssa->vars[ssa_op->op1_def].no_val) { in zend_jit_trace()
5083 && ssa->vars[ssa_op->op1_def].use_chain < 0 in zend_jit_trace()
5084 && !ssa->vars[ssa_op->op1_def].phi_use_chain) { in zend_jit_trace()
5093 && ssa->vars[ssa_op->op1_def].alias == NO_ALIAS) { in zend_jit_trace()
5094 …ssa->var_info[ssa_op->op1_def].guarded_reference = ssa->var_info[ssa_op->op1_use].guarded_referenc… in zend_jit_trace()
5101 …fg.map ? op_array_ssa->cfg.map[opline - op_array->opcodes] : -1, op_array, ssa, ssa_op, frame->cal… in zend_jit_trace()
5143 && ssa->vars[ssa_op->op1_def].alias == NO_ALIAS) { in zend_jit_trace()
5144 ssa->var_info[ssa_op->op1_def].guarded_reference = 1; in zend_jit_trace()
5162 … if (ssa_op->op1_def < 0 || (Z_MODE(op1_addr) == IS_REG && ssa->vars[ssa_op->op1_def].no_val)) { in zend_jit_trace()
5175 && ssa->vars[ssa_op->op1_def].no_val) { in zend_jit_trace()
5180 && ssa->vars[ssa_op->op1_def].use_chain < 0 in zend_jit_trace()
5181 && !ssa->vars[ssa_op->op1_def].phi_use_chain) { in zend_jit_trace()
5190 && ssa->vars[ssa_op->op1_def].alias == NO_ALIAS) { in zend_jit_trace()
5191 …ssa->var_info[ssa_op->op1_def].guarded_reference = ssa->var_info[ssa_op->op1_use].guarded_referenc… in zend_jit_trace()
5248 ssa_op != ssa->ops && in zend_jit_trace()
5251 zend_jit_may_skip_comparison(opline, ssa_op, ssa, ssa_opcodes, op_array); in zend_jit_trace()
5260 zend_jit_trace_clenup_stack(stack, opline, ssa_op, ssa, ra); in zend_jit_trace()
5272 zend_may_throw(opline, ssa_op, op_array, ssa), in zend_jit_trace()
5276 zend_jit_trace_update_condition_ranges(opline, ssa_op, op_array, ssa, exit_if_true); in zend_jit_trace()
5284 zend_may_throw(opline, ssa_op, op_array, ssa), in zend_jit_trace()
5296 ssa_op != ssa->ops && in zend_jit_trace()
5299 zend_jit_may_skip_comparison(opline, ssa_op, ssa, ssa_opcodes, op_array); in zend_jit_trace()
5308 zend_jit_trace_clenup_stack(stack, opline, ssa_op, ssa, ra); in zend_jit_trace()
5323 zend_may_throw(opline, ssa_op, op_array, ssa), in zend_jit_trace()
5327 zend_jit_trace_update_condition_ranges(opline, ssa_op, op_array, ssa, exit_if_true); in zend_jit_trace()
5335 zend_may_throw(opline, ssa_op, op_array, ssa), in zend_jit_trace()
5373 zend_jit_trace_clenup_stack(stack, opline, ssa_op, ssa, ra); in zend_jit_trace()
5402 …ace_handler(&dasm_state, op_array, opline, zend_may_throw(opline, ssa_op, op_array, ssa), p + 1)) { in zend_jit_trace()
5471 zend_may_throw(opline, ssa_op, op_array, ssa), in zend_jit_trace()
5513 zend_jit_trace_clenup_stack(stack, opline, ssa_op, ssa, ra); in zend_jit_trace()
5549 zend_may_throw(opline, ssa_op, op_array, ssa), in zend_jit_trace()
5564 !ssa->var_info[ssa_op->op1_use].guarded_reference, 1)) { in zend_jit_trace()
5568 && ssa->vars[ssa_op->op1_use].alias == NO_ALIAS) { in zend_jit_trace()
5569 ssa->var_info[ssa_op->op1_use].guarded_reference = 1; in zend_jit_trace()
5640 !ssa->var_info[ssa_op->op1_use].guarded_reference, 1)) { in zend_jit_trace()
5644 && ssa->vars[ssa_op->op1_use].alias == NO_ALIAS) { in zend_jit_trace()
5645 ssa->var_info[ssa_op->op1_use].guarded_reference = 1; in zend_jit_trace()
5647 ssa->var_info[ssa_op->op1_def].guarded_reference = 1; in zend_jit_trace()
5658 ssa->var_info[ssa_op->op1_use].avoid_refcounting; in zend_jit_trace()
5660 ssa->var_info[ssa_op->op1_use].type &= ~MAY_BE_PACKED_GUARD; in zend_jit_trace()
5670 … ssa->var_info[ssa_op->op1_use].type &= ~(MAY_BE_ARRAY_NUMERIC_HASH|MAY_BE_ARRAY_STRING_HASH); in zend_jit_trace()
5675 ssa->var_info[ssa_op->op1_use].type &= ~MAY_BE_ARRAY_PACKED; in zend_jit_trace()
5679 if (!zend_jit_fetch_dim_read(&dasm_state, opline, ssa, ssa_op, in zend_jit_trace()
5685 ssa->var_info[ssa_op->op1_def].type = ssa->var_info[ssa_op->op1_use].type; in zend_jit_trace()
5703 &op1_info, &op1_addr, !ssa->var_info[ssa_op->op1_use].indirect_reference)) { in zend_jit_trace()
5713 !ssa->var_info[ssa_op->op1_use].guarded_reference, 1)) { in zend_jit_trace()
5717 && ssa->vars[ssa_op->op1_def].alias == NO_ALIAS) { in zend_jit_trace()
5718 ssa->var_info[ssa_op->op1_def].guarded_reference = 1; in zend_jit_trace()
5734 ssa->var_info[ssa_op->result_def].indirect_reference = 1; in zend_jit_trace()
5747 !ssa->var_info[ssa_op->op1_use].guarded_reference, 1)) { in zend_jit_trace()
5751 && ssa->vars[ssa_op->op1_use].alias == NO_ALIAS) { in zend_jit_trace()
5752 ssa->var_info[ssa_op->op1_use].guarded_reference = 1; in zend_jit_trace()
5765 zend_jit_trace_clenup_stack(stack, opline, ssa_op, ssa, ra); in zend_jit_trace()
5768 && ssa->var_info[ssa_op->op1_use].avoid_refcounting) { in zend_jit_trace()
5790 ssa->var_info[ssa_op->op1_use].avoid_refcounting; in zend_jit_trace()
5792 ssa->var_info[ssa_op->op1_use].type &= ~MAY_BE_PACKED_GUARD; in zend_jit_trace()
5808 zend_may_throw_ex(opline, ssa_op, op_array, ssa, op1_info, op2_info), in zend_jit_trace()
5853 &op1_info, &op1_addr, !ssa->var_info[ssa_op->op1_use].indirect_reference)) { in zend_jit_trace()
5861 !ssa->var_info[ssa_op->op1_use].guarded_reference, 1)) { in zend_jit_trace()
5865 && ssa->vars[ssa_op->op1_use].alias == NO_ALIAS) { in zend_jit_trace()
5866 … ssa->var_info[ssa_op->op1_def >= 0 ? ssa_op->op1_def : ssa_op->op1_use].guarded_reference = 1; in zend_jit_trace()
5874 if (ssa->var_info && ssa->ops) { in zend_jit_trace()
5876 zend_ssa_var_info *op1_ssa = ssa->var_info + ssa_op->op1_use; in zend_jit_trace()
5884 delayed_fetch_this = ssa->var_info[ssa_op->op1_use].delayed_fetch_this; in zend_jit_trace()
5885 avoid_refcounting = ssa->var_info[ssa_op->op1_use].avoid_refcounting; in zend_jit_trace()
5889 } else if (ssa_op->op1_use >= 0 && ssa->vars[ssa_op->op1_use].definition >= 0) { in zend_jit_trace()
5890 on_this = ssa_opcodes[ssa->vars[ssa_op->op1_use].definition]->opcode == ZEND_FETCH_THIS; in zend_jit_trace()
5898 if (!zend_jit_fetch_obj(&dasm_state, opline, op_array, ssa, ssa_op, in zend_jit_trace()
5901 zend_may_throw_ex(opline, ssa_op, op_array, ssa, op1_info, MAY_BE_STRING))) { in zend_jit_trace()
5909 if (!ssa->ops || !ssa->var_info) { in zend_jit_trace()
5914 if (ssa->vars[ssa_op->op1_def].alias == NO_ALIAS) { in zend_jit_trace()
5915 ssa->var_info[ssa_op->op1_def].guarded_reference = 1; in zend_jit_trace()
5941 zend_may_throw(opline, ssa_op, op_array, ssa))) { in zend_jit_trace()
5958 zend_may_throw(opline, ssa_op, op_array, ssa))) { in zend_jit_trace()
5977 !ssa->var_info[ssa_op->op1_use].guarded_reference, 1)) { in zend_jit_trace()
5981 && ssa->vars[ssa_op->op1_use].alias == NO_ALIAS) { in zend_jit_trace()
5982 ssa->var_info[ssa_op->op1_use].guarded_reference = 1; in zend_jit_trace()
5999 !ssa->var_info[ssa_op->op1_use].guarded_reference, 1)) { in zend_jit_trace()
6003 && ssa->vars[ssa_op->op1_use].alias == NO_ALIAS) { in zend_jit_trace()
6004 ssa->var_info[ssa_op->op1_use].guarded_reference = 1; in zend_jit_trace()
6012 …tate, opline, op1_info, op1_addr, RES_REG_ADDR(), zend_may_throw(opline, ssa_op, op_array, ssa))) { in zend_jit_trace()
6019 if (zend_jit_may_delay_fetch_this(op_array, ssa, ssa_opcodes, ssa_op)) { in zend_jit_trace()
6020 ssa->var_info[ssa_op->result_def].delayed_fetch_this = 1; in zend_jit_trace()
6102 if (!zend_jit_fetch_constant(&dasm_state, opline, op_array, ssa, ssa_op, RES_REG_ADDR())) { in zend_jit_trace()
6129 !ssa->var_info[ssa_op->op1_use].guarded_reference, 1)) { in zend_jit_trace()
6133 && ssa->vars[ssa_op->op1_use].alias == NO_ALIAS) { in zend_jit_trace()
6134 ssa->var_info[ssa_op->op1_use].guarded_reference = 1; in zend_jit_trace()
6139 if (ssa->var_info && ssa->ops) { in zend_jit_trace()
6141 zend_ssa_var_info *op1_ssa = ssa->var_info + ssa_op->op1_use; in zend_jit_trace()
6149 delayed_fetch_this = ssa->var_info[ssa_op->op1_use].delayed_fetch_this; in zend_jit_trace()
6153 } else if (ssa_op->op1_use >= 0 && ssa->vars[ssa_op->op1_use].definition >= 0) { in zend_jit_trace()
6154 on_this = ssa_opcodes[ssa->vars[ssa_op->op1_use].definition]->opcode == ZEND_FETCH_THIS; in zend_jit_trace()
6165 op_array, ssa, ssa_op, frame->call_level, in zend_jit_trace()
6178 …fg.map ? op_array_ssa->cfg.map[opline - op_array->opcodes] : -1, op_array, ssa, ssa_op, frame->cal… in zend_jit_trace()
6184 …ace_handler(&dasm_state, op_array, opline, zend_may_throw(opline, ssa_op, op_array, ssa), p + 1)) { in zend_jit_trace()
6198 …ace_handler(&dasm_state, op_array, opline, zend_may_throw(opline, ssa_op, op_array, ssa), p + 1)) { in zend_jit_trace()
6210 …ace_handler(&dasm_state, op_array, opline, zend_may_throw(opline, ssa_op, op_array, ssa), p + 1)) { in zend_jit_trace()
6257 zend_may_throw_ex(opline, ssa_op, op_array, ssa, op1_info, op2_info), p + 1)) { in zend_jit_trace()
6274 zend_jit_trace_clenup_stack(stack, opline, ssa_op, ssa, ra); in zend_jit_trace()
6306 } else if (!(ssa->var_info[ssa_op->result_def].type & MAY_BE_GUARD) in zend_jit_trace()
6307 && has_concrete_type(ssa->var_info[ssa_op->result_def].type)) { in zend_jit_trace()
6308 type = concrete_type(ssa->var_info[ssa_op->result_def].type); in zend_jit_trace()
6318 && (ssa->var_info[ssa_op->op1_use].type & MAY_BE_REF) == 0) { in zend_jit_trace()
6338 if (ssa->var_info[ssa_op->result_def].type & MAY_BE_INDIRECT) { in zend_jit_trace()
6342 ssa->var_info[ssa_op->result_def].type &= ~MAY_BE_GUARD; in zend_jit_trace()
6346 } else if (ssa->var_info[ssa_op->result_def].avoid_refcounting) { in zend_jit_trace()
6356 …&& zend_inference_propagate_range(op_array, ssa, (zend_op*)opline, (zend_ssa_op*)ssa_op, ssa_op->r… in zend_jit_trace()
6357 ssa->var_info[ssa_op->result_def].range.min = tmp.min; in zend_jit_trace()
6358 ssa->var_info[ssa_op->result_def].range.max = tmp.max; in zend_jit_trace()
6359 ssa->var_info[ssa_op->result_def].range.underflow = 0; in zend_jit_trace()
6360 ssa->var_info[ssa_op->result_def].range.overflow = 0; in zend_jit_trace()
6361 ssa->var_info[ssa_op->result_def].has_range = 1; in zend_jit_trace()
6370 if (!(ssa->var_info[ssa_op->op1_def].type & MAY_BE_GUARD) in zend_jit_trace()
6371 && has_concrete_type(ssa->var_info[ssa_op->op1_def].type)) { in zend_jit_trace()
6372 type = concrete_type(ssa->var_info[ssa_op->op1_def].type); in zend_jit_trace()
6394 !(ssa->vars[ssa_op->op1_def].no_val && in zend_jit_trace()
6403 ssa->var_info[ssa_op->op1_def].type &= ~MAY_BE_GUARD; in zend_jit_trace()
6424 …&& zend_inference_propagate_range(op_array, ssa, (zend_op*)opline, (zend_ssa_op*)ssa_op, ssa_op->o… in zend_jit_trace()
6425 ssa->var_info[ssa_op->op1_def].range.min = tmp.min; in zend_jit_trace()
6426 ssa->var_info[ssa_op->op1_def].range.max = tmp.max; in zend_jit_trace()
6427 ssa->var_info[ssa_op->op1_def].range.underflow = 0; in zend_jit_trace()
6428 ssa->var_info[ssa_op->op1_def].range.overflow = 0; in zend_jit_trace()
6429 ssa->var_info[ssa_op->op1_def].has_range = 1; in zend_jit_trace()
6438 if (!(ssa->var_info[ssa_op->op2_def].type & MAY_BE_GUARD) in zend_jit_trace()
6439 && has_concrete_type(ssa->var_info[ssa_op->op2_def].type)) { in zend_jit_trace()
6440 type = concrete_type(ssa->var_info[ssa_op->op2_def].type); in zend_jit_trace()
6448 !(ssa->vars[ssa_op->op2_def].no_val && in zend_jit_trace()
6452 ssa->var_info[ssa_op->op2_def].type &= ~MAY_BE_GUARD; in zend_jit_trace()
6468 …&& zend_inference_propagate_range(op_array, ssa, (zend_op*)opline, (zend_ssa_op*)ssa_op, ssa_op->o… in zend_jit_trace()
6469 ssa->var_info[ssa_op->op2_def].range.min = tmp.min; in zend_jit_trace()
6470 ssa->var_info[ssa_op->op2_def].range.max = tmp.max; in zend_jit_trace()
6471 ssa->var_info[ssa_op->op2_def].range.underflow = 0; in zend_jit_trace()
6472 ssa->var_info[ssa_op->op2_def].range.overflow = 0; in zend_jit_trace()
6473 ssa->var_info[ssa_op->op2_def].has_range = 1; in zend_jit_trace()
6492 if (!(ssa->var_info[ssa_op->op1_def].type & MAY_BE_GUARD) in zend_jit_trace()
6493 && has_concrete_type(ssa->var_info[ssa_op->op1_def].type)) { in zend_jit_trace()
6494 type = concrete_type(ssa->var_info[ssa_op->op1_def].type); in zend_jit_trace()
6504 ssa->var_info[ssa_op->op1_def].type &= ~MAY_BE_GUARD; in zend_jit_trace()
6511 …&& zend_inference_propagate_range(op_array, ssa, (zend_op*)opline, (zend_ssa_op*)ssa_op, ssa_op->o… in zend_jit_trace()
6512 ssa->var_info[ssa_op->op1_def].range.min = tmp.min; in zend_jit_trace()
6513 ssa->var_info[ssa_op->op1_def].range.max = tmp.max; in zend_jit_trace()
6514 ssa->var_info[ssa_op->op1_def].range.underflow = 0; in zend_jit_trace()
6515 ssa->var_info[ssa_op->op1_def].range.overflow = 0; in zend_jit_trace()
6516 ssa->var_info[ssa_op->op1_def].has_range = 1; in zend_jit_trace()
6528 if (!(ssa->var_info[ssa_op->result_def].type & MAY_BE_GUARD) in zend_jit_trace()
6529 && has_concrete_type(ssa->var_info[ssa_op->result_def].type)) { in zend_jit_trace()
6530 type = concrete_type(ssa->var_info[ssa_op->result_def].type); in zend_jit_trace()
6550 if (!(ssa->var_info[ssa_op->op1_def].type & MAY_BE_GUARD) in zend_jit_trace()
6551 && has_concrete_type(ssa->var_info[ssa_op->op1_def].type)) { in zend_jit_trace()
6552 type = concrete_type(ssa->var_info[ssa_op->op1_def].type); in zend_jit_trace()
6627 op_array_ssa = &jit_extension->func_info.ssa; in zend_jit_trace()
6643 if (!zend_jit_load_var(&dasm_state, ssa->var_info[j].type, i, ra[j]->reg)) { in zend_jit_trace()
6653 op_array_ssa = &jit_extension->func_info.ssa; in zend_jit_trace()
6671 if (!(ssa->var_info[j].type & MAY_BE_GUARD) in zend_jit_trace()
6672 && has_concrete_type(ssa->var_info[j].type)) { in zend_jit_trace()
6673 SET_STACK_TYPE(stack, i, concrete_type(ssa->var_info[j].type), 1); in zend_jit_trace()
6683 if (!zend_jit_load_var(&dasm_state, ssa->var_info[j].type, i, ra[j]->reg)) { in zend_jit_trace()
6749 && zend_jit_var_may_alias(p->op_array, &jit_extension->func_info.ssa, i) != NO_ALIAS) { in zend_jit_trace()
6870 zend_ssa_phi *phi = ssa->blocks[1].phis; in zend_jit_trace()
7078 memset(&jit_extension->func_info.ssa, 0, sizeof(zend_func_info) - offsetof(zend_func_info, ssa)); in zend_jit_trace()