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()
484 static void zend_rebuild_access_path(zend_cfg *cfg, zend_op_array *op_array, int find_start) in zend_rebuild_access_path() argument
486 zend_code_block *blocks = cfg->blocks; in zend_rebuild_access_path()
515 zend_access_path(cfg->loop_start[i]); in zend_rebuild_access_path()
516 zend_access_path(cfg->loop_cont[i]); in zend_rebuild_access_path()
517 zend_access_path(cfg->loop_brk[i]); in zend_rebuild_access_path()
525 if (!cfg->catch[i]->access) { in zend_rebuild_access_path()
526 zend_access_path(cfg->catch[i]); in zend_rebuild_access_path()
1188 static void assemble_code_blocks(zend_cfg *cfg, zend_op_array *op_array) in assemble_code_blocks() argument
1190 zend_code_block *blocks = cfg->blocks; in assemble_code_blocks()
1252 if (cfg->try[i]->access) { in assemble_code_blocks()
1253 op_array->try_catch_array[j].try_op = cfg->try[i]->start_opline - new_opcodes; in assemble_code_blocks()
1254 op_array->try_catch_array[j].catch_op = cfg->catch[i]->start_opline - new_opcodes; in assemble_code_blocks()
1259 efree(cfg->try); in assemble_code_blocks()
1260 efree(cfg->catch); in assemble_code_blocks()
1267 op_array->brk_cont_array[i].start = cfg->loop_start[i]->start_opline - new_opcodes; in assemble_code_blocks()
1268 op_array->brk_cont_array[i].cont = cfg->loop_cont[i]->start_opline - new_opcodes; in assemble_code_blocks()
1269 op_array->brk_cont_array[i].brk = cfg->loop_brk[i]->start_opline - new_opcodes; in assemble_code_blocks()
1271 efree(cfg->loop_start); in assemble_code_blocks()
1272 efree(cfg->loop_cont); in assemble_code_blocks()
1273 efree(cfg->loop_brk); in assemble_code_blocks()
2029 zend_cfg cfg; in zend_block_optimization() local
2046 if (!find_code_blocks(op_array, &cfg)) { in zend_block_optimization()
2050 zend_rebuild_access_path(&cfg, op_array, 0); in zend_block_optimization()
2056 zend_t_usage(cfg.blocks, op_array, usage); in zend_block_optimization()
2059 for (cur_block = cfg.blocks; cur_block; cur_block = cur_block->next) { in zend_block_optimization()
2067 for (cur_block = cfg.blocks; cur_block; cur_block = cur_block->next) { in zend_block_optimization()
2071 zend_jmp_optimization(cur_block, op_array, cfg.blocks TSRMLS_CC); in zend_block_optimization()
2075 zend_rebuild_access_path(&cfg, op_array, 1); in zend_block_optimization()
2079 zend_t_usage(cfg.blocks, op_array, usage); in zend_block_optimization()
2080 assemble_code_blocks(&cfg, op_array); in zend_block_optimization()
2084 for (cur_block = cfg.blocks; cur_block; cur_block = cur_block->next) { in zend_block_optimization()
2092 efree(cfg.blocks); in zend_block_optimization()