Lines Matching refs:cfg
83 static int find_code_blocks(zend_op_array *op_array, zend_cfg *cfg) in find_code_blocks() argument
90 memset(cfg, 0, sizeof(zend_cfg)); in find_code_blocks()
91 blocks = cfg->blocks = ecalloc(op_array->last + 2, sizeof(zend_code_block)); in find_code_blocks()
172 cfg->try = ecalloc(op_array->last_try_catch, sizeof(zend_code_block *)); in find_code_blocks()
173 cfg->catch = ecalloc(op_array->last_try_catch, sizeof(zend_code_block *)); in find_code_blocks()
175 cfg->try[i] = &blocks[op_array->try_catch_array[i].try_op]; in find_code_blocks()
176 cfg->catch[i] = &blocks[op_array->try_catch_array[i].catch_op]; in find_code_blocks()
206 cfg->loop_start = ecalloc(op_array->last_brk_cont, sizeof(zend_code_block *)); in find_code_blocks()
207 cfg->loop_cont = ecalloc(op_array->last_brk_cont, sizeof(zend_code_block *)); in find_code_blocks()
208 cfg->loop_brk = ecalloc(op_array->last_brk_cont, sizeof(zend_code_block *)); in find_code_blocks()
217 cfg->loop_start[j] = &blocks[op_array->brk_cont_array[j].start]; in find_code_blocks()
218 cfg->loop_cont[j] = &blocks[op_array->brk_cont_array[j].cont]; in find_code_blocks()
219 cfg->loop_brk[j] = &blocks[op_array->brk_cont_array[j].brk]; in find_code_blocks()
488 static void zend_rebuild_access_path(zend_cfg *cfg, zend_op_array *op_array, int find_start) in zend_rebuild_access_path() argument
490 zend_code_block *blocks = cfg->blocks; in zend_rebuild_access_path()
519 zend_access_path(cfg->loop_start[i]); in zend_rebuild_access_path()
520 zend_access_path(cfg->loop_cont[i]); in zend_rebuild_access_path()
521 zend_access_path(cfg->loop_brk[i]); in zend_rebuild_access_path()
529 if (!cfg->catch[i]->access) { in zend_rebuild_access_path()
530 zend_access_path(cfg->catch[i]); in zend_rebuild_access_path()
1195 static void assemble_code_blocks(zend_cfg *cfg, zend_op_array *op_array) in assemble_code_blocks() argument
1197 zend_code_block *blocks = cfg->blocks; in assemble_code_blocks()
1259 if (cfg->try[i]->access) { in assemble_code_blocks()
1260 op_array->try_catch_array[j].try_op = cfg->try[i]->start_opline - new_opcodes; in assemble_code_blocks()
1261 op_array->try_catch_array[j].catch_op = cfg->catch[i]->start_opline - new_opcodes; in assemble_code_blocks()
1266 efree(cfg->try); in assemble_code_blocks()
1267 efree(cfg->catch); in assemble_code_blocks()
1274 op_array->brk_cont_array[i].start = cfg->loop_start[i]->start_opline - new_opcodes; in assemble_code_blocks()
1275 op_array->brk_cont_array[i].cont = cfg->loop_cont[i]->start_opline - new_opcodes; in assemble_code_blocks()
1276 op_array->brk_cont_array[i].brk = cfg->loop_brk[i]->start_opline - new_opcodes; in assemble_code_blocks()
1278 efree(cfg->loop_start); in assemble_code_blocks()
1279 efree(cfg->loop_cont); in assemble_code_blocks()
1280 efree(cfg->loop_brk); in assemble_code_blocks()
2042 zend_cfg cfg; in zend_block_optimization() local
2059 if (!find_code_blocks(op_array, &cfg)) { in zend_block_optimization()
2063 zend_rebuild_access_path(&cfg, op_array, 0); in zend_block_optimization()
2069 zend_t_usage(cfg.blocks, op_array, usage); in zend_block_optimization()
2072 for (cur_block = cfg.blocks; cur_block; cur_block = cur_block->next) { in zend_block_optimization()
2080 for (cur_block = cfg.blocks; cur_block; cur_block = cur_block->next) { in zend_block_optimization()
2084 zend_jmp_optimization(cur_block, op_array, cfg.blocks TSRMLS_CC); in zend_block_optimization()
2088 zend_rebuild_access_path(&cfg, op_array, 1); in zend_block_optimization()
2092 zend_t_usage(cfg.blocks, op_array, usage); in zend_block_optimization()
2093 assemble_code_blocks(&cfg, op_array); in zend_block_optimization()
2097 for (cur_block = cfg.blocks; cur_block; cur_block = cur_block->next) { in zend_block_optimization()
2105 efree(cfg.blocks); in zend_block_optimization()