Lines Matching refs:op1

193 		return CT_CONSTANT_EX(ctx->scdf.op_array, opline->op1.constant);  in get_op1_value()
317 opline->op1.constant = zend_optimizer_add_literal(ctx->scdf.op_array, &zv); in try_replace_op1()
325 opline->op1.constant = zend_optimizer_add_literal(ctx->scdf.op_array, &zv); in try_replace_op1()
375 static inline int ct_eval_binary_op(zval *result, zend_uchar binop, zval *op1, zval *op2) { in ct_eval_binary_op() argument
377 if (IS_PARTIAL_ARRAY(op1) || IS_PARTIAL_ARRAY(op2)) { in ct_eval_binary_op()
381 return zend_optimizer_eval_binary_op(result, binop, op1, op2); in ct_eval_binary_op()
416 static inline int fetch_array_elem(zval **result, zval *op1, zval *op2) { in fetch_array_elem() argument
419 *result = zend_hash_find(Z_ARR_P(op1), ZSTR_EMPTY_ALLOC()); in fetch_array_elem()
422 *result = zend_hash_index_find(Z_ARR_P(op1), 0); in fetch_array_elem()
425 *result = zend_hash_index_find(Z_ARR_P(op1), 1); in fetch_array_elem()
428 *result = zend_hash_index_find(Z_ARR_P(op1), Z_LVAL_P(op2)); in fetch_array_elem()
435 *result = zend_hash_index_find(Z_ARR_P(op1), lval); in fetch_array_elem()
439 *result = zend_symtable_find(Z_ARR_P(op1), Z_STR_P(op2)); in fetch_array_elem()
446 static inline int ct_eval_fetch_dim(zval *result, zval *op1, zval *op2, int support_strings) { in ct_eval_fetch_dim() argument
447 if (Z_TYPE_P(op1) == IS_ARRAY || IS_PARTIAL_ARRAY(op1)) { in ct_eval_fetch_dim()
449 if (fetch_array_elem(&value, op1, op2) == SUCCESS && value && !IS_BOT(value)) { in ct_eval_fetch_dim()
453 } else if (support_strings && Z_TYPE_P(op1) == IS_STRING) { in ct_eval_fetch_dim()
458 if (index >= 0 && index < Z_STRLEN_P(op1)) { in ct_eval_fetch_dim()
459 ZVAL_STR(result, zend_string_init(&Z_STRVAL_P(op1)[index], 1, 0)); in ct_eval_fetch_dim()
467 static inline int ct_eval_isset_isempty(zval *result, uint32_t extended_value, zval *op1) { in ct_eval_isset_isempty() argument
470 ZVAL_BOOL(result, op1 && Z_TYPE_P(op1) != IS_NULL); in ct_eval_isset_isempty()
472 } else if (!op1) { in ct_eval_isset_isempty()
475 } else if (ct_eval_bool_cast(&zv, op1) == SUCCESS) { in ct_eval_isset_isempty()
483 static inline int ct_eval_isset_dim(zval *result, uint32_t extended_value, zval *op1, zval *op2) { in ct_eval_isset_dim() argument
484 if (Z_TYPE_P(op1) == IS_ARRAY || IS_PARTIAL_ARRAY(op1)) { in ct_eval_isset_dim()
486 if (fetch_array_elem(&value, op1, op2) == FAILURE) { in ct_eval_isset_dim()
489 if (IS_PARTIAL_ARRAY(op1) && (!value || IS_BOT(value))) { in ct_eval_isset_dim()
493 } else if (Z_TYPE_P(op1) == IS_STRING) { in ct_eval_isset_dim()
646 static inline int fetch_obj_prop(zval **result, zval *op1, zval *op2) { in fetch_obj_prop() argument
649 *result = zend_symtable_find(Z_ARR_P(op1), Z_STR_P(op2)); in fetch_obj_prop()
656 static inline int ct_eval_fetch_obj(zval *result, zval *op1, zval *op2) { in ct_eval_fetch_obj() argument
657 if (IS_PARTIAL_OBJECT(op1)) { in ct_eval_fetch_obj()
659 if (fetch_obj_prop(&value, op1, op2) == SUCCESS && value && !IS_BOT(value)) { in ct_eval_fetch_obj()
667 static inline int ct_eval_isset_obj(zval *result, uint32_t extended_value, zval *op1, zval *op2) { in ct_eval_isset_obj() argument
668 if (IS_PARTIAL_OBJECT(op1)) { in ct_eval_isset_obj()
670 if (fetch_obj_prop(&value, op1, op2) == FAILURE) { in ct_eval_isset_obj()
723 static inline int ct_eval_incdec(zval *result, zend_uchar opcode, zval *op1) { in ct_eval_incdec() argument
724 if (Z_TYPE_P(op1) == IS_ARRAY || IS_PARTIAL_ARRAY(op1)) { in ct_eval_incdec()
728 ZVAL_COPY(result, op1); in ct_eval_incdec()
740 static inline void ct_eval_type_check(zval *result, uint32_t type_mask, zval *op1) { in ct_eval_type_check() argument
741 uint32_t type = Z_TYPE_P(op1); in ct_eval_type_check()
750 static inline int ct_eval_in_array(zval *result, uint32_t extended_value, zval *op1, zval *op2) { in ct_eval_in_array() argument
758 if (EXPECTED(Z_TYPE_P(op1) == IS_STRING)) { in ct_eval_in_array()
759 res = zend_hash_exists(ht, Z_STR_P(op1)); in ct_eval_in_array()
761 if (EXPECTED(Z_TYPE_P(op1) == IS_LONG)) { in ct_eval_in_array()
762 res = zend_hash_index_exists(ht, Z_LVAL_P(op1)); in ct_eval_in_array()
766 } else if (Z_TYPE_P(op1) <= IS_FALSE) { in ct_eval_in_array()
775 if (zend_compare(op1, &key_tmp) == 0) { in ct_eval_in_array()
785 static inline int ct_eval_array_key_exists(zval *result, zval *op1, zval *op2) { in ct_eval_array_key_exists() argument
791 if (Z_TYPE_P(op1) != IS_STRING && Z_TYPE_P(op1) != IS_LONG && Z_TYPE_P(op1) != IS_NULL) { in ct_eval_array_key_exists()
794 if (fetch_array_elem(&value, op2, op1) == FAILURE) { in ct_eval_array_key_exists()
992 zval *op1, *op2, zv; /* zv is a temporary to hold result values */ in sccp_visit_instr() local
994 op1 = get_op1_value(ctx, opline, ssa_op); in sccp_visit_instr()
1002 if (IS_BOT(op1) && (ctx->scdf.ssa->var_info[ssa_op->op1_use].type & MAY_BE_REF)) { in sccp_visit_instr()
1003 SET_RESULT_BOT(op1); in sccp_visit_instr()
1006 SET_RESULT(op1, op2); in sccp_visit_instr()
1013 if (!value_known(op1)) { in sccp_visit_instr()
1034 op1 = &EG(uninitialized_zval); in sccp_visit_instr()
1037 if (IS_BOT(op1)) { in sccp_visit_instr()
1039 SET_RESULT_BOT(op1); in sccp_visit_instr()
1043 SKIP_IF_TOP(op1); in sccp_visit_instr()
1054 SET_RESULT(op1, &zv); in sccp_visit_instr()
1057 SET_RESULT_BOT(op1); in sccp_visit_instr()
1065 if ((IS_PARTIAL_ARRAY(op1) in sccp_visit_instr()
1066 || Z_TYPE_P(op1) == IS_NULL in sccp_visit_instr()
1067 || Z_TYPE_P(op1) == IS_FALSE in sccp_visit_instr()
1068 || Z_TYPE_P(op1) == IS_ARRAY) in sccp_visit_instr()
1071 if (Z_TYPE_P(op1) == IS_NULL || Z_TYPE_P(op1) == IS_FALSE) { in sccp_visit_instr()
1074 dup_partial_array(&zv, op1); in sccp_visit_instr()
1079 SET_RESULT(op1, &zv); in sccp_visit_instr()
1081 SET_RESULT(op1, &zv); in sccp_visit_instr()
1083 SET_RESULT_BOT(op1); in sccp_visit_instr()
1088 SET_RESULT_BOT(op1); in sccp_visit_instr()
1093 if (IS_PARTIAL_ARRAY(op1)) { in sccp_visit_instr()
1094 dup_partial_array(&zv, op1); in sccp_visit_instr()
1096 ZVAL_COPY(&zv, op1); in sccp_visit_instr()
1102 SET_RESULT(op1, &zv); in sccp_visit_instr()
1109 SET_RESULT(op1, &zv); in sccp_visit_instr()
1112 SET_RESULT_BOT(op1); in sccp_visit_instr()
1130 SET_RESULT_BOT(op1); in sccp_visit_instr()
1134 if (IS_BOT(op1)) { in sccp_visit_instr()
1136 SET_RESULT_BOT(op1); in sccp_visit_instr()
1140 SKIP_IF_TOP(op1); in sccp_visit_instr()
1148 SET_RESULT(op1, &zv); in sccp_visit_instr()
1155 if (IS_PARTIAL_OBJECT(op1) in sccp_visit_instr()
1156 || Z_TYPE_P(op1) == IS_NULL in sccp_visit_instr()
1157 || Z_TYPE_P(op1) == IS_FALSE) { in sccp_visit_instr()
1159 if (Z_TYPE_P(op1) == IS_NULL || Z_TYPE_P(op1) == IS_FALSE) { in sccp_visit_instr()
1162 dup_partial_object(&zv, op1); in sccp_visit_instr()
1166 SET_RESULT(op1, &zv); in sccp_visit_instr()
1168 SET_RESULT_BOT(op1); in sccp_visit_instr()
1172 SET_RESULT_BOT(op1); in sccp_visit_instr()
1177 if (IS_PARTIAL_OBJECT(op1)) { in sccp_visit_instr()
1178 dup_partial_object(&zv, op1); in sccp_visit_instr()
1180 ZVAL_COPY(&zv, op1); in sccp_visit_instr()
1185 SET_RESULT(op1, &zv); in sccp_visit_instr()
1188 SET_RESULT_BOT(op1); in sccp_visit_instr()
1195 SET_RESULT_BOT(op1); in sccp_visit_instr()
1210 if (IS_TOP(op1) || !call || !call->caller_call_opline in sccp_visit_instr()
1228 SET_RESULT_BOT(op1); in sccp_visit_instr()
1234 if (op1) { in sccp_visit_instr()
1235 SKIP_IF_TOP(op1); in sccp_visit_instr()
1252 SET_RESULT_BOT(op1); in sccp_visit_instr()
1263 if ((op1 && IS_BOT(op1)) in sccp_visit_instr()
1266 SET_RESULT_BOT(op1); in sccp_visit_instr()
1298 if (op1) { in sccp_visit_instr()
1302 } else if (ct_eval_add_array_elem(&zv, op1, op2) == SUCCESS) { in sccp_visit_instr()
1303 if (IS_PARTIAL_ARRAY(op1)) { in sccp_visit_instr()
1320 if (IS_BOT(result) || IS_BOT(op1)) { in sccp_visit_instr()
1325 SKIP_IF_TOP(op1); in sccp_visit_instr()
1335 if (ct_eval_add_array_unpack(&zv, op1) == SUCCESS) { in sccp_visit_instr()
1358 SET_RESULT_BOT(op1); in sccp_visit_instr()
1362 SET_RESULT_BOT(op1); in sccp_visit_instr()
1366 if ((op1 && IS_BOT(op1)) || (op2 && IS_BOT(op2))) { in sccp_visit_instr()
1370 SET_RESULT_BOT(op1); in sccp_visit_instr()
1398 SKIP_IF_TOP(op1); in sccp_visit_instr()
1401 if (ct_eval_binary_op(&zv, opline->opcode, op1, op2) == SUCCESS) { in sccp_visit_instr()
1412 if (op1) { in sccp_visit_instr()
1413 SKIP_IF_TOP(op1); in sccp_visit_instr()
1419 if (ct_eval_binary_op(&zv, opline->extended_value, op1, op2) == SUCCESS) { in sccp_visit_instr()
1420 SET_RESULT(op1, &zv); in sccp_visit_instr()
1426 if ((IS_PARTIAL_ARRAY(op1) || Z_TYPE_P(op1) == IS_ARRAY) in sccp_visit_instr()
1433 if (ct_eval_fetch_dim(&tmp, op1, op2, 0) == SUCCESS) { in sccp_visit_instr()
1435 dup_partial_array(&zv, op1); in sccp_visit_instr()
1438 SET_RESULT(op1, &zv); in sccp_visit_instr()
1446 SET_RESULT_BOT(op1); in sccp_visit_instr()
1451 if (IS_PARTIAL_ARRAY(op1)) { in sccp_visit_instr()
1452 dup_partial_array(&zv, op1); in sccp_visit_instr()
1454 ZVAL_COPY(&zv, op1); in sccp_visit_instr()
1459 SET_RESULT(op1, &zv); in sccp_visit_instr()
1470 if (op1 && IS_PARTIAL_OBJECT(op1) in sccp_visit_instr()
1478 if (ct_eval_fetch_obj(&tmp, op1, op2) == SUCCESS) { in sccp_visit_instr()
1480 dup_partial_object(&zv, op1); in sccp_visit_instr()
1483 SET_RESULT(op1, &zv); in sccp_visit_instr()
1491 SET_RESULT_BOT(op1); in sccp_visit_instr()
1496 dup_partial_object(&zv, op1); in sccp_visit_instr()
1500 SET_RESULT(op1, &zv); in sccp_visit_instr()
1512 SET_RESULT_BOT(op1); in sccp_visit_instr()
1518 if (op1) { in sccp_visit_instr()
1519 SKIP_IF_TOP(op1); in sccp_visit_instr()
1521 if (IS_PARTIAL_OBJECT(op1) in sccp_visit_instr()
1526 if (ct_eval_fetch_obj(&tmp1, op1, op2) == SUCCESS in sccp_visit_instr()
1529 dup_partial_object(&zv, op1); in sccp_visit_instr()
1538 SET_RESULT(op1, &zv); in sccp_visit_instr()
1544 SET_RESULT_BOT(op1); in sccp_visit_instr()
1549 SKIP_IF_TOP(op1); in sccp_visit_instr()
1550 if (ct_eval_incdec(&zv, opline->opcode, op1) == SUCCESS) { in sccp_visit_instr()
1551 SET_RESULT(op1, &zv); in sccp_visit_instr()
1556 SET_RESULT_BOT(op1); in sccp_visit_instr()
1561 SKIP_IF_TOP(op1); in sccp_visit_instr()
1562 SET_RESULT(result, op1); in sccp_visit_instr()
1563 if (ct_eval_incdec(&zv, opline->opcode, op1) == SUCCESS) { in sccp_visit_instr()
1564 SET_RESULT(op1, &zv); in sccp_visit_instr()
1568 SET_RESULT_BOT(op1); in sccp_visit_instr()
1572 SKIP_IF_TOP(op1); in sccp_visit_instr()
1573 if (IS_PARTIAL_ARRAY(op1)) { in sccp_visit_instr()
1577 if (zend_optimizer_eval_unary_op(&zv, opline->opcode, op1) == SUCCESS) { in sccp_visit_instr()
1585 SKIP_IF_TOP(op1); in sccp_visit_instr()
1586 if (IS_PARTIAL_ARRAY(op1)) { in sccp_visit_instr()
1590 if (zend_optimizer_eval_cast(&zv, opline->extended_value, op1) == SUCCESS) { in sccp_visit_instr()
1600 SKIP_IF_TOP(op1); in sccp_visit_instr()
1601 if (ct_eval_bool_cast(&zv, op1) == SUCCESS) { in sccp_visit_instr()
1609 SKIP_IF_TOP(op1); in sccp_visit_instr()
1610 if (zend_optimizer_eval_strlen(&zv, op1) == SUCCESS) { in sccp_visit_instr()
1619 SKIP_IF_TOP(op1); in sccp_visit_instr()
1620 if (Z_TYPE_P(op1) == IS_ARRAY && zend_hash_num_elements(Z_ARR_P(op1)) == 0) { in sccp_visit_instr()
1628 SKIP_IF_TOP(op1); in sccp_visit_instr()
1629 if (Z_TYPE_P(op1) == IS_ARRAY) { in sccp_visit_instr()
1630 ZVAL_LONG(&zv, zend_hash_num_elements(Z_ARRVAL_P(op1))); in sccp_visit_instr()
1638 SKIP_IF_TOP(op1); in sccp_visit_instr()
1640 if (ct_eval_in_array(&zv, opline->extended_value, op1, op2) == SUCCESS) { in sccp_visit_instr()
1648 SKIP_IF_TOP(op1); in sccp_visit_instr()
1650 if (ct_eval_array_key_exists(&zv, op1, op2) == SUCCESS) { in sccp_visit_instr()
1660 SKIP_IF_TOP(op1); in sccp_visit_instr()
1663 if (ct_eval_fetch_dim(&zv, op1, op2, (opline->opcode != ZEND_FETCH_LIST_R)) == SUCCESS) { in sccp_visit_instr()
1671 SKIP_IF_TOP(op1); in sccp_visit_instr()
1674 if (ct_eval_isset_dim(&zv, opline->extended_value, op1, op2) == SUCCESS) { in sccp_visit_instr()
1683 if (op1) { in sccp_visit_instr()
1684 SKIP_IF_TOP(op1); in sccp_visit_instr()
1687 if (ct_eval_fetch_obj(&zv, op1, op2) == SUCCESS) { in sccp_visit_instr()
1696 if (op1) { in sccp_visit_instr()
1697 SKIP_IF_TOP(op1); in sccp_visit_instr()
1700 if (ct_eval_isset_obj(&zv, opline->extended_value, op1, op2) == SUCCESS) { in sccp_visit_instr()
1712 SET_RESULT(result, op1); in sccp_visit_instr()
1731 if (!op1) { in sccp_visit_instr()
1735 SET_RESULT(result, op1); in sccp_visit_instr()
1739 SKIP_IF_TOP(op1); in sccp_visit_instr()
1740 if (ct_eval_isset_isempty(&zv, opline->extended_value, op1) == SUCCESS) { in sccp_visit_instr()
1748 SKIP_IF_TOP(op1); in sccp_visit_instr()
1749 ct_eval_type_check(&zv, opline->extended_value, op1); in sccp_visit_instr()
1754 SKIP_IF_TOP(op1); in sccp_visit_instr()
1776 SKIP_IF_TOP(op1); in sccp_visit_instr()
1778 if (ct_eval_binary_op(&zv, ZEND_CONCAT, op1, op2) == SUCCESS) { in sccp_visit_instr()
1858 SET_RESULT_BOT(op1); in sccp_visit_instr()
1871 zval *op1, zv; in sccp_mark_feasible_successors() local
1885 op1 = get_op1_value(ctx, opline, ssa_op); in sccp_mark_feasible_successors()
1888 if (!op1 || IS_BOT(op1)) { in sccp_mark_feasible_successors()
1896 if (IS_TOP(op1)) { in sccp_mark_feasible_successors()
1905 if (ct_eval_bool_cast(&zv, op1) == FAILURE) { in sccp_mark_feasible_successors()
1917 if (ct_eval_bool_cast(&zv, op1) == FAILURE) { in sccp_mark_feasible_successors()
1926 s = (Z_TYPE_P(op1) == IS_NULL); in sccp_mark_feasible_successors()
1929 s = (Z_TYPE_P(op1) != IS_NULL); in sccp_mark_feasible_successors()
1935 if (Z_TYPE_P(op1) != IS_ARRAY || in sccp_mark_feasible_successors()
1936 (IS_PARTIAL_ARRAY(op1) && zend_hash_num_elements(Z_ARR_P(op1)) == 0)) { in sccp_mark_feasible_successors()
1941 s = zend_hash_num_elements(Z_ARR_P(op1)) != 0; in sccp_mark_feasible_successors()
1948 zend_uchar type = Z_TYPE_P(op1); in sccp_mark_feasible_successors()
1959 ? zend_hash_index_find(jmptable, Z_LVAL_P(op1)) in sccp_mark_feasible_successors()
1960 : zend_hash_find(jmptable, Z_STR_P(op1)); in sccp_mark_feasible_successors()