Lines Matching refs:ssa
363 …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
367 } else if ((!op_array->function_name || (ssa->cfg.flags & ZEND_FUNC_INDIRECT_VAR_ACCESS))) { in zend_jit_var_may_alias()
369 } else if (ssa->vars) { in zend_jit_var_may_alias()
370 return ssa->vars[var].alias; in zend_jit_var_may_alias()
404 if (ssa->vars[_ssa_var].alias != NO_ALIAS) { \
410 ssa->var_info[_ssa_var].type &= op_info; \
524 zend_ssa *ssa; in zend_jit_trace_build_ssa() local
533 memset(&jit_extension->func_info.ssa, 0, sizeof(zend_func_info) - offsetof(zend_func_info, ssa)); in zend_jit_trace_build_ssa()
534 ssa = &jit_extension->func_info.ssa; in zend_jit_trace_build_ssa()
538 if (zend_jit_op_array_analyze1(op_array, script, ssa) != SUCCESS) { in zend_jit_trace_build_ssa()
550 if (zend_jit_op_array_analyze2(op_array, script, ssa, 0) != SUCCESS) { in zend_jit_trace_build_ssa()
555 …mp_op_array(op_array, ZEND_DUMP_HIDE_UNREACHABLE|ZEND_DUMP_RC_INFERENCE|ZEND_DUMP_SSA, "JIT", ssa); in zend_jit_trace_build_ssa()
557 return ssa; in zend_jit_trace_build_ssa()
561 memset(ssa, 0, sizeof(zend_ssa)); in zend_jit_trace_build_ssa()
562 ssa->cfg.blocks_count = 1; in zend_jit_trace_build_ssa()
569 ssa->cfg.flags = cfg.flags; in zend_jit_trace_build_ssa()
571 ssa->cfg.flags |= ZEND_FUNC_INDIRECT_VAR_ACCESS; in zend_jit_trace_build_ssa()
576 ssa->cfg.flags |= ZEND_FUNC_INDIRECT_VAR_ACCESS; in zend_jit_trace_build_ssa()
582 return ssa; in zend_jit_trace_build_ssa()
789 static bool zend_jit_trace_is_false_loop(const zend_op_array *op_array, const zend_ssa *ssa, const … in zend_jit_trace_is_false_loop() argument
798 b = ssa->cfg.map[tssa_opcodes[0] - op_array->opcodes]; 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()
809 const zend_ssa *ssa, in zend_jit_trace_copy_ssa_var_info() argument
819 uint32_t b = ssa->cfg.map[tssa_opcodes[0] - op_array->opcodes]; in zend_jit_trace_copy_ssa_var_info()
820 zend_basic_block *bb = ssa->cfg.blocks + b; in zend_jit_trace_copy_ssa_var_info()
823 && !zend_jit_trace_is_false_loop(op_array, ssa, tssa_opcodes, tssa)) { in zend_jit_trace_copy_ssa_var_info()
824 zend_ssa_phi *phi = ssa->blocks[b].phis; in zend_jit_trace_copy_ssa_var_info()
829 if (ssa->vars[phi->ssa_var].var == var) { in zend_jit_trace_copy_ssa_var_info()
848 bb = ssa->cfg.blocks + b; in zend_jit_trace_copy_ssa_var_info()
850 for (n = bb->len, op = ssa->ops + bb->start + n; n > 0; n--) { in zend_jit_trace_copy_ssa_var_info()
852 if (op->result_def >= 0 && ssa->vars[op->result_def].var == var) { in zend_jit_trace_copy_ssa_var_info()
855 } else if (op->op2_def >= 0 && ssa->vars[op->op2_def].var == var) { in zend_jit_trace_copy_ssa_var_info()
858 } else if (op->op1_def >= 0 && ssa->vars[op->op1_def].var == var) { in zend_jit_trace_copy_ssa_var_info()
864 phi = ssa->blocks[b].phis; in zend_jit_trace_copy_ssa_var_info()
867 if (ssa->vars[phi->ssa_var].var == var) { in zend_jit_trace_copy_ssa_var_info()
887 op = ssa->ops + (tssa_opcodes[def] - op_array->opcodes); in zend_jit_trace_copy_ssa_var_info()
910 op = ssa->ops + (tssa_opcodes[use] - op_array->opcodes); in zend_jit_trace_copy_ssa_var_info()
925 uint32_t b = ssa->cfg.map[op_num]; in zend_jit_trace_copy_ssa_var_info()
926 zend_basic_block *bb = ssa->cfg.blocks + b; in zend_jit_trace_copy_ssa_var_info()
932 op = ssa->ops + op_num; in zend_jit_trace_copy_ssa_var_info()
933 if (op->result_def >= 0 && ssa->vars[op->result_def].var == var) { in zend_jit_trace_copy_ssa_var_info()
936 } else if (op->op2_def >= 0 && ssa->vars[op->op2_def].var == var) { in zend_jit_trace_copy_ssa_var_info()
939 } else if (op->op1_def >= 0 && ssa->vars[op->op1_def].var == var) { in zend_jit_trace_copy_ssa_var_info()
944 phi = ssa->blocks[b].phis; in zend_jit_trace_copy_ssa_var_info()
947 if (ssa->vars[phi->ssa_var].var == var) { in zend_jit_trace_copy_ssa_var_info()
965 bb = ssa->cfg.blocks + b; in zend_jit_trace_copy_ssa_var_info()
974 tssa->vars[ssa_var].no_val = ssa->vars[src].no_val; in zend_jit_trace_copy_ssa_var_info()
975 tssa->vars[ssa_var].alias = ssa->vars[src].alias; in zend_jit_trace_copy_ssa_var_info()
976 memcpy(&tssa->var_info[ssa_var], &ssa->var_info[src], sizeof(zend_ssa_var_info)); in zend_jit_trace_copy_ssa_var_info()
995 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
1006 op = ssa->ops + (tssa_opcodes[def] - op_array->opcodes); in zend_jit_trace_copy_ssa_var_range()
1008 no_val = ssa->vars[op->op1_def].no_val; in zend_jit_trace_copy_ssa_var_range()
1009 alias = ssa->vars[op->op1_def].alias; in zend_jit_trace_copy_ssa_var_range()
1010 info = ssa->var_info + op->op1_def; in zend_jit_trace_copy_ssa_var_range()
1012 no_val = ssa->vars[op->op2_def].no_val; in zend_jit_trace_copy_ssa_var_range()
1013 alias = ssa->vars[op->op2_def].alias; in zend_jit_trace_copy_ssa_var_range()
1014 info = ssa->var_info + op->op2_def; in zend_jit_trace_copy_ssa_var_range()
1016 no_val = ssa->vars[op->result_def].no_val; in zend_jit_trace_copy_ssa_var_range()
1017 alias = ssa->vars[op->result_def].alias; in zend_jit_trace_copy_ssa_var_range()
1018 info = ssa->var_info + op->result_def; in zend_jit_trace_copy_ssa_var_range()
1045 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
1054 op = ssa->ops + (tssa_opcodes[def] - op_array->opcodes); in zend_jit_trace_restrict_ssa_var_info()
1056 info = ssa->var_info + op->op1_def; in zend_jit_trace_restrict_ssa_var_info()
1058 info = ssa->var_info + op->op2_def; in zend_jit_trace_restrict_ssa_var_info()
1060 info = ssa->var_info + op->result_def; in zend_jit_trace_restrict_ssa_var_info()
1293 zend_ssa ssa; member
1350 zend_ssa *ssa; in zend_jit_trace_build_tssa() local
1369 ssa = zend_jit_trace_build_ssa(op_array, script); in zend_jit_trace_build_tssa()
1377 ssa->cfg.flags |= ZEND_FUNC_INDIRECT_VAR_ACCESS; in zend_jit_trace_build_tssa()
1388 ssa->cfg.flags |= ZEND_FUNC_INDIRECT_VAR_ACCESS; in zend_jit_trace_build_tssa()
1391 ssa->cfg.flags |= ZEND_FUNC_INDIRECT_VAR_ACCESS; in zend_jit_trace_build_tssa()
1411 ssa->cfg.flags |= ZEND_FUNC_INDIRECT_VAR_ACCESS; in zend_jit_trace_build_tssa()
1440 ssa = &jit_extension->func_info.ssa; in zend_jit_trace_build_tssa()
1441 if (ssa->cfg.blocks_count) { in zend_jit_trace_build_tssa()
1451 ssa = zend_jit_trace_build_ssa(op_array, script); in zend_jit_trace_build_tssa()
1458 ssa = &jit_extension->func_info.ssa; in zend_jit_trace_build_tssa()
1459 if (ssa->cfg.blocks_count) { in zend_jit_trace_build_tssa()
1469 ssa = zend_jit_trace_build_ssa(op_array, script); in zend_jit_trace_build_tssa()
1684 ssa = &jit_extension->func_info.ssa; in zend_jit_trace_build_tssa()
1692 if (ssa->var_info in zend_jit_trace_build_tssa()
1693 && zend_jit_trace_copy_ssa_var_info(op_array, ssa, ssa_opcodes, tssa, i, NULL)) { in zend_jit_trace_build_tssa()
1696 if (ssa->vars) { in zend_jit_trace_build_tssa()
1697 ssa_vars[i].no_val = ssa->vars[i].no_val; in zend_jit_trace_build_tssa()
1698 ssa_vars[i].alias = ssa->vars[i].alias; in zend_jit_trace_build_tssa()
1700 ssa_vars[i].alias = zend_jit_var_may_alias(op_array, ssa, i); in zend_jit_trace_build_tssa()
1718 if (ssa->vars) { in zend_jit_trace_build_tssa()
1719 ssa_vars[i].no_val = ssa->vars[i].no_val; in zend_jit_trace_build_tssa()
1720 ssa_vars[i].alias = ssa->vars[i].alias; in zend_jit_trace_build_tssa()
1722 ssa_vars[i].alias = zend_jit_var_may_alias(op_array, ssa, i); in zend_jit_trace_build_tssa()
1747 if (!ssa->var_info 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()
1749 if (ssa->vars && i < ssa->vars_count) { in zend_jit_trace_build_tssa()
1750 ssa_vars[i].alias = ssa->vars[i].alias; in zend_jit_trace_build_tssa()
1752 ssa_vars[i].alias = zend_jit_var_may_alias(op_array, ssa, i); in zend_jit_trace_build_tssa()
1785 if (!ssa->var_info in zend_jit_trace_build_tssa()
1786 || !zend_jit_trace_copy_ssa_var_info(op_array, ssa, ssa_opcodes, tssa, phi->ssa_var, NULL)) { in zend_jit_trace_build_tssa()
2287 if (ssa->var_info) { in zend_jit_trace_build_tssa()
2290 zend_jit_trace_copy_ssa_var_range(op_array, ssa, ssa_opcodes, tssa, ssa_ops[idx].op1_def); in zend_jit_trace_build_tssa()
2293 zend_jit_trace_copy_ssa_var_range(op_array, ssa, ssa_opcodes, tssa, ssa_ops[idx].op2_def); in zend_jit_trace_build_tssa()
2296 zend_jit_trace_copy_ssa_var_range(op_array, ssa, ssa_opcodes, tssa, ssa_ops[idx].result_def); in zend_jit_trace_build_tssa()
2300 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()
2303 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()
2306 … 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()
2311 …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()
2317 …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()
2323 …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()
2330 …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()
2336 …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()
2342 …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()
2378 if (ssa->var_info) { in zend_jit_trace_build_tssa()
2392 zend_jit_trace_restrict_ssa_var_info(op_array, ssa, ssa_opcodes, tssa, ssa_ops[idx].op1_def); in zend_jit_trace_build_tssa()
2398 zend_jit_trace_restrict_ssa_var_info(op_array, ssa, ssa_opcodes, tssa, ssa_ops[idx].op2_def); in zend_jit_trace_build_tssa()
2402 … zend_jit_trace_restrict_ssa_var_info(op_array, ssa, ssa_opcodes, tssa, ssa_ops[idx].result_def); in zend_jit_trace_build_tssa()
2409 if (ssa->var_info) { in zend_jit_trace_build_tssa()
2412 zend_jit_trace_copy_ssa_var_range(op_array, ssa, ssa_opcodes, tssa, ssa_ops[idx].op1_def); in zend_jit_trace_build_tssa()
2415 zend_jit_trace_copy_ssa_var_range(op_array, ssa, ssa_opcodes, tssa, ssa_ops[idx].op2_def); in zend_jit_trace_build_tssa()
2418 zend_jit_trace_copy_ssa_var_range(op_array, ssa, ssa_opcodes, tssa, ssa_ops[idx].result_def); in zend_jit_trace_build_tssa()
2422 …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()
2428 …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()
2434 …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()
2451 if (ssa->var_info) { in zend_jit_trace_build_tssa()
2454 zend_jit_trace_restrict_ssa_var_info(op_array, ssa, ssa_opcodes, tssa, ssa_ops[idx].op1_def); in zend_jit_trace_build_tssa()
2457 zend_jit_trace_restrict_ssa_var_info(op_array, ssa, ssa_opcodes, tssa, ssa_ops[idx].op2_def); in zend_jit_trace_build_tssa()
2460 … zend_jit_trace_restrict_ssa_var_info(op_array, ssa, ssa_opcodes, tssa, ssa_ops[idx].result_def); in zend_jit_trace_build_tssa()
2471 ssa = &jit_extension->func_info.ssa; in zend_jit_trace_build_tssa()
2494 if (ssa->var_info in zend_jit_trace_build_tssa()
2495 && zend_jit_trace_copy_ssa_var_info(op_array, ssa, ssa_opcodes, tssa, v, NULL)) { in zend_jit_trace_build_tssa()
2498 ssa_vars[v].alias = zend_jit_var_may_alias(op_array, ssa, i); in zend_jit_trace_build_tssa()
2515 if (ssa->vars) { in zend_jit_trace_build_tssa()
2516 ssa_vars[v].no_val = ssa->vars[i].no_val; in zend_jit_trace_build_tssa()
2517 ssa_vars[v].alias = ssa->vars[i].alias; in zend_jit_trace_build_tssa()
2519 ssa_vars[v].alias = zend_jit_var_may_alias(op_array, ssa, i); in zend_jit_trace_build_tssa()
2539 ssa = &jit_extension->func_info.ssa; in zend_jit_trace_build_tssa()
2545 if (!ssa->var_info in zend_jit_trace_build_tssa()
2546 || !zend_jit_trace_copy_ssa_var_info(op_array, ssa, ssa_opcodes, tssa, v, NULL)) { in zend_jit_trace_build_tssa()
2554 if (!ssa->var_info in zend_jit_trace_build_tssa()
2555 || !zend_jit_trace_copy_ssa_var_info(op_array, ssa, ssa_opcodes, tssa, v, NULL)) { in zend_jit_trace_build_tssa()
2690 ssa = &jit_extension->func_info.ssa; in zend_jit_trace_build_tssa()
2823 …ne, int var, int def, int use_chain, zend_jit_reg_var *ra, const zend_ssa *ssa, const zend_op **ss… in zend_jit_trace_use_var() argument
2832 …} 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()
2837 if (ssa->ops[line].op1_use == var) { in zend_jit_trace_use_var()
2841 } else if (ssa->ops[line].op2_use == var) { in zend_jit_trace_use_var()
2845 } else if (ssa->ops[line].result_use == var) { in zend_jit_trace_use_var()
2853 …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
2855 const zend_op **ssa_opcodes = ((zend_tssa*)ssa)->tssa_opcodes; in zend_jit_trace_allocate_registers()
2873 ra = zend_arena_calloc(&CG(arena), ssa->vars_count, sizeof(zend_jit_reg_var)); in zend_jit_trace_allocate_registers()
2874 vars_op_array = zend_arena_calloc(&CG(arena), ssa->vars_count, sizeof(zend_op_array*)); in zend_jit_trace_allocate_registers()
2875 memset(ZEND_VOIDP(vars_op_array), 0, sizeof(zend_op_array*) * ssa->vars_count); in zend_jit_trace_allocate_registers()
2880 op_array_ssa = &jit_extension->func_info.ssa; in zend_jit_trace_allocate_registers()
2897 if ((ssa->vars[i].use_chain >= 0 /*|| ssa->vars[i].phi_use_chain*/) in zend_jit_trace_allocate_registers()
2898 …&& !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()
2899 && ssa->vars[i].alias == NO_ALIAS in zend_jit_trace_allocate_registers()
2900 && zend_jit_var_supports_reg(ssa, i)) { in zend_jit_trace_allocate_registers()
2928 zend_ssa_phi *phi = ssa->blocks[1].phis; in zend_jit_trace_allocate_registers()
2933 if (ssa->vars[phi->ssa_var].use_chain >= 0 in zend_jit_trace_allocate_registers()
2934 && ssa->vars[phi->ssa_var].alias == NO_ALIAS in zend_jit_trace_allocate_registers()
2935 && zend_jit_var_supports_reg(ssa, phi->ssa_var)) { in zend_jit_trace_allocate_registers()
2945 ssa_op = ssa->ops; in zend_jit_trace_allocate_registers()
2954 zend_jit_opline_supports_reg(op_array, ssa, opline, ssa_op, p); in zend_jit_trace_allocate_registers()
2960 && ssa->vars[ssa_op->op1_def].alias != NO_ALIAS) { in zend_jit_trace_allocate_registers()
2973 ssa, ssa_opcodes, op_array, op_array_ssa); in zend_jit_trace_allocate_registers()
3005 ssa, ssa_opcodes, op_array, op_array_ssa); in zend_jit_trace_allocate_registers()
3021 ssa, ssa_opcodes, op_array, op_array_ssa); in zend_jit_trace_allocate_registers()
3040 && (ssa->vars[ssa_op->result_def].use_chain >= 0 in zend_jit_trace_allocate_registers()
3041 || ssa->vars[ssa_op->result_def].phi_use_chain) in zend_jit_trace_allocate_registers()
3042 && ssa->vars[ssa_op->result_def].alias == NO_ALIAS in zend_jit_trace_allocate_registers()
3043 && zend_jit_var_supports_reg(ssa, ssa_op->result_def)) { in zend_jit_trace_allocate_registers()
3044 if (!(ssa->var_info[ssa_op->result_def].type & MAY_BE_GUARD) in zend_jit_trace_allocate_registers()
3055 if (!(ssa->var_info[ssa_op->result_def].type & MAY_BE_DOUBLE) in zend_jit_trace_allocate_registers()
3064 && (ssa->vars[ssa_op->op1_def].use_chain >= 0 in zend_jit_trace_allocate_registers()
3065 || ssa->vars[ssa_op->op1_def].phi_use_chain) in zend_jit_trace_allocate_registers()
3066 && ssa->vars[ssa_op->op1_def].alias == NO_ALIAS in zend_jit_trace_allocate_registers()
3067 && zend_jit_var_supports_reg(ssa, ssa_op->op1_def) in zend_jit_trace_allocate_registers()
3068 && (!(ssa->var_info[ssa_op->op1_def].type & MAY_BE_GUARD) in zend_jit_trace_allocate_registers()
3078 && (ssa->vars[ssa_op->op2_def].use_chain >= 0 in zend_jit_trace_allocate_registers()
3079 || ssa->vars[ssa_op->op2_def].phi_use_chain) in zend_jit_trace_allocate_registers()
3080 && ssa->vars[ssa_op->op2_def].alias == NO_ALIAS in zend_jit_trace_allocate_registers()
3081 && zend_jit_var_supports_reg(ssa, ssa_op->op2_def) in zend_jit_trace_allocate_registers()
3082 && !(ssa->var_info[ssa_op->op2_def].type & MAY_BE_GUARD)) { in zend_jit_trace_allocate_registers()
3109 ssa, ssa_opcodes, op_array, op_array_ssa); in zend_jit_trace_allocate_registers()
3122 && (ssa->vars[ssa_op->op1_def].use_chain >= 0 in zend_jit_trace_allocate_registers()
3123 || ssa->vars[ssa_op->op1_def].phi_use_chain) in zend_jit_trace_allocate_registers()
3124 && ssa->vars[ssa_op->op1_def].alias == NO_ALIAS in zend_jit_trace_allocate_registers()
3125 && zend_jit_var_supports_reg(ssa, ssa_op->op1_def) in zend_jit_trace_allocate_registers()
3126 && !(ssa->var_info[ssa_op->op1_def].type & MAY_BE_GUARD)) { in zend_jit_trace_allocate_registers()
3195 op_array_ssa = &jit_extension->func_info.ssa; in zend_jit_trace_allocate_registers()
3200 if (ssa->vars[j].use_chain >= 0 in zend_jit_trace_allocate_registers()
3201 && ssa->vars[j].alias == NO_ALIAS in zend_jit_trace_allocate_registers()
3202 && zend_jit_var_supports_reg(ssa, j)) { in zend_jit_trace_allocate_registers()
3221 op_array_ssa = &jit_extension->func_info.ssa; in zend_jit_trace_allocate_registers()
3232 if (ssa->vars[j].use_chain >= 0 in zend_jit_trace_allocate_registers()
3233 && ssa->vars[j].alias == NO_ALIAS in zend_jit_trace_allocate_registers()
3234 && zend_jit_var_supports_reg(ssa, j) in zend_jit_trace_allocate_registers()
3235 && !(ssa->var_info[j].type & MAY_BE_GUARD)) { in zend_jit_trace_allocate_registers()
3253 zend_ssa_phi *phi = ssa->blocks[1].phis; in zend_jit_trace_allocate_registers()
3257 if (RA_HAS_IVAL(i) && !ssa->vars[phi->ssa_var].no_val) { in zend_jit_trace_allocate_registers()
3266 if (RA_HAS_IVAL(i) && !ssa->vars[i].phi_use_chain) { in zend_jit_trace_allocate_registers()
3277 for (i = 0; i < ssa->vars_count; i++) { in zend_jit_trace_allocate_registers()
3282 zend_ssa_next_use(ssa->ops, i, ssa->vars[i].use_chain) < 0) { in zend_jit_trace_allocate_registers()
3296 zend_ssa_phi *phi = ssa->blocks[1].phis; in zend_jit_trace_allocate_registers()
3306 && ssa->vars[def].use_chain >= 0 in zend_jit_trace_allocate_registers()
3307 && !ssa->vars[def].phi_use_chain in zend_jit_trace_allocate_registers()
3308 && zend_ssa_next_use(ssa->ops, def, ssa->vars[def].use_chain) < 0 in zend_jit_trace_allocate_registers()
3314 } else if ((ssa->var_info[def].type & MAY_BE_ANY) != (ssa->var_info[use].type & MAY_BE_ANY)) { in zend_jit_trace_allocate_registers()
3319 if (zend_jit_var_supports_reg(ssa, use)) { in zend_jit_trace_allocate_registers()
3329 if (ssa->vars[use].use_chain >= 0) { in zend_jit_trace_allocate_registers()
3355 for (i = 0; i < ssa->vars_count; i++) { in zend_jit_trace_allocate_registers()
3358 uint32_t var_num = ssa->vars[i].var; in zend_jit_trace_allocate_registers()
3382 … *stack, const zend_op *opline, const zend_ssa_op *ssa_op, const zend_ssa *ssa, const zend_op **ss… in zend_jit_trace_cleanup_stack() argument
3388 …|| zend_ssa_is_no_val_use(ssa_opcodes[ssa_op->op1_use_chain], ssa->ops + ssa_op->op1_use_chain, ss… in zend_jit_trace_cleanup_stack()
3396 …|| zend_ssa_is_no_val_use(ssa_opcodes[ssa_op->op2_use_chain], ssa->ops + ssa_op->op2_use_chain, ss… in zend_jit_trace_cleanup_stack()
3405 …|| zend_ssa_is_no_val_use(ssa_opcodes[ssa_op->res_use_chain], ssa->ops + ssa_op->res_use_chain, ss… in zend_jit_trace_cleanup_stack()
3426 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
3430 int use = ssa->vars[var].use_chain; in zend_jit_may_delay_fetch_this()
3434 || ssa->vars[var].phi_use_chain in zend_jit_may_delay_fetch_this()
3435 || ssa->ops[use].op1_use != var in zend_jit_may_delay_fetch_this()
3436 || ssa->ops[use].op1_use_chain != -1) { in zend_jit_may_delay_fetch_this()
3482 for (i = ssa->vars[var].definition; i < use; i++) { in zend_jit_may_delay_fetch_this()
3530 zend_ssa *ssa, in zend_jit_trace_deoptimization() argument
3576 ssa->var_info[i].delayed_fetch_this = 1; in zend_jit_trace_deoptimization()
3591 if (ssa && ssa->vars[i].no_val) { in zend_jit_trace_deoptimization()
3614 if (ssa && ssa->vars[i].no_val) { in zend_jit_trace_deoptimization()
3697 …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
3721 &ssa->var_info[ssa_op->op1_use], in zend_jit_trace_update_condition_ranges()
3727 &ssa->var_info[ssa_op->op2_use], in zend_jit_trace_update_condition_ranges()
3738 &ssa->var_info[ssa_op->op1_use], in zend_jit_trace_update_condition_ranges()
3744 &ssa->var_info[ssa_op->op2_use], in zend_jit_trace_update_condition_ranges()
3755 &ssa->var_info[ssa_op->op1_use], in zend_jit_trace_update_condition_ranges()
3761 &ssa->var_info[ssa_op->op2_use], in zend_jit_trace_update_condition_ranges()
3769 &ssa->var_info[ssa_op->op1_use], in zend_jit_trace_update_condition_ranges()
3775 &ssa->var_info[ssa_op->op2_use], in zend_jit_trace_update_condition_ranges()
3786 &ssa->var_info[ssa_op->op1_use], in zend_jit_trace_update_condition_ranges()
3792 &ssa->var_info[ssa_op->op2_use], in zend_jit_trace_update_condition_ranges()
3800 &ssa->var_info[ssa_op->op1_use], in zend_jit_trace_update_condition_ranges()
3806 &ssa->var_info[ssa_op->op2_use], in zend_jit_trace_update_condition_ranges()
3815 …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
3825 opline = ssa_opcodes[ssa_op - ssa->ops]; in zend_jit_may_skip_comparison()
3835 opline = ssa_opcodes[ssa_op - ssa->ops]; in zend_jit_may_skip_comparison()
3850 opline = ssa_opcodes[ssa_op - ssa->ops]; in zend_jit_may_skip_comparison()
3860 opline = ssa_opcodes[ssa_op - ssa->ops]; in zend_jit_may_skip_comparison()
3871 prev_opcode = ssa_opcodes[prev_ssa_op - ssa->ops]->opcode; in zend_jit_may_skip_comparison()
3874 && prev_ssa_op != ssa->ops in zend_jit_may_skip_comparison()
3878 prev_opcode = ssa_opcodes[prev_ssa_op - ssa->ops]->opcode; in zend_jit_may_skip_comparison()
3892 … opline->op1) != RT_CONSTANT(&ssa_opcodes[prev_ssa_op - ssa->ops], ssa_opcodes[prev_ssa_op - ssa->… in zend_jit_may_skip_comparison()
3897 … opline->op2) != RT_CONSTANT(&ssa_opcodes[prev_ssa_op - ssa->ops], ssa_opcodes[prev_ssa_op - ssa->… in zend_jit_may_skip_comparison()
3938 const zend_ssa *ssa, in zend_jit_find_ssa_var() argument
3942 int ssa_var, j, b = ssa->cfg.map[opline_num]; in zend_jit_find_ssa_var()
3943 const zend_basic_block *bb = ssa->cfg.blocks + b; in zend_jit_find_ssa_var()
3950 ssa_op = ssa->ops + opline_num; in zend_jit_find_ssa_var()
3952 if (ssa_var >= 0 && ssa->vars[ssa_var].var == var_num) { in zend_jit_find_ssa_var()
3956 if (ssa_var >= 0 && ssa->vars[ssa_var].var == var_num) { in zend_jit_find_ssa_var()
3960 if (ssa_var >= 0 && ssa->vars[ssa_var].var == var_num) { in zend_jit_find_ssa_var()
3968 phi = ssa->blocks[b].phis; in zend_jit_find_ssa_var()
3984 ZEND_WORKLIST_ALLOCA(&worklist, ssa->cfg.blocks_count, use_heap); in zend_jit_find_ssa_var()
3987 b = ssa->cfg.predecessors[bb->predecessor_offset + j]; in zend_jit_find_ssa_var()
3993 bb = &ssa->cfg.blocks[b]; in zend_jit_find_ssa_var()
3997 ssa_op = ssa->ops + opline_num; in zend_jit_find_ssa_var()
3999 if (ssa_var >= 0 && ssa->vars[ssa_var].var == var_num) { in zend_jit_find_ssa_var()
4003 if (ssa_var >= 0 && ssa->vars[ssa_var].var == var_num) { in zend_jit_find_ssa_var()
4007 if (ssa_var >= 0 && ssa->vars[ssa_var].var == var_num) { in zend_jit_find_ssa_var()
4016 phi = ssa->blocks[b].phis; in zend_jit_find_ssa_var()
4028 b = ssa->cfg.predecessors[bb->predecessor_offset + j]; in zend_jit_find_ssa_var()
4040 const zend_ssa *ssa, in zend_jit_trace_must_store_type() argument
4045 if (ssa->var_info) { in zend_jit_trace_must_store_type()
4046 int ssa_var = zend_jit_find_ssa_var(op_array, ssa, opline_num, var_num); in zend_jit_trace_must_store_type()
4049 if ((ssa->var_info[ssa_var].type & (MAY_BE_ANY|MAY_BE_UNDEF)) != (1U << type)) { in zend_jit_trace_must_store_type()
4060 const zend_ssa *ssa, in zend_jit_trace_may_throw() argument
4081 return zend_may_throw_ex(opline, ssa_op, op_array, ssa, t1, t2); in zend_jit_trace_may_throw()
4094 zend_ssa *ssa, *op_array_ssa; in zend_jit_trace() local
4129 …ssa = zend_jit_trace_build_tssa(trace_buffer, parent_trace, exit_num, script, op_arrays, &num_op_a… in zend_jit_trace()
4131 if (!ssa) { in zend_jit_trace()
4135 ssa_opcodes = ((zend_tssa*)ssa)->tssa_opcodes; in zend_jit_trace()
4140 zend_jit_trace_start(&ctx, op_array, ssa, name, ZEND_JIT_TRACE_NUM, in zend_jit_trace()
4147 ctx.ra = ra = zend_jit_trace_allocate_registers(trace_buffer, ssa, parent_trace, exit_num); in zend_jit_trace()
4167 op_array_ssa = &jit_extension->func_info.ssa; in zend_jit_trace()
4184 int used_stack = ((zend_tssa*)ssa)->used_stack; in zend_jit_trace()
4209 uint32_t info = ssa->var_info[i].type; in zend_jit_trace()
4225 } else if (ssa->vars[i].alias != NO_ALIAS) { in zend_jit_trace()
4230 ZEND_ASSERT(ssa->vars[i].use_chain < 0 && !ssa->vars[i].phi_use_chain); in zend_jit_trace()
4237 && (ssa->vars[i].use_chain != -1 in zend_jit_trace()
4238 || (ssa->vars[i].phi_use_chain in zend_jit_trace()
4239 && !(ssa->var_info[ssa->vars[i].phi_use_chain->ssa_var].type & MAY_BE_GUARD)))) { in zend_jit_trace()
4245 ssa->var_info[i].type = info; in zend_jit_trace()
4259 && (ssa->vars[i].use_chain != -1 in zend_jit_trace()
4260 || (ssa->vars[i].phi_use_chain in zend_jit_trace()
4261 && !(ssa->var_info[ssa->vars[i].phi_use_chain->ssa_var].type & MAY_BE_PACKED_GUARD)))) { in zend_jit_trace()
4266 ssa->var_info[i].type = info; in zend_jit_trace()
4275 parent_stack, parent_vars_count, ssa, stack, in zend_jit_trace()
4292 if ((ssa->var_info[i].type & MAY_BE_GUARD) != 0) { in zend_jit_trace()
4295 ssa->var_info[i].type &= ~MAY_BE_GUARD; in zend_jit_trace()
4296 op_type = concrete_type(ssa->var_info[i].type); in zend_jit_trace()
4304 if (!zend_jit_load_var(&ctx, ssa->var_info[i].type, i, i)) { in zend_jit_trace()
4323 zend_ssa_phi *phi = ssa->blocks[1].phis; in zend_jit_trace()
4335 phi = ssa->blocks[1].phis; in zend_jit_trace()
4339 uint32_t info = ssa->var_info[phi->ssa_var].type; in zend_jit_trace()
4346 ssa->var_info[phi->ssa_var].type = info; in zend_jit_trace()
4349 …if (!zend_jit_load_var(&ctx, ssa->var_info[phi->ssa_var].type, ssa->vars[phi->ssa_var].var, phi->s… in zend_jit_trace()
4355 …if (!zend_jit_store_var(&ctx, ssa->var_info[phi->ssa_var].type, ssa->vars[phi->ssa_var].var, phi->… in zend_jit_trace()
4356 STACK_MEM_TYPE(stack, phi->var) != ssa->var_info[phi->ssa_var].type)) { in zend_jit_trace()
4382 ssa_op = (JIT_G(opt_level) >= ZEND_JIT_LEVEL_INLINE) ? ssa->ops : NULL; 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()
4481 ssa->var_info[ssa_op->op1_def].type &= ~MAY_BE_GUARD; in zend_jit_trace()
4483 ssa->var_info[ssa_op->result_def].type &= ~MAY_BE_GUARD; in zend_jit_trace()
4487 ssa->var_info[ssa_op->op1_def].type &= ~MAY_BE_GUARD; in zend_jit_trace()
4489 ssa->var_info[ssa_op->result_def].type &= ~MAY_BE_GUARD; in zend_jit_trace()
4495 ssa->var_info[ssa_op->result_def].type &= ~MAY_BE_GUARD; in zend_jit_trace()
4499 ssa->var_info[ssa_op->result_def].type &= ~MAY_BE_GUARD; in zend_jit_trace()
4537 zend_may_throw(opline, ssa_op, op_array, ssa))) { in zend_jit_trace()
4565 !ssa->var_info[ssa_op->op1_use].guarded_reference, 1)) { in zend_jit_trace()
4568 if (ssa->vars[ssa_op->op1_use].alias == NO_ALIAS) { in zend_jit_trace()
4569 ssa->var_info[ssa_op->op1_use].guarded_reference = 1; in zend_jit_trace()
4579 !ssa->var_info[ssa_op->op2_use].guarded_reference, 1)) { in zend_jit_trace()
4582 if (ssa->vars[ssa_op->op2_use].alias == NO_ALIAS) { in zend_jit_trace()
4583 ssa->var_info[ssa_op->op2_use].guarded_reference = 1; in zend_jit_trace()
4612 …) && (res_info & (MAY_BE_DOUBLE|MAY_BE_GUARD)) && zend_may_overflow(opline, ssa_op, op_array, ssa); in zend_jit_trace()
4622 zend_jit_trace_cleanup_stack(&ctx, stack, opline, ssa_op, ssa, ssa_opcodes); in zend_jit_trace()
4629 zend_may_throw(opline, ssa_op, op_array, ssa))) { in zend_jit_trace()
4638 ssa->var_info[ssa_op->result_def].type &= ~MAY_BE_GUARD; in zend_jit_trace()
4665 zend_may_throw(opline, ssa_op, op_array, ssa))) { in zend_jit_trace()
4699 … (op1_def_info & (MAY_BE_DOUBLE|MAY_BE_GUARD)) && zend_may_overflow(opline, ssa_op, op_array, ssa), in zend_jit_trace()
4700 zend_may_throw(opline, ssa_op, op_array, ssa))) { in zend_jit_trace()
4706 ssa->var_info[ssa_op->op1_def].type &= ~MAY_BE_GUARD; in zend_jit_trace()
4708 ssa->var_info[ssa_op->result_def].type &= ~MAY_BE_GUARD; in zend_jit_trace()
4734 &op1_info, &op1_addr, !ssa->var_info[ssa_op->op1_use].indirect_reference)) { in zend_jit_trace()
4742 !ssa->var_info[ssa_op->op1_use].guarded_reference, 1)) { in zend_jit_trace()
4746 && ssa->vars[ssa_op->op1_def].alias == NO_ALIAS) { in zend_jit_trace()
4747 ssa->var_info[ssa_op->op1_def].guarded_reference = 1; in zend_jit_trace()
4762 zend_jit_trace_may_throw(opline, ssa_op, op_array, ssa, in zend_jit_trace()
4794 delayed_fetch_this = ssa->var_info[ssa_op->op1_use].delayed_fetch_this; in zend_jit_trace()
4806 &op1_info, &op1_addr, !ssa->var_info[ssa_op->op1_use].indirect_reference)) { in zend_jit_trace()
4814 !ssa->var_info[ssa_op->op1_use].guarded_reference, 1)) { in zend_jit_trace()
4818 && ssa->vars[ssa_op->op1_def].alias == NO_ALIAS) { in zend_jit_trace()
4819 ssa->var_info[ssa_op->op1_def].guarded_reference = 1; in zend_jit_trace()
4827 if (ssa->var_info && ssa->ops) { in zend_jit_trace()
4829 zend_ssa_var_info *op1_ssa = ssa->var_info + ssa_op->op1_use; in zend_jit_trace()
4838 } else if (ssa_op->op1_use >= 0 && ssa->vars[ssa_op->op1_use].definition >= 0) { in zend_jit_trace()
4839 on_this = ssa_opcodes[ssa->vars[ssa_op->op1_use].definition]->opcode == ZEND_FETCH_THIS; in zend_jit_trace()
4847 if (!zend_jit_incdec_obj(&ctx, opline, op_array, ssa, ssa_op, in zend_jit_trace()
4888 delayed_fetch_this = ssa->var_info[ssa_op->op1_use].delayed_fetch_this; in zend_jit_trace()
4900 &op1_info, &op1_addr, !ssa->var_info[ssa_op->op1_use].indirect_reference)) { in zend_jit_trace()
4908 !ssa->var_info[ssa_op->op1_use].guarded_reference, 1)) { in zend_jit_trace()
4912 && ssa->vars[ssa_op->op1_def].alias == NO_ALIAS) { in zend_jit_trace()
4913 ssa->var_info[ssa_op->op1_def].guarded_reference = 1; in zend_jit_trace()
4921 if (ssa->var_info && ssa->ops) { in zend_jit_trace()
4923 zend_ssa_var_info *op1_ssa = ssa->var_info + ssa_op->op1_use; in zend_jit_trace()
4932 } else if (ssa_op->op1_use >= 0 && ssa->vars[ssa_op->op1_use].definition >= 0) { in zend_jit_trace()
4933 on_this = ssa_opcodes[ssa->vars[ssa_op->op1_use].definition]->opcode == ZEND_FETCH_THIS; in zend_jit_trace()
4943 if (!zend_jit_assign_obj_op(&ctx, opline, op_array, ssa, ssa_op, in zend_jit_trace()
4971 delayed_fetch_this = ssa->var_info[ssa_op->op1_use].delayed_fetch_this; in zend_jit_trace()
4983 &op1_info, &op1_addr, !ssa->var_info[ssa_op->op1_use].indirect_reference)) { in zend_jit_trace()
4991 !ssa->var_info[ssa_op->op1_use].guarded_reference, 1)) { in zend_jit_trace()
4995 && ssa->vars[ssa_op->op1_def].alias == NO_ALIAS) { in zend_jit_trace()
4996 ssa->var_info[ssa_op->op1_def].guarded_reference = 1; in zend_jit_trace()
5004 if (ssa->var_info && ssa->ops) { in zend_jit_trace()
5006 zend_ssa_var_info *op1_ssa = ssa->var_info + ssa_op->op1_use; in zend_jit_trace()
5015 } else if (ssa_op->op1_use >= 0 && ssa->vars[ssa_op->op1_use].definition >= 0) { in zend_jit_trace()
5016 on_this = ssa_opcodes[ssa->vars[ssa_op->op1_use].definition]->opcode == ZEND_FETCH_THIS; in zend_jit_trace()
5026 if (!zend_jit_assign_obj(&ctx, opline, op_array, ssa, ssa_op, in zend_jit_trace()
5031 zend_may_throw(opline, ssa_op, op_array, ssa))) { in zend_jit_trace()
5036 && ssa->vars[(ssa_op+1)->op1_def].alias == NO_ALIAS) { in zend_jit_trace()
5037 …ssa->var_info[(ssa_op+1)->op1_def].guarded_reference = ssa->var_info[(ssa_op+1)->op1_use].guarded_… in zend_jit_trace()
5055 &op1_info, &op1_addr, !ssa->var_info[ssa_op->op1_use].indirect_reference)) { in zend_jit_trace()
5063 !ssa->var_info[ssa_op->op1_use].guarded_reference, 1)) { in zend_jit_trace()
5067 && ssa->vars[ssa_op->op1_def].alias == NO_ALIAS) { in zend_jit_trace()
5068 ssa->var_info[ssa_op->op1_def].guarded_reference = 1; in zend_jit_trace()
5085 zend_may_throw_ex(opline, ssa_op, op_array, ssa, op1_info, op2_info))) { in zend_jit_trace()
5090 && ssa->vars[(ssa_op+1)->op1_def].alias == NO_ALIAS) { in zend_jit_trace()
5091 …ssa->var_info[(ssa_op+1)->op1_def].guarded_reference = ssa->var_info[(ssa_op+1)->op1_use].guarded_… in zend_jit_trace()
5105 … if (ssa_op->op2_def < 0 || (Z_MODE(op2_addr) == IS_REG && ssa->vars[ssa_op->op2_def].no_val)) { in zend_jit_trace()
5135 !ssa->var_info[ssa_op->op1_use].guarded_reference)) { in zend_jit_trace()
5140 && ssa->vars[ssa_op->op1_def].alias == NO_ALIAS) { in zend_jit_trace()
5141 ssa->var_info[ssa_op->op1_def].guarded_reference = 1; in zend_jit_trace()
5187 zend_may_throw_ex(opline, ssa_op, op_array, ssa, op1_info, op2_info))) { in zend_jit_trace()
5192 && ssa->vars[ssa_op->op2_def].no_val) { in zend_jit_trace()
5197 && ssa->vars[ssa_op->op2_def].use_chain < 0 in zend_jit_trace()
5198 && !ssa->vars[ssa_op->op2_def].phi_use_chain) { in zend_jit_trace()
5207 && ssa->vars[ssa_op->op2_def].alias == NO_ALIAS) { in zend_jit_trace()
5208 …ssa->var_info[ssa_op->op2_def].guarded_reference = ssa->var_info[ssa_op->op2_use].guarded_referenc… in zend_jit_trace()
5218 … if (ssa_op->op1_def < 0 || (Z_MODE(op1_addr) == IS_REG && ssa->vars[ssa_op->op1_def].no_val)) { in zend_jit_trace()
5245 && ssa->vars[ssa_op->op1_def].no_val) { in zend_jit_trace()
5250 && ssa->vars[ssa_op->op1_def].use_chain < 0 in zend_jit_trace()
5251 && !ssa->vars[ssa_op->op1_def].phi_use_chain) { in zend_jit_trace()
5260 && ssa->vars[ssa_op->op1_def].alias == NO_ALIAS) { in zend_jit_trace()
5261 …ssa->var_info[ssa_op->op1_def].guarded_reference = ssa->var_info[ssa_op->op1_use].guarded_referenc… in zend_jit_trace()
5268 …fg.map ? op_array_ssa->cfg.map[opline - op_array->opcodes] : -1, op_array, ssa, ssa_op, frame->cal… in zend_jit_trace()
5310 && ssa->vars[ssa_op->op1_def].alias == NO_ALIAS) { in zend_jit_trace()
5311 ssa->var_info[ssa_op->op1_def].guarded_reference = 1; in zend_jit_trace()
5329 … if (ssa_op->op1_def < 0 || (Z_MODE(op1_addr) == IS_REG && ssa->vars[ssa_op->op1_def].no_val)) { in zend_jit_trace()
5342 && ssa->vars[ssa_op->op1_def].no_val) { in zend_jit_trace()
5347 && ssa->vars[ssa_op->op1_def].use_chain < 0 in zend_jit_trace()
5348 && !ssa->vars[ssa_op->op1_def].phi_use_chain) { in zend_jit_trace()
5357 && ssa->vars[ssa_op->op1_def].alias == NO_ALIAS) { in zend_jit_trace()
5358 …ssa->var_info[ssa_op->op1_def].guarded_reference = ssa->var_info[ssa_op->op1_use].guarded_referenc… in zend_jit_trace()
5415 ssa_op != ssa->ops && in zend_jit_trace()
5418 zend_jit_may_skip_comparison(opline, ssa_op, ssa, ssa_opcodes, op_array); in zend_jit_trace()
5427 zend_jit_trace_cleanup_stack(&ctx, stack, opline, ssa_op, ssa, ssa_opcodes); 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()
5451 zend_may_throw(opline, ssa_op, op_array, ssa), in zend_jit_trace()
5463 ssa_op != ssa->ops && in zend_jit_trace()
5466 zend_jit_may_skip_comparison(opline, ssa_op, ssa, ssa_opcodes, op_array); in zend_jit_trace()
5475 zend_jit_trace_cleanup_stack(&ctx, stack, opline, ssa_op, ssa, ssa_opcodes); 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()
5502 zend_may_throw(opline, ssa_op, op_array, ssa), in zend_jit_trace()
5540 zend_jit_trace_cleanup_stack(&ctx, stack, opline, ssa_op, ssa, ssa_opcodes); in zend_jit_trace()
5572 …_jit_trace_handler(&ctx, op_array, opline, zend_may_throw(opline, ssa_op, op_array, ssa), p + 1)) { in zend_jit_trace()
5641 zend_may_throw(opline, ssa_op, op_array, ssa), in zend_jit_trace()
5676 zend_jit_trace_cleanup_stack(&ctx, stack, opline, ssa_op, ssa, ssa_opcodes); in zend_jit_trace()
5711 zend_may_throw(opline, ssa_op, op_array, ssa), in zend_jit_trace()
5753 !ssa->var_info[ssa_op->op1_use].guarded_reference, 1)) { in zend_jit_trace()
5757 && ssa->vars[ssa_op->op1_use].alias == NO_ALIAS) { in zend_jit_trace()
5758 ssa->var_info[ssa_op->op1_use].guarded_reference = 1; in zend_jit_trace()
5829 !ssa->var_info[ssa_op->op1_use].guarded_reference, 1)) { in zend_jit_trace()
5833 && ssa->vars[ssa_op->op1_use].alias == NO_ALIAS) { in zend_jit_trace()
5834 ssa->var_info[ssa_op->op1_use].guarded_reference = 1; in zend_jit_trace()
5836 ssa->var_info[ssa_op->op1_def].guarded_reference = 1; in zend_jit_trace()
5847 ssa->var_info[ssa_op->op1_use].avoid_refcounting; in zend_jit_trace()
5849 ssa->var_info[ssa_op->op1_use].type &= ~MAY_BE_PACKED_GUARD; in zend_jit_trace()
5859 … ssa->var_info[ssa_op->op1_use].type &= ~(MAY_BE_ARRAY_NUMERIC_HASH|MAY_BE_ARRAY_STRING_HASH); in zend_jit_trace()
5864 ssa->var_info[ssa_op->op1_use].type &= ~MAY_BE_ARRAY_PACKED; in zend_jit_trace()
5868 if (!zend_jit_fetch_dim_read(&ctx, opline, ssa, ssa_op, in zend_jit_trace()
5875 ssa->var_info[ssa_op->op1_def].type = ssa->var_info[ssa_op->op1_use].type; in zend_jit_trace()
5893 &op1_info, &op1_addr, !ssa->var_info[ssa_op->op1_use].indirect_reference)) { in zend_jit_trace()
5903 !ssa->var_info[ssa_op->op1_use].guarded_reference, 1)) { in zend_jit_trace()
5907 && ssa->vars[ssa_op->op1_def].alias == NO_ALIAS) { in zend_jit_trace()
5908 ssa->var_info[ssa_op->op1_def].guarded_reference = 1; in zend_jit_trace()
5927 ssa->var_info[ssa_op->result_def].indirect_reference = 1; in zend_jit_trace()
5940 !ssa->var_info[ssa_op->op1_use].guarded_reference, 1)) { in zend_jit_trace()
5944 && ssa->vars[ssa_op->op1_use].alias == NO_ALIAS) { in zend_jit_trace()
5945 ssa->var_info[ssa_op->op1_use].guarded_reference = 1; in zend_jit_trace()
5964 zend_jit_trace_cleanup_stack(&ctx, stack, opline, ssa_op, ssa, ssa_opcodes); in zend_jit_trace()
5967 && ssa->var_info[ssa_op->op1_use].avoid_refcounting) { in zend_jit_trace()
5991 ssa->var_info[ssa_op->op1_use].avoid_refcounting; in zend_jit_trace()
5993 ssa->var_info[ssa_op->op1_use].type &= ~MAY_BE_PACKED_GUARD; in zend_jit_trace()
6009 zend_may_throw_ex(opline, ssa_op, op_array, ssa, op1_info, op2_info), in zend_jit_trace()
6057 &op1_info, &op1_addr, !ssa->var_info[ssa_op->op1_use].indirect_reference)) { in zend_jit_trace()
6065 !ssa->var_info[ssa_op->op1_use].guarded_reference, 1)) { in zend_jit_trace()
6069 && ssa->vars[ssa_op->op1_use].alias == NO_ALIAS) { in zend_jit_trace()
6070 … ssa->var_info[ssa_op->op1_def >= 0 ? ssa_op->op1_def : ssa_op->op1_use].guarded_reference = 1; in zend_jit_trace()
6078 if (ssa->var_info && ssa->ops) { in zend_jit_trace()
6080 zend_ssa_var_info *op1_ssa = ssa->var_info + ssa_op->op1_use; in zend_jit_trace()
6088 delayed_fetch_this = ssa->var_info[ssa_op->op1_use].delayed_fetch_this; in zend_jit_trace()
6089 avoid_refcounting = ssa->var_info[ssa_op->op1_use].avoid_refcounting; in zend_jit_trace()
6093 } else if (ssa_op->op1_use >= 0 && ssa->vars[ssa_op->op1_use].definition >= 0) { in zend_jit_trace()
6094 on_this = ssa_opcodes[ssa->vars[ssa_op->op1_use].definition]->opcode == ZEND_FETCH_THIS; 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()
6137 if (!ssa->ops || !ssa->var_info) { in zend_jit_trace()
6142 if (ssa->vars[ssa_op->op1_def].alias == NO_ALIAS) { in zend_jit_trace()
6143 ssa->var_info[ssa_op->op1_def].guarded_reference = 1; in zend_jit_trace()
6169 zend_may_throw(opline, ssa_op, op_array, ssa))) { in zend_jit_trace()
6186 zend_may_throw(opline, ssa_op, op_array, ssa))) { in zend_jit_trace()
6205 !ssa->var_info[ssa_op->op1_use].guarded_reference, 1)) { in zend_jit_trace()
6209 && ssa->vars[ssa_op->op1_use].alias == NO_ALIAS) { in zend_jit_trace()
6210 ssa->var_info[ssa_op->op1_use].guarded_reference = 1; in zend_jit_trace()
6227 !ssa->var_info[ssa_op->op1_use].guarded_reference, 1)) { in zend_jit_trace()
6231 && ssa->vars[ssa_op->op1_use].alias == NO_ALIAS) { in zend_jit_trace()
6232 ssa->var_info[ssa_op->op1_use].guarded_reference = 1; in zend_jit_trace()
6240 …&ctx, opline, op1_info, op1_addr, RES_REG_ADDR(), zend_may_throw(opline, ssa_op, op_array, ssa))) { in zend_jit_trace()
6247 if (zend_jit_may_delay_fetch_this(op_array, ssa, ssa_opcodes, ssa_op)) { in zend_jit_trace()
6248 ssa->var_info[ssa_op->result_def].delayed_fetch_this = 1; in zend_jit_trace()
6330 if (!zend_jit_fetch_constant(&ctx, opline, op_array, ssa, ssa_op, RES_REG_ADDR())) { in zend_jit_trace()
6359 !ssa->var_info[ssa_op->op1_use].guarded_reference, 1)) { in zend_jit_trace()
6363 && ssa->vars[ssa_op->op1_use].alias == NO_ALIAS) { in zend_jit_trace()
6364 ssa->var_info[ssa_op->op1_use].guarded_reference = 1; in zend_jit_trace()
6369 if (ssa->var_info && ssa->ops) { in zend_jit_trace()
6371 zend_ssa_var_info *op1_ssa = ssa->var_info + ssa_op->op1_use; in zend_jit_trace()
6379 delayed_fetch_this = ssa->var_info[ssa_op->op1_use].delayed_fetch_this; in zend_jit_trace()
6383 } else if (ssa_op->op1_use >= 0 && ssa->vars[ssa_op->op1_use].definition >= 0) { in zend_jit_trace()
6384 on_this = ssa_opcodes[ssa->vars[ssa_op->op1_use].definition]->opcode == ZEND_FETCH_THIS; in zend_jit_trace()
6395 op_array, ssa, ssa_op, frame->call_level, in zend_jit_trace()
6414 op_array, ssa, ssa_op, frame->call_level, in zend_jit_trace()
6426 …fg.map ? op_array_ssa->cfg.map[opline - op_array->opcodes] : -1, op_array, ssa, ssa_op, frame->cal… 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()
6510 zend_jit_trace_cleanup_stack(&ctx, stack, opline, ssa_op, ssa, ssa_opcodes); in zend_jit_trace()
6542 } else if (!(ssa->var_info[ssa_op->result_def].type & MAY_BE_GUARD) in zend_jit_trace()
6543 && has_concrete_type(ssa->var_info[ssa_op->result_def].type)) { in zend_jit_trace()
6544 type = concrete_type(ssa->var_info[ssa_op->result_def].type); in zend_jit_trace()
6554 && (ssa->var_info[ssa_op->op1_use].type & MAY_BE_REF) == 0) { in zend_jit_trace()
6604 if (zend_may_throw(q->opline, next_ssa_op, op_array, ssa)) { in zend_jit_trace()
6624 if (ssa->var_info[ssa_op->result_def].type & MAY_BE_INDIRECT) { in zend_jit_trace()
6628 ssa->var_info[ssa_op->result_def].type &= ~MAY_BE_GUARD; in zend_jit_trace()
6632 } else if (ssa->var_info[ssa_op->result_def].avoid_refcounting) { in zend_jit_trace()
6642 && zend_inference_propagate_range(op_array, ssa, opline, ssa_op, ssa_op->result_def, &tmp)) { in zend_jit_trace()
6643 ssa->var_info[ssa_op->result_def].range.min = tmp.min; in zend_jit_trace()
6644 ssa->var_info[ssa_op->result_def].range.max = tmp.max; in zend_jit_trace()
6645 ssa->var_info[ssa_op->result_def].range.underflow = 0; in zend_jit_trace()
6646 ssa->var_info[ssa_op->result_def].range.overflow = 0; in zend_jit_trace()
6647 ssa->var_info[ssa_op->result_def].has_range = 1; in zend_jit_trace()
6656 if (!(ssa->var_info[ssa_op->op1_def].type & MAY_BE_GUARD) in zend_jit_trace()
6657 && has_concrete_type(ssa->var_info[ssa_op->op1_def].type)) { in zend_jit_trace()
6658 type = concrete_type(ssa->var_info[ssa_op->op1_def].type); in zend_jit_trace()
6680 !(ssa->vars[ssa_op->op1_def].no_val && in zend_jit_trace()
6689 ssa->var_info[ssa_op->op1_def].type &= ~MAY_BE_GUARD; in zend_jit_trace()
6710 && zend_inference_propagate_range(op_array, ssa, opline, ssa_op, ssa_op->op1_def, &tmp)) { in zend_jit_trace()
6711 ssa->var_info[ssa_op->op1_def].range.min = tmp.min; in zend_jit_trace()
6712 ssa->var_info[ssa_op->op1_def].range.max = tmp.max; in zend_jit_trace()
6713 ssa->var_info[ssa_op->op1_def].range.underflow = 0; in zend_jit_trace()
6714 ssa->var_info[ssa_op->op1_def].range.overflow = 0; in zend_jit_trace()
6715 ssa->var_info[ssa_op->op1_def].has_range = 1; in zend_jit_trace()
6724 if (!(ssa->var_info[ssa_op->op2_def].type & MAY_BE_GUARD) in zend_jit_trace()
6725 && has_concrete_type(ssa->var_info[ssa_op->op2_def].type)) { in zend_jit_trace()
6726 type = concrete_type(ssa->var_info[ssa_op->op2_def].type); in zend_jit_trace()
6734 !(ssa->vars[ssa_op->op2_def].no_val && in zend_jit_trace()
6738 ssa->var_info[ssa_op->op2_def].type &= ~MAY_BE_GUARD; in zend_jit_trace()
6754 && zend_inference_propagate_range(op_array, ssa, opline, ssa_op, ssa_op->op2_def, &tmp)) { in zend_jit_trace()
6755 ssa->var_info[ssa_op->op2_def].range.min = tmp.min; in zend_jit_trace()
6756 ssa->var_info[ssa_op->op2_def].range.max = tmp.max; in zend_jit_trace()
6757 ssa->var_info[ssa_op->op2_def].range.underflow = 0; in zend_jit_trace()
6758 ssa->var_info[ssa_op->op2_def].range.overflow = 0; in zend_jit_trace()
6759 ssa->var_info[ssa_op->op2_def].has_range = 1; in zend_jit_trace()
6778 if (!(ssa->var_info[ssa_op->op1_def].type & MAY_BE_GUARD) in zend_jit_trace()
6779 && has_concrete_type(ssa->var_info[ssa_op->op1_def].type)) { in zend_jit_trace()
6780 type = concrete_type(ssa->var_info[ssa_op->op1_def].type); in zend_jit_trace()
6790 ssa->var_info[ssa_op->op1_def].type &= ~MAY_BE_GUARD; in zend_jit_trace()
6797 && zend_inference_propagate_range(op_array, ssa, opline, ssa_op, ssa_op->op1_def, &tmp)) { in zend_jit_trace()
6798 ssa->var_info[ssa_op->op1_def].range.min = tmp.min; in zend_jit_trace()
6799 ssa->var_info[ssa_op->op1_def].range.max = tmp.max; in zend_jit_trace()
6800 ssa->var_info[ssa_op->op1_def].range.underflow = 0; in zend_jit_trace()
6801 ssa->var_info[ssa_op->op1_def].range.overflow = 0; in zend_jit_trace()
6802 ssa->var_info[ssa_op->op1_def].has_range = 1; in zend_jit_trace()
6814 if (!(ssa->var_info[ssa_op->result_def].type & MAY_BE_GUARD) in zend_jit_trace()
6815 && has_concrete_type(ssa->var_info[ssa_op->result_def].type)) { in zend_jit_trace()
6816 type = concrete_type(ssa->var_info[ssa_op->result_def].type); in zend_jit_trace()
6836 if (!(ssa->var_info[ssa_op->op1_def].type & MAY_BE_GUARD) in zend_jit_trace()
6837 && has_concrete_type(ssa->var_info[ssa_op->op1_def].type)) { in zend_jit_trace()
6838 type = concrete_type(ssa->var_info[ssa_op->op1_def].type); in zend_jit_trace()
6914 op_array_ssa = &jit_extension->func_info.ssa; in zend_jit_trace()
6929 if ((ssa->var_info[j].type & MAY_BE_GUARD) != 0) { in zend_jit_trace()
6932 ssa->var_info[j].type &= ~MAY_BE_GUARD; in zend_jit_trace()
6933 op_type = concrete_type(ssa->var_info[j].type); in zend_jit_trace()
6939 if (!zend_jit_load_var(&ctx, ssa->var_info[j].type, i, j)) { in zend_jit_trace()
6951 op_array_ssa = &jit_extension->func_info.ssa; in zend_jit_trace()
6969 if (!(ssa->var_info[j].type & MAY_BE_GUARD) in zend_jit_trace()
6970 && has_concrete_type(ssa->var_info[j].type)) { in zend_jit_trace()
6971 SET_STACK_TYPE(stack, i, concrete_type(ssa->var_info[j].type), 1); in zend_jit_trace()
6980 if (!zend_jit_load_var(&ctx, ssa->var_info[j].type, i, j)) { in zend_jit_trace()
7030 && ssa->var_info[(ssa_op-1)->op1_use].delayed_fetch_this)) in zend_jit_trace()
7061 && zend_jit_var_may_alias(p->op_array, &jit_extension->func_info.ssa, i) != NO_ALIAS) { in zend_jit_trace()
7183 zend_ssa_phi *phi = ssa->blocks[1].phis; in zend_jit_trace()
7387 memset(&jit_extension->func_info.ssa, 0, sizeof(zend_func_info) - offsetof(zend_func_info, ssa)); in zend_jit_trace()