Lines Matching refs:cfg
27 static void zend_mark_reachable(zend_op *opcodes, zend_cfg *cfg, zend_basic_block *b) /* {{{ */ in zend_mark_reachable() argument
29 zend_basic_block *blocks = cfg->blocks; in zend_mark_reachable()
51 if ((cfg->flags & ZEND_CFG_STACKLESS)) { in zend_mark_reachable()
62 if ((cfg->flags & ZEND_CFG_RECV_ENTRY)) { in zend_mark_reachable()
98 zend_mark_reachable(opcodes, cfg, succ); in zend_mark_reachable()
106 static void zend_mark_reachable_blocks(const zend_op_array *op_array, zend_cfg *cfg, int start) /* … in zend_mark_reachable_blocks() argument
108 zend_basic_block *blocks = cfg->blocks; in zend_mark_reachable_blocks()
111 zend_mark_reachable(op_array->opcodes, cfg, blocks + start); in zend_mark_reachable_blocks()
116 uint32_t *block_map = cfg->map; in zend_mark_reachable_blocks()
152 if ((cfg->flags & ZEND_CFG_SPLIT_AT_LIVE_RANGES)) { in zend_mark_reachable_blocks()
154 zend_mark_reachable(op_array->opcodes, cfg, b); in zend_mark_reachable_blocks()
190 …zend_mark_reachable(op_array->opcodes, cfg, blocks + block_map[op_array->try_catch_array[j].try_op… in zend_mark_reachable_blocks()
207 zend_mark_reachable(op_array->opcodes, cfg, b); in zend_mark_reachable_blocks()
215 zend_mark_reachable(op_array->opcodes, cfg, b); in zend_mark_reachable_blocks()
223 zend_mark_reachable(op_array->opcodes, cfg, b); in zend_mark_reachable_blocks()
243 void zend_cfg_remark_reachable_blocks(const zend_op_array *op_array, zend_cfg *cfg) /* {{{ */ in zend_cfg_remark_reachable_blocks() argument
245 zend_basic_block *blocks = cfg->blocks; in zend_cfg_remark_reachable_blocks()
249 for (i = 0; i < cfg->blocks_count; i++) { in zend_cfg_remark_reachable_blocks()
258 for (i = 0; i < cfg->blocks_count; i++) { in zend_cfg_remark_reachable_blocks()
262 zend_mark_reachable_blocks(op_array, cfg, start); in zend_cfg_remark_reachable_blocks()
284 …g(zend_arena **arena, const zend_op_array *op_array, uint32_t build_flags, zend_cfg *cfg) /* {{{ */ in zend_build_cfg() argument
296 cfg->flags = build_flags & (ZEND_CFG_SPLIT_AT_LIVE_RANGES|ZEND_CFG_STACKLESS|ZEND_CFG_RECV_ENTRY); in zend_build_cfg()
298 cfg->map = block_map = zend_arena_calloc(arena, op_array->last, sizeof(uint32_t)); in zend_build_cfg()
456 if ((cfg->flags & ZEND_CFG_SPLIT_AT_LIVE_RANGES)) { in zend_build_cfg()
479 cfg->blocks_count = blocks_count; in zend_build_cfg()
482 cfg->blocks = blocks = zend_arena_calloc(arena, sizeof(zend_basic_block), blocks_count); in zend_build_cfg()
602 zend_mark_reachable_blocks(op_array, cfg, 0); in zend_build_cfg()
604 cfg->flags |= flags; in zend_build_cfg()
610 int zend_cfg_build_predecessors(zend_arena **arena, zend_cfg *cfg) /* {{{ */ in zend_cfg_build_predecessors() argument
614 zend_basic_block *blocks = cfg->blocks; in zend_cfg_build_predecessors()
615 zend_basic_block *end = blocks + cfg->blocks_count; in zend_cfg_build_predecessors()
634 cfg->edges_count = edges; in zend_cfg_build_predecessors()
635 cfg->predecessors = predecessors = (int*)zend_arena_calloc(arena, sizeof(int), edges); in zend_cfg_build_predecessors()
646 for (j = 0; j < cfg->blocks_count; j++) { in zend_cfg_build_predecessors()
675 int *postnum, int *cur, const zend_cfg *cfg, int block_num) /* {{{ */ in compute_postnum_recursive() argument
678 zend_basic_block *block = &cfg->blocks[block_num]; in compute_postnum_recursive()
685 compute_postnum_recursive(postnum, cur, cfg, block->successors[s]); in compute_postnum_recursive()
693 int zend_cfg_compute_dominators_tree(const zend_op_array *op_array, zend_cfg *cfg) /* {{{ */ in zend_cfg_compute_dominators_tree() argument
695 zend_basic_block *blocks = cfg->blocks; in zend_cfg_compute_dominators_tree()
696 int blocks_count = cfg->blocks_count; in zend_cfg_compute_dominators_tree()
700 int *postnum = do_alloca(sizeof(int) * cfg->blocks_count, use_heap); in zend_cfg_compute_dominators_tree()
701 memset(postnum, -1, sizeof(int) * cfg->blocks_count); in zend_cfg_compute_dominators_tree()
703 compute_postnum_recursive(postnum, &j, cfg, 0); in zend_cfg_compute_dominators_tree()
717 int pred = cfg->predecessors[blocks[j].predecessor_offset + k]; in zend_cfg_compute_dominators_tree()
806 int zend_cfg_identify_loops(const zend_op_array *op_array, zend_cfg *cfg) /* {{{ */ in zend_cfg_identify_loops() argument
810 zend_basic_block *blocks = cfg->blocks; in zend_cfg_identify_loops()
819 ZEND_WORKLIST_ALLOCA(&work, cfg->blocks_count, list_use_heap); in zend_cfg_identify_loops()
823 entry_times = do_alloca(2 * sizeof(int) * cfg->blocks_count, tree_use_heap); in zend_cfg_identify_loops()
824 exit_times = entry_times + cfg->blocks_count; in zend_cfg_identify_loops()
825 memset(entry_times, -1, 2 * sizeof(int) * cfg->blocks_count); in zend_cfg_identify_loops()
855 sorted_blocks = do_alloca(sizeof(block_info) * cfg->blocks_count, sorted_blocks_use_heap); in zend_cfg_identify_loops()
856 for (i = 0; i < cfg->blocks_count; i++) { in zend_cfg_identify_loops()
860 zend_sort(sorted_blocks, cfg->blocks_count, sizeof(block_info), in zend_cfg_identify_loops()
866 for (n = 0; n < cfg->blocks_count; n++) { in zend_cfg_identify_loops()
869 zend_bitset_clear(work.visited, zend_bitset_len(cfg->blocks_count)); in zend_cfg_identify_loops()
871 int pred = cfg->predecessors[blocks[i].predecessor_offset + j]; in zend_cfg_identify_loops()
903 zend_worklist_push(&work, cfg->predecessors[blocks[j].predecessor_offset + k]); in zend_cfg_identify_loops()
913 cfg->flags |= flag; in zend_cfg_identify_loops()