Lines Matching refs:src
137 zend_op *opline, *src; in zend_optimize_block() local
155 src = VAR_SOURCE(opline->op1); in zend_optimize_block()
156 if (src && in zend_optimize_block()
157 src->opcode == ZEND_QM_ASSIGN && in zend_optimize_block()
158 src->op1_type == IS_CONST in zend_optimize_block()
163 COPY_NODE(opline->op1, src->op1); in zend_optimize_block()
165 MAKE_NOP(src); in zend_optimize_block()
169 ZVAL_COPY(&c, &ZEND_OP1_LITERAL(src)); in zend_optimize_block()
172 literal_dtor(&ZEND_OP1_LITERAL(src)); in zend_optimize_block()
173 MAKE_NOP(src); in zend_optimize_block()
184 src = VAR_SOURCE(opline->op2); in zend_optimize_block()
185 if (src && in zend_optimize_block()
186 src->opcode == ZEND_QM_ASSIGN && in zend_optimize_block()
187 src->op1_type == IS_CONST) { in zend_optimize_block()
192 ZVAL_COPY(&c, &ZEND_OP1_LITERAL(src)); in zend_optimize_block()
195 literal_dtor(&ZEND_OP1_LITERAL(src)); in zend_optimize_block()
196 MAKE_NOP(src); in zend_optimize_block()
207 src = VAR_SOURCE(opline->op1); in zend_optimize_block()
208 if (src && in zend_optimize_block()
209 src->opcode == ZEND_CAST && in zend_optimize_block()
210 src->extended_value == IS_STRING) { in zend_optimize_block()
213 COPY_NODE(opline->op1, src->op1); in zend_optimize_block()
214 MAKE_NOP(src); in zend_optimize_block()
256 src = VAR_SOURCE(opline->op1); in zend_optimize_block()
257 if (src) { in zend_optimize_block()
258 switch (src->opcode) { in zend_optimize_block()
281 src->result_type = IS_UNUSED; in zend_optimize_block()
291 src = VAR_SOURCE(opline->op1); in zend_optimize_block()
293 if (src && in zend_optimize_block()
294 src->opcode != ZEND_FETCH_R && in zend_optimize_block()
295 src->opcode != ZEND_FETCH_STATIC_PROP_R && in zend_optimize_block()
296 src->opcode != ZEND_FETCH_DIM_R && in zend_optimize_block()
297 src->opcode != ZEND_FETCH_OBJ_R && in zend_optimize_block()
298 src->opcode != ZEND_NEW && in zend_optimize_block()
299 src->opcode != ZEND_FETCH_THIS) { in zend_optimize_block()
300 src->result_type = IS_UNUSED; in zend_optimize_block()
303 if (src->opcode == ZEND_QM_ASSIGN) { in zend_optimize_block()
304 if (src->op1_type & (IS_VAR|IS_TMP_VAR)) { in zend_optimize_block()
305 src->opcode = ZEND_FREE; in zend_optimize_block()
307 MAKE_NOP(src); in zend_optimize_block()
454 src = VAR_SOURCE(opline->op1); in zend_optimize_block()
455 if (src) { in zend_optimize_block()
456 switch (src->opcode) { in zend_optimize_block()
460 COPY_NODE(opline->op1, src->op1); in zend_optimize_block()
462 MAKE_NOP(src); in zend_optimize_block()
468 COPY_NODE(opline->op1, src->op1); in zend_optimize_block()
469 MAKE_NOP(src); in zend_optimize_block()
474 src->opcode = ZEND_IS_NOT_EQUAL; in zend_optimize_block()
476 COPY_NODE(src->result, opline->result); in zend_optimize_block()
477 SET_VAR_SOURCE(src); in zend_optimize_block()
483 src->opcode = ZEND_IS_EQUAL; in zend_optimize_block()
485 COPY_NODE(src->result, opline->result); in zend_optimize_block()
486 SET_VAR_SOURCE(src); in zend_optimize_block()
492 src->opcode = ZEND_IS_NOT_IDENTICAL; in zend_optimize_block()
494 COPY_NODE(src->result, opline->result); in zend_optimize_block()
495 SET_VAR_SOURCE(src); in zend_optimize_block()
501 src->opcode = ZEND_IS_IDENTICAL; in zend_optimize_block()
503 COPY_NODE(src->result, opline->result); in zend_optimize_block()
504 SET_VAR_SOURCE(src); in zend_optimize_block()
513 src->opcode = ZEND_IS_SMALLER_OR_EQUAL; in zend_optimize_block()
514 tmp_type = src->op1_type; in zend_optimize_block()
515 src->op1_type = src->op2_type; in zend_optimize_block()
516 src->op2_type = tmp_type; in zend_optimize_block()
517 tmp = src->op1.num; in zend_optimize_block()
518 src->op1.num = src->op2.num; in zend_optimize_block()
519 src->op2.num = tmp; in zend_optimize_block()
521 COPY_NODE(src->result, opline->result); in zend_optimize_block()
522 SET_VAR_SOURCE(src); in zend_optimize_block()
531 src->opcode = ZEND_IS_SMALLER; in zend_optimize_block()
532 tmp_type = src->op1_type; in zend_optimize_block()
533 src->op1_type = src->op2_type; in zend_optimize_block()
534 src->op2_type = tmp_type; in zend_optimize_block()
535 tmp = src->op1.num; in zend_optimize_block()
536 src->op1.num = src->op2.num; in zend_optimize_block()
537 src->op2.num = tmp; in zend_optimize_block()
539 COPY_NODE(src->result, opline->result); in zend_optimize_block()
540 SET_VAR_SOURCE(src); in zend_optimize_block()
557 COPY_NODE(src->result, opline->result); in zend_optimize_block()
558 SET_VAR_SOURCE(src); in zend_optimize_block()
594 src = VAR_SOURCE(opline->op1); in zend_optimize_block()
595 if (src) { in zend_optimize_block()
596 if (src->opcode == ZEND_BOOL_NOT) { in zend_optimize_block()
598 COPY_NODE(opline->op1, src->op1); in zend_optimize_block()
601 MAKE_NOP(src); in zend_optimize_block()
604 } else if (src->opcode == ZEND_BOOL || in zend_optimize_block()
605 src->opcode == ZEND_QM_ASSIGN) { in zend_optimize_block()
607 COPY_NODE(opline->op1, src->op1); in zend_optimize_block()
608 MAKE_NOP(src); in zend_optimize_block()
637 src = VAR_SOURCE(opline->op1); in zend_optimize_block()
638 if (src) { in zend_optimize_block()
639 if (src->opcode == ZEND_BOOL_NOT) { in zend_optimize_block()
644 COPY_NODE(opline->op1, src->op1); in zend_optimize_block()
648 MAKE_NOP(src); in zend_optimize_block()
651 } else if (src->opcode == ZEND_BOOL || in zend_optimize_block()
652 src->opcode == ZEND_QM_ASSIGN) { in zend_optimize_block()
654 COPY_NODE(opline->op1, src->op1); in zend_optimize_block()
655 MAKE_NOP(src); in zend_optimize_block()
685 src = VAR_SOURCE(opline->op1); in zend_optimize_block()
686 if (src) { in zend_optimize_block()
687 if (src->opcode == ZEND_BOOL || in zend_optimize_block()
688 src->opcode == ZEND_QM_ASSIGN) { in zend_optimize_block()
690 COPY_NODE(opline->op1, src->op1); in zend_optimize_block()
691 MAKE_NOP(src); in zend_optimize_block()
711 src = VAR_SOURCE(opline->op1); in zend_optimize_block()
712 if (src && in zend_optimize_block()
713 (src->opcode == ZEND_CONCAT || in zend_optimize_block()
714 src->opcode == ZEND_FAST_CONCAT) && in zend_optimize_block()
715 src->op2_type == IS_CONST) { in zend_optimize_block()
722 if (Z_TYPE(ZEND_OP2_LITERAL(src)) != IS_STRING) { in zend_optimize_block()
723 convert_to_string(&ZEND_OP2_LITERAL(src)); in zend_optimize_block()
727 COPY_NODE(opline->op1, src->op1); in zend_optimize_block()
728 old_len = Z_STRLEN(ZEND_OP2_LITERAL(src)); in zend_optimize_block()
730 if (!Z_REFCOUNTED(ZEND_OP2_LITERAL(src))) { in zend_optimize_block()
732 memcpy(ZSTR_VAL(tmp), Z_STRVAL(ZEND_OP2_LITERAL(src)), old_len); in zend_optimize_block()
733 Z_STR(ZEND_OP2_LITERAL(src)) = tmp; in zend_optimize_block()
735 Z_STR(ZEND_OP2_LITERAL(src)) = zend_string_extend(Z_STR(ZEND_OP2_LITERAL(src)), l, 0); in zend_optimize_block()
737 Z_TYPE_INFO(ZEND_OP2_LITERAL(src)) = IS_STRING_EX; in zend_optimize_block()
738 …memcpy(Z_STRVAL(ZEND_OP2_LITERAL(src)) + old_len, Z_STRVAL(ZEND_OP2_LITERAL(opline)), Z_STRLEN(ZEN… in zend_optimize_block()
739 Z_STRVAL(ZEND_OP2_LITERAL(src))[l] = '\0'; in zend_optimize_block()
741 ZVAL_STR(&ZEND_OP2_LITERAL(opline), zend_new_interned_string(Z_STR(ZEND_OP2_LITERAL(src)))); in zend_optimize_block()
742 ZVAL_NULL(&ZEND_OP2_LITERAL(src)); in zend_optimize_block()
743 MAKE_NOP(src); in zend_optimize_block()
749 src = VAR_SOURCE(opline->op1); in zend_optimize_block()
750 if (src && in zend_optimize_block()
751 src->opcode == ZEND_CAST && in zend_optimize_block()
752 src->extended_value == IS_STRING && in zend_optimize_block()
753 src->op1_type != IS_CONST) { in zend_optimize_block()
756 COPY_NODE(opline->op1, src->op1); in zend_optimize_block()
757 MAKE_NOP(src); in zend_optimize_block()
762 src = VAR_SOURCE(opline->op2); in zend_optimize_block()
763 if (src && in zend_optimize_block()
764 src->opcode == ZEND_CAST && in zend_optimize_block()
765 src->extended_value == IS_STRING && in zend_optimize_block()
766 src->op1_type != IS_CONST) { in zend_optimize_block()
768 zend_op *src = VAR_SOURCE(opline->op2); in zend_optimize_block() local
770 COPY_NODE(opline->op2, src->op1); in zend_optimize_block()
771 MAKE_NOP(src); in zend_optimize_block()
894 src = VAR_SOURCE(opline->op1); in zend_optimize_block()
895 if (src && src->opcode == ZEND_QM_ASSIGN) { in zend_optimize_block()
896 zend_op *op = src + 1; in zend_optimize_block()
913 COPY_NODE(opline->op1, src->op1); in zend_optimize_block()
914 MAKE_NOP(src); in zend_optimize_block()
931 src = VAR_SOURCE(opline->op1); in zend_optimize_block()
932 if (src && in zend_optimize_block()
933 src->opcode != ZEND_COPY_TMP && in zend_optimize_block()
934 src->opcode != ZEND_ADD_ARRAY_ELEMENT && in zend_optimize_block()
935 src->opcode != ZEND_ADD_ARRAY_UNPACK && in zend_optimize_block()
936 (src->opcode != ZEND_DECLARE_LAMBDA_FUNCTION || in zend_optimize_block()
937 src == opline -1)) { in zend_optimize_block()
938 src->result.var = opline->result.var; in zend_optimize_block()
940 VAR_SOURCE(opline->result) = src; in zend_optimize_block()