Lines Matching refs:block

143 static int get_const_switch_target(zend_cfg *cfg, zend_op_array *op_array, zend_basic_block *block,…  in get_const_switch_target()  argument
149 return block->successors[block->successors_count - 1]; in get_const_switch_target()
159 return block->successors[block->successors_count - 2]; in get_const_switch_target()
164 static void zend_optimize_block(zend_basic_block *block, zend_op_array *op_array, zend_bitset used_… in zend_optimize_block() argument
170 strip_leading_nops(op_array, block); in zend_optimize_block()
172 opline = op_array->opcodes + block->start; in zend_optimize_block()
173 end = opline + block->len; in zend_optimize_block()
202 DEL_SOURCE(block, block->successors[0]); in zend_optimize_block()
203 block->successors_count = 1; in zend_optimize_block()
204 block->successors[0] = block->successors[1]; in zend_optimize_block()
208 DEL_SOURCE(block, block->successors[1]); in zend_optimize_block()
209 block->successors_count = 1; in zend_optimize_block()
216 DEL_SOURCE(block, block->successors[1]); in zend_optimize_block()
217 block->successors_count = 1; in zend_optimize_block()
220 DEL_SOURCE(block, block->successors[0]); in zend_optimize_block()
221 block->successors_count = 1; in zend_optimize_block()
222 block->successors[0] = block->successors[1]; in zend_optimize_block()
229 DEL_SOURCE(block, block->successors[0]); in zend_optimize_block()
230 block->successors[0] = block->successors[1]; in zend_optimize_block()
234 DEL_SOURCE(block, block->successors[0]); in zend_optimize_block()
236 block->successors_count = 1; in zend_optimize_block()
372 if(sv >= block->start_opline && sv->opcode == ZEND_SEND_VAL && in zend_optimize_block()
428 int target = get_const_switch_target(cfg, op_array, block, opline, &ZEND_OP1_LITERAL(opline)); in zend_optimize_block()
434 block->successors_count = 1; in zend_optimize_block()
435 block->successors[0] = target; in zend_optimize_block()
632 tmp = block->successors[0]; in zend_optimize_block()
633 block->successors[0] = block->successors[1]; in zend_optimize_block()
634 block->successors[1] = tmp; in zend_optimize_block()
1123 static void zend_jmp_optimization(zend_basic_block *block, zend_op_array *op_array, zend_cfg *cfg, … in zend_jmp_optimization() argument
1129 if (block->len == 0) { in zend_jmp_optimization()
1133 last_op = op_array->opcodes + block->start + block->len - 1; in zend_jmp_optimization()
1137 zend_basic_block *target_block = blocks + block->successors[0]; in zend_jmp_optimization()
1139 int next = (block - blocks) + 1; in zend_jmp_optimization()
1147 if (block->successors[0] == next) { in zend_jmp_optimization()
1149 block->len--; in zend_jmp_optimization()
1154 block->successors[0] != target_block->successors[0] && in zend_jmp_optimization()
1158 DEL_SOURCE(block, block->successors[0]); in zend_jmp_optimization()
1159 block->successors[0] = target_block->successors[0]; in zend_jmp_optimization()
1160 ADD_SOURCE(block, block->successors[0]); in zend_jmp_optimization()
1170 DEL_SOURCE(block, block->successors[0]); in zend_jmp_optimization()
1171 block->successors_count = 2; in zend_jmp_optimization()
1172 block->successors[0] = target_block->successors[0]; in zend_jmp_optimization()
1173 block->successors[1] = target_block->successors[1]; in zend_jmp_optimization()
1174 ADD_SOURCE(block, block->successors[0]); in zend_jmp_optimization()
1175 ADD_SOURCE(block, block->successors[1]); in zend_jmp_optimization()
1187 DEL_SOURCE(block, block->successors[0]); in zend_jmp_optimization()
1188 block->successors_count = 0; in zend_jmp_optimization()
1191 } else if (0&& block->op1_to != block && in zend_jmp_optimization()
1192 block->op1_to != blocks && in zend_jmp_optimization()
1200 zend_block_source *cs = block->op1_to->sources; in zend_jmp_optimization()
1204 if (cs->from->follow_to == block->op1_to) { in zend_jmp_optimization()
1211 next = block->op1_to; in zend_jmp_optimization()
1214 if (next->follow_to == block) { in zend_jmp_optimization()
1223 while (prev->next != block->op1_to) { in zend_jmp_optimization()
1227 next->next = block->next; in zend_jmp_optimization()
1228 block->next = block->op1_to; in zend_jmp_optimization()
1230 block->follow_to = block->op1_to; in zend_jmp_optimization()
1231 block->op1_to = NULL; in zend_jmp_optimization()
1233 block->len--; in zend_jmp_optimization()
1234 if(block->len == 0) { in zend_jmp_optimization()
1236 delete_code_block(block, ctx); in zend_jmp_optimization()
1260 DEL_SOURCE(block, block->successors[1]); in zend_jmp_optimization()
1261 block->successors_count = 1; in zend_jmp_optimization()
1265 DEL_SOURCE(block, block->successors[0]); in zend_jmp_optimization()
1266 block->successors_count = 1; in zend_jmp_optimization()
1267 block->successors[0] = block->successors[1]; in zend_jmp_optimization()
1272 if (block->successors[0] == block->successors[1]) { in zend_jmp_optimization()
1284 block->successors_count = 1; in zend_jmp_optimization()
1293 zend_basic_block *target_block = blocks + block->successors[0]; in zend_jmp_optimization()
1313 DEL_SOURCE(block, block->successors[0]); in zend_jmp_optimization()
1314 block->successors[0] = target_block->successors[1]; in zend_jmp_optimization()
1315 ADD_SOURCE(block, block->successors[0]); in zend_jmp_optimization()
1324 DEL_SOURCE(block, block->successors[0]); in zend_jmp_optimization()
1325 block->successors[0] = target_block->successors[1]; in zend_jmp_optimization()
1326 ADD_SOURCE(block, block->successors[0]); in zend_jmp_optimization()
1333 DEL_SOURCE(block, block->successors[0]); in zend_jmp_optimization()
1334 block->successors[0] = target_block->successors[0]; in zend_jmp_optimization()
1335 ADD_SOURCE(block, block->successors[0]); in zend_jmp_optimization()
1339 DEL_SOURCE(block, block->successors[0]); in zend_jmp_optimization()
1340 block->successors[0] = target_block->successors[0]; in zend_jmp_optimization()
1341 ADD_SOURCE(block, block->successors[0]); in zend_jmp_optimization()
1348 DEL_SOURCE(block, block->successors[0]); in zend_jmp_optimization()
1350 block->successors[0] = target_block->successors[0]; in zend_jmp_optimization()
1352 block->successors[0] = target_block->successors[1]; in zend_jmp_optimization()
1354 ADD_SOURCE(block, block->successors[0]); in zend_jmp_optimization()
1364 target_block = blocks + block->successors[1]; in zend_jmp_optimization()
1373 DEL_SOURCE(block, block->successors[1]); in zend_jmp_optimization()
1374 block->successors[1] = target_block->successors[0]; in zend_jmp_optimization()
1375 ADD_SOURCE(block, block->successors[1]); in zend_jmp_optimization()
1383 DEL_SOURCE(block, block->successors[1]); in zend_jmp_optimization()
1385 block->successors[1] = target_block->successors[0]; in zend_jmp_optimization()
1386 ADD_SOURCE(block, block->successors[1]); in zend_jmp_optimization()
1388 block->successors[1] = block->successors[0]; in zend_jmp_optimization()
1389 block->successors[0] = target_block->successors[0]; in zend_jmp_optimization()
1390 ADD_SOURCE(block, block->successors[0]); in zend_jmp_optimization()
1412 DEL_SOURCE(block, block->successors[0]); in zend_jmp_optimization()
1413 block->successors_count = 1; in zend_jmp_optimization()
1414 block->successors[0] = block->successors[1]; in zend_jmp_optimization()
1430 target_block = blocks + block->successors[0]; in zend_jmp_optimization()
1446 DEL_SOURCE(block, block->successors[0]); in zend_jmp_optimization()
1447 block->successors[0] = target_block->successors[0]; in zend_jmp_optimization()
1448 ADD_SOURCE(block, block->successors[0]); in zend_jmp_optimization()
1454 DEL_SOURCE(block, block->successors[0]); in zend_jmp_optimization()
1455 block->successors[0] = target_block->successors[1]; in zend_jmp_optimization()
1456 ADD_SOURCE(block, block->successors[0]); in zend_jmp_optimization()
1463 DEL_SOURCE(block, block->successors[0]); in zend_jmp_optimization()
1464 block->successors[0] = target_block->successors[1]; in zend_jmp_optimization()
1465 ADD_SOURCE(block, block->successors[0]); in zend_jmp_optimization()
1472 DEL_SOURCE(block, block->successors[0]); in zend_jmp_optimization()
1473 block->successors[0] = target_block->successors[0]; in zend_jmp_optimization()
1474 ADD_SOURCE(block, block->successors[0]); in zend_jmp_optimization()
1478 DEL_SOURCE(block, block->successors[0]); in zend_jmp_optimization()
1479 block->successors[0] = target_block->successors[0]; in zend_jmp_optimization()
1480 ADD_SOURCE(block, block->successors[0]); in zend_jmp_optimization()
1486 DEL_SOURCE(block, block->successors[0]); in zend_jmp_optimization()
1488 block->successors[0] = target_block->successors[0]; in zend_jmp_optimization()
1490 block->successors[0] = target_block->successors[1]; in zend_jmp_optimization()
1492 ADD_SOURCE(block, block->successors[0]); in zend_jmp_optimization()
1498 int next = (block - blocks) + 1; in zend_jmp_optimization()
1512 DEL_SOURCE(block, block->successors[1]); in zend_jmp_optimization()
1513 block->successors_count = 1; in zend_jmp_optimization()
1520 DEL_SOURCE(block, block->successors[0]); in zend_jmp_optimization()
1521 block->successors_count = 1; in zend_jmp_optimization()
1522 block->successors[0] = block->successors[1]; in zend_jmp_optimization()
1524 } else if (block->successors[0] == block->successors[1]) { in zend_jmp_optimization()
1531 block->successors_count = 1; in zend_jmp_optimization()
1533 } else if (block->successors[0] == next) { in zend_jmp_optimization()
1537 block->successors[0] = block->successors[1]; in zend_jmp_optimization()
1538 block->successors[1] = next; in zend_jmp_optimization()
1540 } else if (block->successors[1] == next) { in zend_jmp_optimization()
1552 zend_basic_block *target_block = blocks + block->successors[0]; in zend_jmp_optimization()
1570 DEL_SOURCE(block, block->successors[0]); in zend_jmp_optimization()
1571 block->successors[0] = target_block->successors[0]; in zend_jmp_optimization()
1572 ADD_SOURCE(block, block->successors[0]); in zend_jmp_optimization()
1579 DEL_SOURCE(block, block->successors[0]); in zend_jmp_optimization()
1580 block->successors[0] = target_block->successors[1]; in zend_jmp_optimization()
1581 ADD_SOURCE(block, block->successors[0]); in zend_jmp_optimization()
1585 DEL_SOURCE(block, block->successors[0]); in zend_jmp_optimization()
1586 block->successors[0] = target_block->successors[0]; in zend_jmp_optimization()
1587 ADD_SOURCE(block, block->successors[0]); in zend_jmp_optimization()
1602 zend_basic_block *block, *next_block; in zend_t_usage() local
1622 block = cfg->blocks + n; in zend_t_usage()
1624 if (!(block->flags & ZEND_BB_REACHABLE)) { in zend_t_usage()
1628 opline = op_array->opcodes + block->start; in zend_t_usage()
1629 end = opline + block->len; in zend_t_usage()
1630 if (!(block->flags & ZEND_BB_FOLLOW) || in zend_t_usage()
1631 (block->flags & ZEND_BB_TARGET)) { in zend_t_usage()
1702 block = cfg->blocks + (--n); in zend_t_usage()
1704 if (!(block->flags & ZEND_BB_REACHABLE) || block->len == 0) { in zend_t_usage()
1708 end = op_array->opcodes + block->start; in zend_t_usage()
1709 opline = end + block->len - 1; in zend_t_usage()
1715 } else if (block->successors_count > 1) { in zend_t_usage()
1718 next_block = block; in zend_t_usage()