Lines Matching refs:src

136 	zend_op *opline, *src;  in zend_optimize_block()  local
154 src = VAR_SOURCE(opline->op1); in zend_optimize_block()
155 if (src && in zend_optimize_block()
156 src->opcode == ZEND_QM_ASSIGN && in zend_optimize_block()
157 src->op1_type == IS_CONST in zend_optimize_block()
162 COPY_NODE(opline->op1, src->op1); in zend_optimize_block()
164 MAKE_NOP(src); in zend_optimize_block()
168 ZVAL_COPY(&c, &ZEND_OP1_LITERAL(src)); in zend_optimize_block()
179 && !zend_bitset_in(used_ext, VAR_NUM(src->result.var))) { in zend_optimize_block()
180 literal_dtor(&ZEND_OP1_LITERAL(src)); in zend_optimize_block()
181 MAKE_NOP(src); in zend_optimize_block()
193 src = VAR_SOURCE(opline->op2); in zend_optimize_block()
194 if (src && in zend_optimize_block()
195 src->opcode == ZEND_QM_ASSIGN && in zend_optimize_block()
196 src->op1_type == IS_CONST) { in zend_optimize_block()
201 ZVAL_COPY(&c, &ZEND_OP1_LITERAL(src)); in zend_optimize_block()
204 if (!zend_bitset_in(used_ext, VAR_NUM(src->result.var))) { in zend_optimize_block()
205 literal_dtor(&ZEND_OP1_LITERAL(src)); in zend_optimize_block()
206 MAKE_NOP(src); in zend_optimize_block()
218 src = VAR_SOURCE(opline->op1); in zend_optimize_block()
219 if (src && in zend_optimize_block()
220 src->opcode == ZEND_CAST && in zend_optimize_block()
221 src->extended_value == IS_STRING) { in zend_optimize_block()
224 COPY_NODE(opline->op1, src->op1); in zend_optimize_block()
225 MAKE_NOP(src); in zend_optimize_block()
267 src = VAR_SOURCE(opline->op1); in zend_optimize_block()
278 src = VAR_SOURCE(opline->op1); in zend_optimize_block()
279 if (src) { in zend_optimize_block()
280 switch (src->opcode) { in zend_optimize_block()
304 if (src < op_array->opcodes + block->start) { in zend_optimize_block()
307 src->result_type = IS_UNUSED; in zend_optimize_block()
317 src = VAR_SOURCE(opline->op1); in zend_optimize_block()
319 if (src >= op_array->opcodes + block->start && in zend_optimize_block()
320 src->opcode != ZEND_FETCH_R && in zend_optimize_block()
321 src->opcode != ZEND_FETCH_STATIC_PROP_R && in zend_optimize_block()
322 src->opcode != ZEND_FETCH_DIM_R && in zend_optimize_block()
323 src->opcode != ZEND_FETCH_OBJ_R && in zend_optimize_block()
324 src->opcode != ZEND_NEW && in zend_optimize_block()
325 src->opcode != ZEND_FETCH_THIS) { in zend_optimize_block()
326 src->result_type = IS_UNUSED; in zend_optimize_block()
329 if (src->opcode == ZEND_QM_ASSIGN) { in zend_optimize_block()
330 if (src->op1_type & (IS_VAR|IS_TMP_VAR)) { in zend_optimize_block()
331 src->opcode = ZEND_FREE; in zend_optimize_block()
333 MAKE_NOP(src); in zend_optimize_block()
480 src = VAR_SOURCE(opline->op1); in zend_optimize_block()
481 if (src) { in zend_optimize_block()
482 switch (src->opcode) { in zend_optimize_block()
486 COPY_NODE(opline->op1, src->op1); in zend_optimize_block()
488 MAKE_NOP(src); in zend_optimize_block()
494 COPY_NODE(opline->op1, src->op1); in zend_optimize_block()
495 MAKE_NOP(src); in zend_optimize_block()
500 src->opcode = ZEND_IS_NOT_EQUAL; in zend_optimize_block()
502 COPY_NODE(src->result, opline->result); in zend_optimize_block()
503 SET_VAR_SOURCE(src); in zend_optimize_block()
509 src->opcode = ZEND_IS_EQUAL; in zend_optimize_block()
511 COPY_NODE(src->result, opline->result); in zend_optimize_block()
512 SET_VAR_SOURCE(src); in zend_optimize_block()
518 src->opcode = ZEND_IS_NOT_IDENTICAL; in zend_optimize_block()
520 COPY_NODE(src->result, opline->result); in zend_optimize_block()
521 SET_VAR_SOURCE(src); in zend_optimize_block()
527 src->opcode = ZEND_IS_IDENTICAL; in zend_optimize_block()
529 COPY_NODE(src->result, opline->result); in zend_optimize_block()
530 SET_VAR_SOURCE(src); in zend_optimize_block()
539 src->opcode = ZEND_IS_SMALLER_OR_EQUAL; in zend_optimize_block()
540 tmp_type = src->op1_type; in zend_optimize_block()
541 src->op1_type = src->op2_type; in zend_optimize_block()
542 src->op2_type = tmp_type; in zend_optimize_block()
543 tmp = src->op1.num; in zend_optimize_block()
544 src->op1.num = src->op2.num; in zend_optimize_block()
545 src->op2.num = tmp; in zend_optimize_block()
547 COPY_NODE(src->result, opline->result); in zend_optimize_block()
548 SET_VAR_SOURCE(src); in zend_optimize_block()
557 src->opcode = ZEND_IS_SMALLER; in zend_optimize_block()
558 tmp_type = src->op1_type; in zend_optimize_block()
559 src->op1_type = src->op2_type; in zend_optimize_block()
560 src->op2_type = tmp_type; in zend_optimize_block()
561 tmp = src->op1.num; in zend_optimize_block()
562 src->op1.num = src->op2.num; in zend_optimize_block()
563 src->op2.num = tmp; in zend_optimize_block()
565 COPY_NODE(src->result, opline->result); in zend_optimize_block()
566 SET_VAR_SOURCE(src); in zend_optimize_block()
583 COPY_NODE(src->result, opline->result); in zend_optimize_block()
584 SET_VAR_SOURCE(src); in zend_optimize_block()
620 src = VAR_SOURCE(opline->op1); in zend_optimize_block()
621 if (src) { in zend_optimize_block()
622 if (src->opcode == ZEND_BOOL_NOT) { in zend_optimize_block()
624 COPY_NODE(opline->op1, src->op1); in zend_optimize_block()
627 MAKE_NOP(src); in zend_optimize_block()
630 } else if (src->opcode == ZEND_BOOL || in zend_optimize_block()
631 src->opcode == ZEND_QM_ASSIGN) { in zend_optimize_block()
633 COPY_NODE(opline->op1, src->op1); in zend_optimize_block()
634 MAKE_NOP(src); in zend_optimize_block()
664 src = VAR_SOURCE(opline->op1); in zend_optimize_block()
665 if (src) { in zend_optimize_block()
666 if (src->opcode == ZEND_BOOL || in zend_optimize_block()
667 src->opcode == ZEND_QM_ASSIGN) { in zend_optimize_block()
669 COPY_NODE(opline->op1, src->op1); in zend_optimize_block()
670 MAKE_NOP(src); in zend_optimize_block()
690 src = VAR_SOURCE(opline->op1); in zend_optimize_block()
691 if (src && in zend_optimize_block()
692 (src->opcode == ZEND_CONCAT || in zend_optimize_block()
693 src->opcode == ZEND_FAST_CONCAT) && in zend_optimize_block()
694 src->op2_type == IS_CONST) { in zend_optimize_block()
701 if (Z_TYPE(ZEND_OP2_LITERAL(src)) != IS_STRING) { in zend_optimize_block()
702 convert_to_string(&ZEND_OP2_LITERAL(src)); in zend_optimize_block()
706 COPY_NODE(opline->op1, src->op1); in zend_optimize_block()
707 old_len = Z_STRLEN(ZEND_OP2_LITERAL(src)); in zend_optimize_block()
709 if (!Z_REFCOUNTED(ZEND_OP2_LITERAL(src))) { in zend_optimize_block()
711 memcpy(ZSTR_VAL(tmp), Z_STRVAL(ZEND_OP2_LITERAL(src)), old_len); in zend_optimize_block()
712 Z_STR(ZEND_OP2_LITERAL(src)) = tmp; in zend_optimize_block()
714 Z_STR(ZEND_OP2_LITERAL(src)) = zend_string_extend(Z_STR(ZEND_OP2_LITERAL(src)), l, 0); in zend_optimize_block()
716 Z_TYPE_INFO(ZEND_OP2_LITERAL(src)) = IS_STRING_EX; in zend_optimize_block()
717 …memcpy(Z_STRVAL(ZEND_OP2_LITERAL(src)) + old_len, Z_STRVAL(ZEND_OP2_LITERAL(opline)), Z_STRLEN(ZEN… in zend_optimize_block()
718 Z_STRVAL(ZEND_OP2_LITERAL(src))[l] = '\0'; 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()
721 ZVAL_NULL(&ZEND_OP2_LITERAL(src)); in zend_optimize_block()
722 MAKE_NOP(src); in zend_optimize_block()
728 src = VAR_SOURCE(opline->op1); in zend_optimize_block()
729 if (src && in zend_optimize_block()
730 src->opcode == ZEND_CAST && in zend_optimize_block()
731 src->extended_value == IS_STRING && in zend_optimize_block()
732 src->op1_type != IS_CONST) { in zend_optimize_block()
735 COPY_NODE(opline->op1, src->op1); in zend_optimize_block()
736 MAKE_NOP(src); in zend_optimize_block()
741 src = VAR_SOURCE(opline->op2); in zend_optimize_block()
742 if (src && in zend_optimize_block()
743 src->opcode == ZEND_CAST && in zend_optimize_block()
744 src->extended_value == IS_STRING && in zend_optimize_block()
745 src->op1_type != IS_CONST) { in zend_optimize_block()
747 zend_op *src = VAR_SOURCE(opline->op2); in zend_optimize_block() local
749 COPY_NODE(opline->op2, src->op1); in zend_optimize_block()
750 MAKE_NOP(src); in zend_optimize_block()
872 src = VAR_SOURCE(opline->op1); in zend_optimize_block()
873 if (src && src->opcode == ZEND_QM_ASSIGN) { in zend_optimize_block()
874 zend_op *op = src + 1; in zend_optimize_block()
891 COPY_NODE(opline->op1, src->op1); in zend_optimize_block()
892 MAKE_NOP(src); in zend_optimize_block()
909 src = VAR_SOURCE(opline->op1); in zend_optimize_block()
910 if (src && in zend_optimize_block()
911 src->opcode != ZEND_COPY_TMP && in zend_optimize_block()
912 src->opcode != ZEND_ADD_ARRAY_ELEMENT && in zend_optimize_block()
913 src->opcode != ZEND_ADD_ARRAY_UNPACK && in zend_optimize_block()
914 (src->opcode != ZEND_DECLARE_LAMBDA_FUNCTION || in zend_optimize_block()
915 src == opline -1)) { in zend_optimize_block()
916 src->result.var = opline->result.var; in zend_optimize_block()
918 VAR_SOURCE(opline->result) = src; in zend_optimize_block()