Lines Matching refs:op_array
93 static void zend_mark_reachable_blocks(const zend_op_array *op_array, zend_cfg *cfg, int start) /* … in zend_mark_reachable_blocks() argument
98 zend_mark_reachable(op_array->opcodes, cfg, blocks + start); in zend_mark_reachable_blocks()
100 if (op_array->last_live_range || op_array->last_try_catch) { in zend_mark_reachable_blocks()
109 for (j = 0; j < op_array->last_live_range; j++) { in zend_mark_reachable_blocks()
110 zend_live_range *live_range = &op_array->live_range[j]; in zend_mark_reachable_blocks()
117 while (b->len > 0 && op_array->opcodes[b->start].opcode == ZEND_NOP) { in zend_mark_reachable_blocks()
120 && (op_array->opcodes[b->start + 1].opcode == ZEND_JMPZ in zend_mark_reachable_blocks()
121 || op_array->opcodes[b->start + 1].opcode == ZEND_JMPNZ) in zend_mark_reachable_blocks()
122 && (op_array->opcodes[b->start + 1].op1_type & (IS_CV|IS_CONST)) in zend_mark_reachable_blocks()
124 && zend_is_smart_branch(op_array->opcodes + b->start - 1)) { in zend_mark_reachable_blocks()
141 zend_mark_reachable(op_array->opcodes, cfg, b); in zend_mark_reachable_blocks()
153 for (j = 0; j < op_array->last_try_catch; j++) { in zend_mark_reachable_blocks()
156 b = blocks + block_map[op_array->try_catch_array[j].try_op]; in zend_mark_reachable_blocks()
160 if (op_array->try_catch_array[j].catch_op) { in zend_mark_reachable_blocks()
161 end = blocks + block_map[op_array->try_catch_array[j].catch_op]; in zend_mark_reachable_blocks()
164 op_array->try_catch_array[j].try_op = b->start; in zend_mark_reachable_blocks()
170 b = blocks + block_map[op_array->try_catch_array[j].try_op]; in zend_mark_reachable_blocks()
172 if (op_array->try_catch_array[j].finally_op) { in zend_mark_reachable_blocks()
173 end = blocks + block_map[op_array->try_catch_array[j].finally_op]; in zend_mark_reachable_blocks()
176 op_array->try_catch_array[j].try_op = op_array->try_catch_array[j].catch_op; in zend_mark_reachable_blocks()
178 …zend_mark_reachable(op_array->opcodes, cfg, blocks + block_map[op_array->try_catch_array[j].try_op… in zend_mark_reachable_blocks()
187 b = blocks + block_map[op_array->try_catch_array[j].try_op]; in zend_mark_reachable_blocks()
190 if (op_array->try_catch_array[j].catch_op) { in zend_mark_reachable_blocks()
191 b = blocks + block_map[op_array->try_catch_array[j].catch_op]; in zend_mark_reachable_blocks()
195 zend_mark_reachable(op_array->opcodes, cfg, b); in zend_mark_reachable_blocks()
198 if (op_array->try_catch_array[j].finally_op) { in zend_mark_reachable_blocks()
199 b = blocks + block_map[op_array->try_catch_array[j].finally_op]; in zend_mark_reachable_blocks()
203 zend_mark_reachable(op_array->opcodes, cfg, b); in zend_mark_reachable_blocks()
206 if (op_array->try_catch_array[j].finally_end) { in zend_mark_reachable_blocks()
207 b = blocks + block_map[op_array->try_catch_array[j].finally_end]; in zend_mark_reachable_blocks()
211 zend_mark_reachable(op_array->opcodes, cfg, b); in zend_mark_reachable_blocks()
215 if (op_array->try_catch_array[j].catch_op) { in zend_mark_reachable_blocks()
216 …ZEND_ASSERT(!(blocks[block_map[op_array->try_catch_array[j].catch_op]].flags & ZEND_BB_REACHABLE)); in zend_mark_reachable_blocks()
218 if (op_array->try_catch_array[j].finally_op) { in zend_mark_reachable_blocks()
219 …ZEND_ASSERT(!(blocks[block_map[op_array->try_catch_array[j].finally_op]].flags & ZEND_BB_REACHABLE… in zend_mark_reachable_blocks()
221 if (op_array->try_catch_array[j].finally_end) { in zend_mark_reachable_blocks()
222 …ZEND_ASSERT(!(blocks[block_map[op_array->try_catch_array[j].finally_end]].flags & ZEND_BB_REACHABL… in zend_mark_reachable_blocks()
231 void zend_cfg_remark_reachable_blocks(const zend_op_array *op_array, zend_cfg *cfg) /* {{{ */ in zend_cfg_remark_reachable_blocks() argument
250 zend_mark_reachable_blocks(op_array, cfg, start); in zend_cfg_remark_reachable_blocks()
277 int zend_build_cfg(zend_arena **arena, const zend_op_array *op_array, uint32_t build_flags, zend_cf… in zend_build_cfg() argument
291 …cfg->split_at_recv = (build_flags & ZEND_CFG_RECV_ENTRY) != 0 && (op_array->fn_flags & ZEND_ACC_HA… in zend_build_cfg()
293 cfg->map = block_map = zend_arena_calloc(arena, op_array->last, sizeof(uint32_t)); in zend_build_cfg()
300 for (i = 0; i < op_array->last; i++) { in zend_build_cfg()
301 zend_op *opline = op_array->opcodes + i; in zend_build_cfg()
314 if (i + 1 < op_array->last) { in zend_build_cfg()
353 BB_START(OP_JMP_ADDR(opline, opline->op1) - op_array->opcodes); in zend_build_cfg()
357 if (i + 1 < op_array->last) { in zend_build_cfg()
362 BB_START(OP_JMP_ADDR(opline, opline->op1) - op_array->opcodes); in zend_build_cfg()
363 if (i + 1 < op_array->last) { in zend_build_cfg()
368 BB_START(OP_JMP_ADDR(opline, opline->op2) - op_array->opcodes); in zend_build_cfg()
369 BB_START(ZEND_OFFSET_TO_OPLINE_NUM(op_array, opline, opline->extended_value)); in zend_build_cfg()
370 if (i + 1 < op_array->last) { in zend_build_cfg()
381 BB_START(OP_JMP_ADDR(opline, opline->op2) - op_array->opcodes); in zend_build_cfg()
386 BB_START(ZEND_OFFSET_TO_OPLINE_NUM(op_array, opline, opline->extended_value)); in zend_build_cfg()
394 BB_START(ZEND_OFFSET_TO_OPLINE_NUM(op_array, opline, opline->extended_value)); in zend_build_cfg()
399 BB_START(OP_JMP_ADDR(opline, opline->op2) - op_array->opcodes); in zend_build_cfg()
409 !op_array->function_name) { in zend_build_cfg()
423 !op_array->function_name) { in zend_build_cfg()
432 && op_array->last > 0 && block_map[0] > 1) { in zend_build_cfg()
437 for (j = 0; j < op_array->last_live_range; j++) { in zend_build_cfg()
438 BB_START(op_array->live_range[j].start); in zend_build_cfg()
439 BB_START(op_array->live_range[j].end); in zend_build_cfg()
443 if (op_array->last_try_catch) { in zend_build_cfg()
444 for (j = 0; j < op_array->last_try_catch; j++) { in zend_build_cfg()
445 BB_START(op_array->try_catch_array[j].try_op); in zend_build_cfg()
446 if (op_array->try_catch_array[j].catch_op) { in zend_build_cfg()
447 BB_START(op_array->try_catch_array[j].catch_op); in zend_build_cfg()
449 if (op_array->try_catch_array[j].finally_op) { in zend_build_cfg()
450 BB_START(op_array->try_catch_array[j].finally_op); in zend_build_cfg()
452 if (op_array->try_catch_array[j].finally_end) { in zend_build_cfg()
453 BB_START(op_array->try_catch_array[j].finally_end); in zend_build_cfg()
476 for (i = 0; i < op_array->last; i++) { in zend_build_cfg()
499 opline = op_array->opcodes + blocks[j].start + blocks[j].len - 1; in zend_build_cfg()
509 record_successor(blocks, j, 0, block_map[OP_JMP_ADDR(opline, opline->op1) - op_array->opcodes]); in zend_build_cfg()
512 record_successor(blocks, j, 0, block_map[OP_JMP_ADDR(opline, opline->op2) - op_array->opcodes]); in zend_build_cfg()
513 …record_successor(blocks, j, 1, block_map[ZEND_OFFSET_TO_OPLINE_NUM(op_array, opline, opline->exten… in zend_build_cfg()
522 record_successor(blocks, j, 0, block_map[OP_JMP_ADDR(opline, opline->op2) - op_array->opcodes]); in zend_build_cfg()
527 …record_successor(blocks, j, 0, block_map[ZEND_OFFSET_TO_OPLINE_NUM(op_array, opline, opline->exten… in zend_build_cfg()
537 …record_successor(blocks, j, 0, block_map[ZEND_OFFSET_TO_OPLINE_NUM(op_array, opline, opline->exten… in zend_build_cfg()
542 record_successor(blocks, j, 0, block_map[OP_JMP_ADDR(opline, opline->op2) - op_array->opcodes]); in zend_build_cfg()
546 record_successor(blocks, j, 0, block_map[OP_JMP_ADDR(opline, opline->op1) - op_array->opcodes]); in zend_build_cfg()
556 zend_mark_reachable_blocks(op_array, cfg, 0); in zend_build_cfg()
652 int zend_cfg_compute_dominators_tree(const zend_op_array *op_array, zend_cfg *cfg) /* {{{ */ in zend_cfg_compute_dominators_tree() argument
765 int zend_cfg_identify_loops(const zend_op_array *op_array, zend_cfg *cfg, uint32_t *flags) /* {{{ */ in zend_cfg_identify_loops() argument