Lines Matching refs:opline
63 #define SET_VAR_SOURCE(opline) Tsource[VAR_NUM(opline->result.var)] = opline argument
109 …rget(zend_cfg *cfg, zend_op_array *op_array, zend_basic_block *block, zend_op *opline, zval *val) { in get_const_switch_target() argument
110 HashTable *jumptable = Z_ARRVAL(ZEND_OP2_LITERAL(opline)); in get_const_switch_target()
112 if ((opline->opcode == ZEND_SWITCH_LONG && Z_TYPE_P(val) != IS_LONG) in get_const_switch_target()
113 || (opline->opcode == ZEND_SWITCH_STRING && Z_TYPE_P(val) != IS_STRING)) { in get_const_switch_target()
117 if (opline->opcode == ZEND_MATCH && Z_TYPE_P(val) != IS_LONG && Z_TYPE_P(val) != IS_STRING) { in get_const_switch_target()
129 return block->successors[block->successors_count - (opline->opcode == ZEND_MATCH ? 1 : 2)]; in get_const_switch_target()
131 return cfg->map[ZEND_OFFSET_TO_OPLINE_NUM(op_array, opline, Z_LVAL_P(zv))]; in get_const_switch_target()
136 zend_op *opline, *src; in zend_optimize_block() local
148 opline = op_array->opcodes + block->start; in zend_optimize_block()
149 end = opline + block->len; in zend_optimize_block()
150 while (opline < end) { in zend_optimize_block()
152 if (opline->op1_type == IS_TMP_VAR && in zend_optimize_block()
153 opline->opcode != ZEND_FREE) { in zend_optimize_block()
154 src = VAR_SOURCE(opline->op1); in zend_optimize_block()
159 znode_op op1 = opline->op1; in zend_optimize_block()
160 if (opline->opcode == ZEND_VERIFY_RETURN_TYPE) { in zend_optimize_block()
161 COPY_NODE(opline->result, opline->op1); in zend_optimize_block()
162 COPY_NODE(opline->op1, src->op1); in zend_optimize_block()
169 if (opline->opcode != ZEND_CASE in zend_optimize_block()
170 && opline->opcode != ZEND_CASE_STRICT in zend_optimize_block()
171 && opline->opcode != ZEND_FETCH_LIST_R in zend_optimize_block()
172 && opline->opcode != ZEND_SWITCH_LONG in zend_optimize_block()
173 && opline->opcode != ZEND_SWITCH_STRING in zend_optimize_block()
174 && opline->opcode != ZEND_MATCH in zend_optimize_block()
175 && opline->opcode != ZEND_MATCH_ERROR in zend_optimize_block()
176 && zend_optimizer_update_op1_const(op_array, opline, &c)) { in zend_optimize_block()
178 if (opline->opcode != ZEND_JMP_NULL in zend_optimize_block()
192 if (opline->op2_type == IS_TMP_VAR) { in zend_optimize_block()
193 src = VAR_SOURCE(opline->op2); in zend_optimize_block()
198 znode_op op2 = opline->op2; in zend_optimize_block()
202 if (zend_optimizer_update_op2_const(op_array, opline, &c)) { in zend_optimize_block()
215 switch (opline->opcode) { in zend_optimize_block()
217 if (opline->op1_type & (IS_TMP_VAR|IS_VAR)) { in zend_optimize_block()
218 src = VAR_SOURCE(opline->op1); in zend_optimize_block()
223 VAR_SOURCE(opline->op1) = NULL; in zend_optimize_block()
224 COPY_NODE(opline->op1, src->op1); in zend_optimize_block()
228 } else if (opline->op1_type == IS_CONST && in zend_optimize_block()
229 Z_TYPE(ZEND_OP1_LITERAL(opline)) != IS_DOUBLE) { in zend_optimize_block()
230 if (last_op == opline - 1) { in zend_optimize_block()
237 if (Z_TYPE(ZEND_OP1_LITERAL(opline)) != IS_STRING) { in zend_optimize_block()
238 convert_to_string(&ZEND_OP1_LITERAL(opline)); in zend_optimize_block()
244 l = old_len + Z_STRLEN(ZEND_OP1_LITERAL(opline)); in zend_optimize_block()
253 …LITERAL(last_op)) + old_len, Z_STRVAL(ZEND_OP1_LITERAL(opline)), Z_STRLEN(ZEND_OP1_LITERAL(opline)… in zend_optimize_block()
255 zval_ptr_dtor_nogc(&ZEND_OP1_LITERAL(opline)); in zend_optimize_block()
256 … ZVAL_STR(&ZEND_OP1_LITERAL(opline), zend_new_interned_string(Z_STR(ZEND_OP1_LITERAL(last_op)))); in zend_optimize_block()
261 last_op = opline; in zend_optimize_block()
266 if (opline->op1_type & (IS_TMP_VAR|IS_VAR)) { in zend_optimize_block()
267 src = VAR_SOURCE(opline->op1); in zend_optimize_block()
268 VAR_SOURCE(opline->op1) = NULL; in zend_optimize_block()
277 if (opline->op1_type == IS_TMP_VAR) { in zend_optimize_block()
278 src = VAR_SOURCE(opline->op1); in zend_optimize_block()
286 VAR_SOURCE(opline->op1) = NULL; in zend_optimize_block()
287 MAKE_NOP(opline); in zend_optimize_block()
308 VAR_SOURCE(opline->op1) = NULL; in zend_optimize_block()
309 MAKE_NOP(opline); in zend_optimize_block()
316 } else if (opline->op1_type == IS_VAR) { in zend_optimize_block()
317 src = VAR_SOURCE(opline->op1); in zend_optimize_block()
327 MAKE_NOP(opline); in zend_optimize_block()
347 if((opline->op1_type & IS_VAR) && in zend_optimize_block()
348 VAR_SOURCE(opline->op1) && VAR_SOURCE(opline->op1)->opcode == ZEND_DO_CF_FCALL && in zend_optimize_block()
349 VAR_SOURCE(opline->op1)->extended_value == 1) { in zend_optimize_block()
350 zend_op *fcall = VAR_SOURCE(opline->op1); in zend_optimize_block()
367 LITERAL_BOOL(opline->op1, 1); in zend_optimize_block()
368 opline->op1_type = IS_CONST; in zend_optimize_block()
376 ZEND_OP1_LITERAL(opline) = zend_optimizer_add_literal(op_array, &c); in zend_optimize_block()
378 opline->op1_type = IS_CONST; in zend_optimize_block()
385 LITERAL_BOOL(opline->op1, 1); in zend_optimize_block()
386 opline->op1_type = IS_CONST; in zend_optimize_block()
395 if (opline->op1_type & (IS_TMP_VAR|IS_VAR)) { in zend_optimize_block()
397 Tsource[VAR_NUM(opline->op1.var)] = NULL; in zend_optimize_block()
404 if (opline->op1_type & (IS_TMP_VAR|IS_VAR)) { in zend_optimize_block()
406 Tsource[VAR_NUM(opline->op1.var)] = NULL; in zend_optimize_block()
409 if (opline->op1_type == IS_CONST) { in zend_optimize_block()
410 int target = get_const_switch_target(cfg, op_array, block, opline, &ZEND_OP1_LITERAL(opline)); in zend_optimize_block()
411 literal_dtor(&ZEND_OP1_LITERAL(opline)); in zend_optimize_block()
412 literal_dtor(&ZEND_OP2_LITERAL(opline)); in zend_optimize_block()
413 opline->opcode = ZEND_JMP; in zend_optimize_block()
414 opline->op1_type = IS_UNUSED; in zend_optimize_block()
415 opline->op2_type = IS_UNUSED; in zend_optimize_block()
424 if (opline->op1_type & (IS_TMP_VAR|IS_VAR)) { in zend_optimize_block()
426 Tsource[VAR_NUM(opline->op1.var)] = NULL; in zend_optimize_block()
433 if (opline->op1_type == IS_CONST && in zend_optimize_block()
434 opline->op2_type == IS_CONST) { in zend_optimize_block()
444 if (opline->op1_type == IS_CONST && in zend_optimize_block()
445 (Z_TYPE(ZEND_OP1_LITERAL(opline)) == IS_FALSE || in zend_optimize_block()
446 Z_TYPE(ZEND_OP1_LITERAL(opline)) == IS_TRUE)) { in zend_optimize_block()
450 opline->opcode = in zend_optimize_block()
451 ((opline->opcode != ZEND_IS_NOT_EQUAL) == ((Z_TYPE(ZEND_OP1_LITERAL(opline))) == IS_TRUE)) ? in zend_optimize_block()
453 COPY_NODE(opline->op1, opline->op2); in zend_optimize_block()
454 SET_UNUSED(opline->op2); in zend_optimize_block()
457 } else if (opline->op2_type == IS_CONST && in zend_optimize_block()
458 (Z_TYPE(ZEND_OP2_LITERAL(opline)) == IS_FALSE || in zend_optimize_block()
459 Z_TYPE(ZEND_OP2_LITERAL(opline)) == IS_TRUE)) { in zend_optimize_block()
463 opline->opcode = in zend_optimize_block()
464 ((opline->opcode != ZEND_IS_NOT_EQUAL) == ((Z_TYPE(ZEND_OP2_LITERAL(opline))) == IS_TRUE)) ? in zend_optimize_block()
466 SET_UNUSED(opline->op2); in zend_optimize_block()
475 if (opline->op1_type == IS_CONST) { in zend_optimize_block()
478 if (opline->op1_type == IS_TMP_VAR && in zend_optimize_block()
479 !zend_bitset_in(used_ext, VAR_NUM(opline->op1.var))) { in zend_optimize_block()
480 src = VAR_SOURCE(opline->op1); in zend_optimize_block()
485 VAR_SOURCE(opline->op1) = NULL; in zend_optimize_block()
486 COPY_NODE(opline->op1, src->op1); in zend_optimize_block()
487 opline->opcode = (opline->opcode == ZEND_BOOL) ? ZEND_BOOL_NOT : ZEND_BOOL; in zend_optimize_block()
493 VAR_SOURCE(opline->op1) = NULL; in zend_optimize_block()
494 COPY_NODE(opline->op1, src->op1); in zend_optimize_block()
499 if (opline->opcode == ZEND_BOOL_NOT) { in zend_optimize_block()
502 COPY_NODE(src->result, opline->result); in zend_optimize_block()
504 MAKE_NOP(opline); in zend_optimize_block()
508 if (opline->opcode == ZEND_BOOL_NOT) { in zend_optimize_block()
511 COPY_NODE(src->result, opline->result); in zend_optimize_block()
513 MAKE_NOP(opline); in zend_optimize_block()
517 if (opline->opcode == ZEND_BOOL_NOT) { in zend_optimize_block()
520 COPY_NODE(src->result, opline->result); in zend_optimize_block()
522 MAKE_NOP(opline); in zend_optimize_block()
526 if (opline->opcode == ZEND_BOOL_NOT) { in zend_optimize_block()
529 COPY_NODE(src->result, opline->result); in zend_optimize_block()
531 MAKE_NOP(opline); in zend_optimize_block()
535 if (opline->opcode == ZEND_BOOL_NOT) { in zend_optimize_block()
547 COPY_NODE(src->result, opline->result); in zend_optimize_block()
549 MAKE_NOP(opline); in zend_optimize_block()
553 if (opline->opcode == ZEND_BOOL_NOT) { in zend_optimize_block()
565 COPY_NODE(src->result, opline->result); in zend_optimize_block()
567 MAKE_NOP(opline); in zend_optimize_block()
580 if (opline->opcode == ZEND_BOOL_NOT) { in zend_optimize_block()
583 COPY_NODE(src->result, opline->result); in zend_optimize_block()
585 MAKE_NOP(opline); in zend_optimize_block()
596 if (opline->op1_type == IS_CONST) { in zend_optimize_block()
599 if (zend_is_true(&ZEND_OP1_LITERAL(opline)) == in zend_optimize_block()
600 (opline->opcode == ZEND_JMPZ)) { in zend_optimize_block()
602 MAKE_NOP(opline); in zend_optimize_block()
614 opline->opcode = ZEND_JMP; in zend_optimize_block()
615 COPY_NODE(opline->op1, opline->op2); in zend_optimize_block()
618 } else if (opline->op1_type == IS_TMP_VAR && in zend_optimize_block()
619 !zend_bitset_in(used_ext, VAR_NUM(opline->op1.var))) { in zend_optimize_block()
620 src = VAR_SOURCE(opline->op1); in zend_optimize_block()
623 VAR_SOURCE(opline->op1) = NULL; in zend_optimize_block()
624 COPY_NODE(opline->op1, src->op1); in zend_optimize_block()
626 opline->opcode = INV_COND(opline->opcode); in zend_optimize_block()
632 VAR_SOURCE(opline->op1) = NULL; in zend_optimize_block()
633 COPY_NODE(opline->op1, src->op1); in zend_optimize_block()
647 if (opline->op1_type == IS_CONST) { in zend_optimize_block()
648 bool is_jmpz_ex = opline->opcode == ZEND_JMPZ_EX; in zend_optimize_block()
649 if (zend_is_true(&ZEND_OP1_LITERAL(opline)) == is_jmpz_ex) { in zend_optimize_block()
652 opline->opcode = ZEND_QM_ASSIGN; in zend_optimize_block()
653 zval_ptr_dtor_nogc(&ZEND_OP1_LITERAL(opline)); in zend_optimize_block()
654 ZVAL_BOOL(&ZEND_OP1_LITERAL(opline), is_jmpz_ex); in zend_optimize_block()
655 opline->op2.num = 0; in zend_optimize_block()
661 } else if (opline->op1_type == IS_TMP_VAR && in zend_optimize_block()
662 (!zend_bitset_in(used_ext, VAR_NUM(opline->op1.var)) || in zend_optimize_block()
663 opline->result.var == opline->op1.var)) { in zend_optimize_block()
664 src = VAR_SOURCE(opline->op1); in zend_optimize_block()
668 VAR_SOURCE(opline->op1) = NULL; in zend_optimize_block()
669 COPY_NODE(opline->op1, src->op1); in zend_optimize_block()
682 if (opline->op1_type == IS_CONST && in zend_optimize_block()
683 opline->op2_type == IS_CONST) { in zend_optimize_block()
687 if (opline->op2_type == IS_CONST && in zend_optimize_block()
688 opline->op1_type == IS_TMP_VAR) { in zend_optimize_block()
690 src = VAR_SOURCE(opline->op1); in zend_optimize_block()
698 if (Z_TYPE(ZEND_OP2_LITERAL(opline)) != IS_STRING) { in zend_optimize_block()
699 convert_to_string(&ZEND_OP2_LITERAL(opline)); in zend_optimize_block()
705 VAR_SOURCE(opline->op1) = NULL; in zend_optimize_block()
706 COPY_NODE(opline->op1, src->op1); in zend_optimize_block()
708 l = old_len + Z_STRLEN(ZEND_OP2_LITERAL(opline)); in zend_optimize_block()
717 …OP2_LITERAL(src)) + old_len, Z_STRVAL(ZEND_OP2_LITERAL(opline)), Z_STRLEN(ZEND_OP2_LITERAL(opline)… in zend_optimize_block()
719 zval_ptr_dtor_str(&ZEND_OP2_LITERAL(opline)); in zend_optimize_block()
720 ZVAL_STR(&ZEND_OP2_LITERAL(opline), zend_new_interned_string(Z_STR(ZEND_OP2_LITERAL(src)))); in zend_optimize_block()
727 if (opline->op1_type & (IS_TMP_VAR|IS_VAR)) { in zend_optimize_block()
728 src = VAR_SOURCE(opline->op1); in zend_optimize_block()
734 VAR_SOURCE(opline->op1) = NULL; in zend_optimize_block()
735 COPY_NODE(opline->op1, src->op1); in zend_optimize_block()
740 if (opline->op2_type & (IS_TMP_VAR|IS_VAR)) { in zend_optimize_block()
741 src = VAR_SOURCE(opline->op2); in zend_optimize_block()
747 zend_op *src = VAR_SOURCE(opline->op2); in zend_optimize_block()
748 VAR_SOURCE(opline->op2) = NULL; in zend_optimize_block()
749 COPY_NODE(opline->op2, src->op1); in zend_optimize_block()
754 if (opline->op1_type == IS_CONST && in zend_optimize_block()
755 Z_TYPE(ZEND_OP1_LITERAL(opline)) == IS_STRING && in zend_optimize_block()
756 Z_STRLEN(ZEND_OP1_LITERAL(opline)) == 0) { in zend_optimize_block()
758 literal_dtor(&ZEND_OP1_LITERAL(opline)); in zend_optimize_block()
759 opline->opcode = ZEND_CAST; in zend_optimize_block()
760 opline->extended_value = IS_STRING; in zend_optimize_block()
761 COPY_NODE(opline->op1, opline->op2); in zend_optimize_block()
762 opline->op2_type = IS_UNUSED; in zend_optimize_block()
763 opline->op2.var = 0; in zend_optimize_block()
765 } else if (opline->op2_type == IS_CONST && in zend_optimize_block()
766 Z_TYPE(ZEND_OP2_LITERAL(opline)) == IS_STRING && in zend_optimize_block()
767 Z_STRLEN(ZEND_OP2_LITERAL(opline)) == 0) { in zend_optimize_block()
769 literal_dtor(&ZEND_OP2_LITERAL(opline)); in zend_optimize_block()
770 opline->opcode = ZEND_CAST; in zend_optimize_block()
771 opline->extended_value = IS_STRING; in zend_optimize_block()
772 opline->op2_type = IS_UNUSED; in zend_optimize_block()
773 opline->op2.var = 0; in zend_optimize_block()
775 } else if (opline->opcode == ZEND_CONCAT && in zend_optimize_block()
776 (opline->op1_type == IS_CONST || in zend_optimize_block()
777 (opline->op1_type == IS_TMP_VAR && in zend_optimize_block()
778 VAR_SOURCE(opline->op1) && in zend_optimize_block()
779 (VAR_SOURCE(opline->op1)->opcode == ZEND_FAST_CONCAT || in zend_optimize_block()
780 VAR_SOURCE(opline->op1)->opcode == ZEND_ROPE_END || in zend_optimize_block()
781 VAR_SOURCE(opline->op1)->opcode == ZEND_FETCH_CONSTANT || in zend_optimize_block()
782 VAR_SOURCE(opline->op1)->opcode == ZEND_FETCH_CLASS_CONSTANT))) && in zend_optimize_block()
783 (opline->op2_type == IS_CONST || in zend_optimize_block()
784 (opline->op2_type == IS_TMP_VAR && in zend_optimize_block()
785 VAR_SOURCE(opline->op2) && in zend_optimize_block()
786 (VAR_SOURCE(opline->op2)->opcode == ZEND_FAST_CONCAT || in zend_optimize_block()
787 VAR_SOURCE(opline->op2)->opcode == ZEND_ROPE_END || in zend_optimize_block()
788 VAR_SOURCE(opline->op2)->opcode == ZEND_FETCH_CONSTANT || in zend_optimize_block()
789 VAR_SOURCE(opline->op2)->opcode == ZEND_FETCH_CLASS_CONSTANT)))) { in zend_optimize_block()
790 opline->opcode = ZEND_FAST_CONCAT; in zend_optimize_block()
810 if (opline->op1_type == IS_CONST && in zend_optimize_block()
811 opline->op2_type == IS_CONST) { in zend_optimize_block()
816 …if (zend_optimizer_eval_binary_op(&result, opline->opcode, &ZEND_OP1_LITERAL(opline), &ZEND_OP2_LI… in zend_optimize_block()
817 literal_dtor(&ZEND_OP1_LITERAL(opline)); in zend_optimize_block()
818 literal_dtor(&ZEND_OP2_LITERAL(opline)); in zend_optimize_block()
819 opline->opcode = ZEND_QM_ASSIGN; in zend_optimize_block()
820 SET_UNUSED(opline->op2); in zend_optimize_block()
821 zend_optimizer_update_op1_const(op_array, opline, &result); in zend_optimize_block()
828 if (opline->op1_type == IS_CONST) { in zend_optimize_block()
833 … if (zend_optimizer_eval_unary_op(&result, opline->opcode, &ZEND_OP1_LITERAL(opline)) == SUCCESS) { in zend_optimize_block()
834 literal_dtor(&ZEND_OP1_LITERAL(opline)); in zend_optimize_block()
835 opline->opcode = ZEND_QM_ASSIGN; in zend_optimize_block()
836 zend_optimizer_update_op1_const(op_array, opline, &result); in zend_optimize_block()
843 if (opline->op1_type == IS_CONST) { in zend_optimize_block()
847 …if (zend_optimizer_eval_cast(&result, opline->extended_value, &ZEND_OP1_LITERAL(opline)) == SUCCES… in zend_optimize_block()
848 literal_dtor(&ZEND_OP1_LITERAL(opline)); in zend_optimize_block()
849 opline->opcode = ZEND_QM_ASSIGN; in zend_optimize_block()
850 opline->extended_value = 0; in zend_optimize_block()
851 zend_optimizer_update_op1_const(op_array, opline, &result); in zend_optimize_block()
858 if (opline->op1_type == IS_CONST) { in zend_optimize_block()
861 if (zend_optimizer_eval_strlen(&result, &ZEND_OP1_LITERAL(opline)) == SUCCESS) { in zend_optimize_block()
862 literal_dtor(&ZEND_OP1_LITERAL(opline)); in zend_optimize_block()
863 opline->opcode = ZEND_QM_ASSIGN; in zend_optimize_block()
864 zend_optimizer_update_op1_const(op_array, opline, &result); in zend_optimize_block()
871 if (opline->op1_type == IS_TMP_VAR) { in zend_optimize_block()
872 src = VAR_SOURCE(opline->op1); in zend_optimize_block()
877 while (op < opline) { in zend_optimize_block()
878 if ((op->op1_type == opline->op1_type in zend_optimize_block()
879 && op->op1.var == opline->op1.var) in zend_optimize_block()
880 || (op->op2_type == opline->op1_type in zend_optimize_block()
881 && op->op2.var == opline->op1.var)) { in zend_optimize_block()
890 VAR_SOURCE(opline->op1) = NULL; in zend_optimize_block()
891 COPY_NODE(opline->op1, src->op1); in zend_optimize_block()
900 if (opline->op1_type == opline->result_type && in zend_optimize_block()
901 opline->op1.var == opline->result.var) { in zend_optimize_block()
903 MAKE_NOP(opline); in zend_optimize_block()
905 } else if (opline->op1_type == IS_TMP_VAR && in zend_optimize_block()
906 opline->result_type == IS_TMP_VAR && in zend_optimize_block()
907 !zend_bitset_in(used_ext, VAR_NUM(opline->op1.var))) { in zend_optimize_block()
909 src = VAR_SOURCE(opline->op1); in zend_optimize_block()
915 src == opline -1)) { in zend_optimize_block()
916 src->result.var = opline->result.var; in zend_optimize_block()
917 VAR_SOURCE(opline->op1) = NULL; in zend_optimize_block()
918 VAR_SOURCE(opline->result) = src; in zend_optimize_block()
919 MAKE_NOP(opline); in zend_optimize_block()
927 if (opline->result_type & (IS_VAR|IS_TMP_VAR)) { in zend_optimize_block()
928 SET_VAR_SOURCE(opline); in zend_optimize_block()
930 opline++; in zend_optimize_block()
941 zend_op *opline; in assemble_code_blocks() local
949 opline = op_array->opcodes + b->start + b->len - 1; in assemble_code_blocks()
950 if (opline->opcode == ZEND_JMP) { in assemble_code_blocks()
958 MAKE_NOP(opline); in assemble_code_blocks()
961 } else if (b->len == 1 && opline->opcode == ZEND_NOP) { in assemble_code_blocks()
982 opline = new_opcodes; in assemble_code_blocks()
987 memcpy(opline, op_array->opcodes + b->start, b->len * sizeof(zend_op)); in assemble_code_blocks()
988 b->start = opline - new_opcodes; in assemble_code_blocks()
989 opline += b->len; in assemble_code_blocks()
1002 opline = op_array->opcodes + b->start + b->len - 1; in assemble_code_blocks()
1003 switch (opline->opcode) { in assemble_code_blocks()
1006 ZEND_SET_OP_JMP_ADDR(opline, opline->op1, new_opcodes + blocks[b->successors[0]].start); in assemble_code_blocks()
1020 ZEND_SET_OP_JMP_ADDR(opline, opline->op2, new_opcodes + blocks[b->successors[0]].start); in assemble_code_blocks()
1023 if (!(opline->extended_value & ZEND_LAST_CATCH)) { in assemble_code_blocks()
1024 ZEND_SET_OP_JMP_ADDR(opline, opline->op2, new_opcodes + blocks[b->successors[0]].start); in assemble_code_blocks()
1029 …opline->extended_value = ZEND_OPLINE_TO_OFFSET(opline, new_opcodes + blocks[b->successors[0]].star… in assemble_code_blocks()
1035 HashTable *jumptable = Z_ARRVAL(ZEND_OP2_LITERAL(opline)); in assemble_code_blocks()
1038 …ZEND_ASSERT(b->successors_count == (opline->opcode == ZEND_MATCH ? 1 : 2) + zend_hash_num_elements… in assemble_code_blocks()
1041 Z_LVAL_P(zv) = ZEND_OPLINE_TO_OFFSET(opline, new_opcodes + blocks[b->successors[s++]].start); in assemble_code_blocks()
1043 …opline->extended_value = ZEND_OPLINE_TO_OFFSET(opline, new_opcodes + blocks[b->successors[s++]].st… in assemble_code_blocks()
1086 zend_op *opline = new_opcodes; in assemble_code_blocks() local
1087 zend_op *end = opline + len; in assemble_code_blocks()
1088 while (opline < end) { in assemble_code_blocks()
1089 if (opline->opcode == ZEND_FAST_RET && in assemble_code_blocks()
1090 opline->op2.num != (uint32_t)-1 && in assemble_code_blocks()
1091 opline->op2.num < (uint32_t)j) { in assemble_code_blocks()
1092 opline->op2.num = map[opline->op2.num]; in assemble_code_blocks()
1094 opline++; in assemble_code_blocks()
1418 zend_op *opline, *end; in zend_t_usage() local
1438 opline = op_array->opcodes + block->start; in zend_t_usage()
1439 end = opline + block->len; in zend_t_usage()
1446 while (opline<end) { in zend_t_usage()
1447 if (opline->op1_type & (IS_VAR|IS_TMP_VAR)) { in zend_t_usage()
1448 var_num = VAR_NUM(opline->op1.var); in zend_t_usage()
1453 if (opline->op2_type == IS_VAR) { in zend_t_usage()
1454 var_num = VAR_NUM(opline->op2.var); in zend_t_usage()
1455 if (opline->opcode == ZEND_FE_FETCH_R || in zend_t_usage()
1456 opline->opcode == ZEND_FE_FETCH_RW) { in zend_t_usage()
1462 } else if (opline->op2_type == IS_TMP_VAR) { in zend_t_usage()
1463 var_num = VAR_NUM(opline->op2.var); in zend_t_usage()
1469 if (opline->result_type == IS_VAR) { in zend_t_usage()
1470 var_num = VAR_NUM(opline->result.var); in zend_t_usage()
1472 } else if (opline->result_type == IS_TMP_VAR) { in zend_t_usage()
1473 var_num = VAR_NUM(opline->result.var); in zend_t_usage()
1474 switch (opline->opcode) { in zend_t_usage()
1487 opline++; in zend_t_usage()
1520 opline = end + block->len - 1; in zend_t_usage()
1531 while (opline >= end) { in zend_t_usage()
1533 if (opline->result_type & (IS_VAR|IS_TMP_VAR)) { in zend_t_usage()
1534 if (!zend_bitset_in(usage, VAR_NUM(opline->result.var))) { in zend_t_usage()
1535 switch (opline->opcode) { in zend_t_usage()
1548 opline->result_type = IS_UNUSED; in zend_t_usage()
1556 opline->opcode -= 2; in zend_t_usage()
1557 opline->result_type = IS_UNUSED; in zend_t_usage()
1562 zend_optimizer_convert_to_free_op1(op_array, opline); in zend_t_usage()
1566 opline->opcode -= 3; in zend_t_usage()
1567 SET_UNUSED(opline->result); in zend_t_usage()
1572 zend_bitset_incl(usage, VAR_NUM(opline->result.var)); in zend_t_usage()
1576 switch (opline->opcode) { in zend_t_usage()
1582 zend_bitset_excl(usage, VAR_NUM(opline->result.var)); in zend_t_usage()
1588 if (opline->op2_type == IS_VAR) { in zend_t_usage()
1589 switch (opline->opcode) { in zend_t_usage()
1592 zend_bitset_excl(usage, VAR_NUM(opline->op2.var)); in zend_t_usage()
1595 zend_bitset_incl(usage, VAR_NUM(opline->op2.var)); in zend_t_usage()
1598 } else if (opline->op2_type == IS_TMP_VAR) { in zend_t_usage()
1599 zend_bitset_incl(usage, VAR_NUM(opline->op2.var)); in zend_t_usage()
1602 if (opline->op1_type & (IS_VAR|IS_TMP_VAR)) { in zend_t_usage()
1603 zend_bitset_incl(usage, VAR_NUM(opline->op1.var)); in zend_t_usage()
1606 opline--; in zend_t_usage()
1731 zend_op *opline = &op_array->opcodes[i]; in zend_optimize_cfg() local
1732 if (!zend_optimizer_is_loop_var_free(opline)) { in zend_optimize_cfg()
1733 MAKE_NOP(opline); in zend_optimize_cfg()