Lines Matching refs:cfg
109 static int get_const_switch_target(zend_cfg *cfg, zend_op_array *op_array, zend_basic_block *block,… in get_const_switch_target() argument
131 return cfg->map[ZEND_OFFSET_TO_OPLINE_NUM(op_array, opline, Z_LVAL_P(zv))]; in get_const_switch_target()
134 …sic_block *block, zend_op_array *op_array, zend_bitset used_ext, zend_cfg *cfg, zend_op **Tsource,… in zend_optimize_block() argument
410 int target = get_const_switch_target(cfg, op_array, block, opline, &ZEND_OP1_LITERAL(opline)); in zend_optimize_block()
605 cfg->blocks[block->successors[0]].flags |= ZEND_BB_FOLLOW; in zend_optimize_block()
608 zend_basic_block *next = cfg->blocks + block->successors[1]; in zend_optimize_block()
658 cfg->blocks[block->successors[0]].flags |= ZEND_BB_FOLLOW; in zend_optimize_block()
935 static void assemble_code_blocks(zend_cfg *cfg, zend_op_array *op_array, zend_optimizer_ctx *ctx) in assemble_code_blocks() argument
937 zend_basic_block *blocks = cfg->blocks; in assemble_code_blocks()
938 zend_basic_block *end = blocks + cfg->blocks_count; in assemble_code_blocks()
1057 if (blocks[cfg->map[op_array->try_catch_array[i].try_op]].flags & ZEND_BB_REACHABLE) { in assemble_code_blocks()
1059 … op_array->try_catch_array[j].try_op = blocks[cfg->map[op_array->try_catch_array[i].try_op]].start; in assemble_code_blocks()
1061 …op_array->try_catch_array[j].catch_op = blocks[cfg->map[op_array->try_catch_array[i].catch_op]].st… in assemble_code_blocks()
1066 …op_array->try_catch_array[j].finally_op = blocks[cfg->map[op_array->try_catch_array[i].finally_op]… in assemble_code_blocks()
1073 …op_array->try_catch_array[j].finally_end = blocks[cfg->map[op_array->try_catch_array[i].finally_en… in assemble_code_blocks()
1102 memset(cfg->map, -1, sizeof(int) * op_array->last); in assemble_code_blocks()
1103 for (int n = 0; n < cfg->blocks_count; n++) { in assemble_code_blocks()
1104 if (cfg->blocks[n].flags & (ZEND_BB_REACHABLE|ZEND_BB_UNREACHABLE_FREE)) { in assemble_code_blocks()
1105 cfg->map[cfg->blocks[n].start] = n; in assemble_code_blocks()
1110 static zend_always_inline zend_basic_block *get_target_block(const zend_cfg *cfg, zend_basic_block … in get_target_block() argument
1113 zend_basic_block *target_block = cfg->blocks + block->successors[n]; in get_target_block()
1118 target_block = cfg->blocks + b; in get_target_block()
1126 static zend_always_inline zend_basic_block *get_follow_block(const zend_cfg *cfg, zend_basic_block … in get_follow_block() argument
1129 zend_basic_block *target_block = cfg->blocks + block->successors[n]; in get_follow_block()
1134 target_block = cfg->blocks + b; in get_follow_block()
1142 static zend_always_inline zend_basic_block *get_next_block(const zend_cfg *cfg, zend_basic_block *b… in get_next_block() argument
1145 zend_basic_block *end = cfg->blocks + cfg->blocks_count; in get_next_block()
1156 next_block = cfg->blocks + next_block->successors[0]; in get_next_block()
1182 …mization(zend_basic_block *block, zend_op_array *op_array, const zend_cfg *cfg, int *jmp_hitlist, … in zend_jmp_optimization() argument
1198 target_block = get_target_block(cfg, block, 0, opt_count); in zend_jmp_optimization()
1210 target_block = get_target_block(cfg, block, 0, opt_count); in zend_jmp_optimization()
1213 next_block = get_next_block(cfg, block); in zend_jmp_optimization()
1243 target_block = get_target_block(cfg, block, 0, opt_count); in zend_jmp_optimization()
1256 target_block = get_target_block(cfg, block, 0, opt_count); in zend_jmp_optimization()
1264 target_block = get_target_block(cfg, block, 0, opt_count); in zend_jmp_optimization()
1285 target_block = get_target_block(cfg, block, 0, opt_count); in zend_jmp_optimization()
1288 follow_block = get_follow_block(cfg, block, 1, opt_count); in zend_jmp_optimization()
1306 block->successors[0] = follow_block - cfg->blocks; in zend_jmp_optimization()
1311 next_block = get_next_block(cfg, follow_block); in zend_jmp_optimization()
1319 block->successors[1] = next_block - cfg->blocks; in zend_jmp_optimization()
1338 target_block = get_target_block(cfg, block, 0, opt_count); in zend_jmp_optimization()
1389 target_block = get_target_block(cfg, block, 0, opt_count); in zend_jmp_optimization()
1392 follow_block = get_follow_block(cfg, block, 1, opt_count); in zend_jmp_optimization()
1409 static void zend_t_usage(zend_cfg *cfg, zend_op_array *op_array, zend_bitset used_ext, zend_optimiz… in zend_t_usage() argument
1431 for (n = 1; n < cfg->blocks_count; n++) { in zend_t_usage()
1432 block = cfg->blocks + n; in zend_t_usage()
1512 for (n = cfg->blocks_count; n > 0;) { in zend_t_usage()
1513 block = cfg->blocks + (--n); in zend_t_usage()
1613 static void zend_merge_blocks(zend_op_array *op_array, zend_cfg *cfg, uint32_t *opt_count) in zend_merge_blocks() argument
1619 for (i = 0; i < cfg->blocks_count; i++) { in zend_merge_blocks()
1620 b = cfg->blocks + i; in zend_merge_blocks()
1675 zend_cfg cfg; in zend_optimize_cfg() local
1687 zend_build_cfg(&ctx->arena, op_array, 0, &cfg); in zend_optimize_cfg()
1689 if (cfg.blocks_count * (op_array->last_var + op_array->T) > 64 * 1024 * 1024) { in zend_optimize_cfg()
1695 zend_dump_op_array(op_array, ZEND_DUMP_CFG, "before block pass", &cfg); in zend_optimize_cfg()
1701 jmp_hitlist = zend_arena_alloc(&ctx->arena, cfg.blocks_count * sizeof(int)); in zend_optimize_cfg()
1703 blocks = cfg.blocks; in zend_optimize_cfg()
1704 end = blocks + cfg.blocks_count; in zend_optimize_cfg()
1710 zend_t_usage(&cfg, op_array, usage, ctx); in zend_optimize_cfg()
1723 zend_optimize_block(b, op_array, usage, &cfg, Tsource, &opt_count); in zend_optimize_cfg()
1747 zend_jmp_optimization(b, op_array, &cfg, jmp_hitlist, &opt_count); in zend_optimize_cfg()
1752 zend_cfg_remark_reachable_blocks(op_array, &cfg); in zend_optimize_cfg()
1755 zend_merge_blocks(op_array, &cfg, &opt_count); in zend_optimize_cfg()
1762 assemble_code_blocks(&cfg, op_array, ctx); in zend_optimize_cfg()
1765 …zend_dump_op_array(op_array, ZEND_DUMP_CFG | ZEND_DUMP_HIDE_UNREACHABLE, "after block pass", &cfg); in zend_optimize_cfg()