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()
431 *result = zend_hash_index_find(Z_ARR_P(op1), zend_dval_to_lval(Z_DVAL_P(op2))); in fetch_array_elem()
434 *result = zend_symtable_find(Z_ARR_P(op1), Z_STR_P(op2)); in fetch_array_elem()
441 static inline int ct_eval_fetch_dim(zval *result, zval *op1, zval *op2, int support_strings) { in ct_eval_fetch_dim() argument
442 if (Z_TYPE_P(op1) == IS_ARRAY || IS_PARTIAL_ARRAY(op1)) { in ct_eval_fetch_dim()
444 if (fetch_array_elem(&value, op1, op2) == SUCCESS && value && !IS_BOT(value)) { in ct_eval_fetch_dim()
448 } else if (support_strings && Z_TYPE_P(op1) == IS_STRING) { in ct_eval_fetch_dim()
453 if (index >= 0 && index < Z_STRLEN_P(op1)) { in ct_eval_fetch_dim()
454 ZVAL_STR(result, zend_string_init(&Z_STRVAL_P(op1)[index], 1, 0)); in ct_eval_fetch_dim()
462 static inline int ct_eval_isset_isempty(zval *result, uint32_t extended_value, zval *op1) { in ct_eval_isset_isempty() argument
465 ZVAL_BOOL(result, op1 && Z_TYPE_P(op1) != IS_NULL); in ct_eval_isset_isempty()
467 } else if (!op1) { in ct_eval_isset_isempty()
470 } else if (ct_eval_bool_cast(&zv, op1) == SUCCESS) { in ct_eval_isset_isempty()
478 static inline int ct_eval_isset_dim(zval *result, uint32_t extended_value, zval *op1, zval *op2) { in ct_eval_isset_dim() argument
479 if (Z_TYPE_P(op1) == IS_ARRAY || IS_PARTIAL_ARRAY(op1)) { in ct_eval_isset_dim()
481 if (fetch_array_elem(&value, op1, op2) == FAILURE) { in ct_eval_isset_dim()
484 if (IS_PARTIAL_ARRAY(op1) && (!value || IS_BOT(value))) { in ct_eval_isset_dim()
488 } else if (Z_TYPE_P(op1) == IS_STRING) { in ct_eval_isset_dim()
630 static inline int fetch_obj_prop(zval **result, zval *op1, zval *op2) { in fetch_obj_prop() argument
633 *result = zend_symtable_find(Z_ARR_P(op1), Z_STR_P(op2)); in fetch_obj_prop()
640 static inline int ct_eval_fetch_obj(zval *result, zval *op1, zval *op2) { in ct_eval_fetch_obj() argument
641 if (IS_PARTIAL_OBJECT(op1)) { in ct_eval_fetch_obj()
643 if (fetch_obj_prop(&value, op1, op2) == SUCCESS && value && !IS_BOT(value)) { in ct_eval_fetch_obj()
651 static inline int ct_eval_isset_obj(zval *result, uint32_t extended_value, zval *op1, zval *op2) { in ct_eval_isset_obj() argument
652 if (IS_PARTIAL_OBJECT(op1)) { in ct_eval_isset_obj()
654 if (fetch_obj_prop(&value, op1, op2) == FAILURE) { in ct_eval_isset_obj()
707 static inline int ct_eval_incdec(zval *result, zend_uchar opcode, zval *op1) { in ct_eval_incdec() argument
708 if (Z_TYPE_P(op1) == IS_ARRAY || IS_PARTIAL_ARRAY(op1)) { in ct_eval_incdec()
712 ZVAL_COPY(result, op1); in ct_eval_incdec()
724 static inline void ct_eval_type_check(zval *result, uint32_t type_mask, zval *op1) { in ct_eval_type_check() argument
725 uint32_t type = Z_TYPE_P(op1); in ct_eval_type_check()
734 static inline int ct_eval_in_array(zval *result, uint32_t extended_value, zval *op1, zval *op2) { in ct_eval_in_array() argument
742 if (EXPECTED(Z_TYPE_P(op1) == IS_STRING)) { in ct_eval_in_array()
743 res = zend_hash_exists(ht, Z_STR_P(op1)); in ct_eval_in_array()
745 if (EXPECTED(Z_TYPE_P(op1) == IS_LONG)) { in ct_eval_in_array()
746 res = zend_hash_index_exists(ht, Z_LVAL_P(op1)); in ct_eval_in_array()
750 } else if (Z_TYPE_P(op1) <= IS_FALSE) { in ct_eval_in_array()
759 if (zend_compare(op1, &key_tmp) == 0) { in ct_eval_in_array()
769 static inline int ct_eval_array_key_exists(zval *result, zval *op1, zval *op2) { in ct_eval_array_key_exists() argument
775 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()
778 if (fetch_array_elem(&value, op2, op1) == FAILURE) { in ct_eval_array_key_exists()
1012 zval *op1, *op2, zv; /* zv is a temporary to hold result values */ in sccp_visit_instr() local
1014 op1 = get_op1_value(ctx, opline, ssa_op); in sccp_visit_instr()
1022 if (IS_BOT(op1) && (ctx->scdf.ssa->var_info[ssa_op->op1_use].type & MAY_BE_REF)) { in sccp_visit_instr()
1023 SET_RESULT_BOT(op1); in sccp_visit_instr()
1026 SET_RESULT(op1, op2); in sccp_visit_instr()
1033 if (!value_known(op1)) { in sccp_visit_instr()
1054 op1 = &EG(uninitialized_zval); in sccp_visit_instr()
1057 if (IS_BOT(op1)) { in sccp_visit_instr()
1059 SET_RESULT_BOT(op1); in sccp_visit_instr()
1063 SKIP_IF_TOP(op1); in sccp_visit_instr()
1074 SET_RESULT(op1, &zv); in sccp_visit_instr()
1077 SET_RESULT_BOT(op1); in sccp_visit_instr()
1085 if ((IS_PARTIAL_ARRAY(op1) in sccp_visit_instr()
1086 || Z_TYPE_P(op1) == IS_NULL in sccp_visit_instr()
1087 || Z_TYPE_P(op1) == IS_FALSE in sccp_visit_instr()
1088 || Z_TYPE_P(op1) == IS_ARRAY) in sccp_visit_instr()
1091 if (Z_TYPE_P(op1) == IS_NULL || Z_TYPE_P(op1) == IS_FALSE) { in sccp_visit_instr()
1094 dup_partial_array(&zv, op1); in sccp_visit_instr()
1099 SET_RESULT(op1, &zv); in sccp_visit_instr()
1101 SET_RESULT(op1, &zv); in sccp_visit_instr()
1103 SET_RESULT_BOT(op1); in sccp_visit_instr()
1108 SET_RESULT_BOT(op1); in sccp_visit_instr()
1113 if (IS_PARTIAL_ARRAY(op1)) { in sccp_visit_instr()
1114 dup_partial_array(&zv, op1); in sccp_visit_instr()
1116 ZVAL_COPY(&zv, op1); in sccp_visit_instr()
1122 SET_RESULT(op1, &zv); in sccp_visit_instr()
1129 SET_RESULT(op1, &zv); in sccp_visit_instr()
1132 SET_RESULT_BOT(op1); in sccp_visit_instr()
1150 SET_RESULT_BOT(op1); in sccp_visit_instr()
1154 if (IS_BOT(op1)) { in sccp_visit_instr()
1156 SET_RESULT_BOT(op1); in sccp_visit_instr()
1160 SKIP_IF_TOP(op1); in sccp_visit_instr()
1168 SET_RESULT(op1, &zv); in sccp_visit_instr()
1175 if (IS_PARTIAL_OBJECT(op1) in sccp_visit_instr()
1176 || Z_TYPE_P(op1) == IS_NULL in sccp_visit_instr()
1177 || Z_TYPE_P(op1) == IS_FALSE) { in sccp_visit_instr()
1179 if (Z_TYPE_P(op1) == IS_NULL || Z_TYPE_P(op1) == IS_FALSE) { in sccp_visit_instr()
1182 dup_partial_object(&zv, op1); in sccp_visit_instr()
1186 SET_RESULT(op1, &zv); in sccp_visit_instr()
1188 SET_RESULT_BOT(op1); in sccp_visit_instr()
1192 SET_RESULT_BOT(op1); in sccp_visit_instr()
1197 if (IS_PARTIAL_OBJECT(op1)) { in sccp_visit_instr()
1198 dup_partial_object(&zv, op1); in sccp_visit_instr()
1200 ZVAL_COPY(&zv, op1); in sccp_visit_instr()
1205 SET_RESULT(op1, &zv); in sccp_visit_instr()
1208 SET_RESULT_BOT(op1); in sccp_visit_instr()
1215 SET_RESULT_BOT(op1); in sccp_visit_instr()
1230 if (IS_TOP(op1) || !call || !call->caller_call_opline in sccp_visit_instr()
1248 SET_RESULT_BOT(op1); in sccp_visit_instr()
1254 if (op1) { in sccp_visit_instr()
1255 SKIP_IF_TOP(op1); in sccp_visit_instr()
1272 SET_RESULT_BOT(op1); in sccp_visit_instr()
1283 if ((op1 && IS_BOT(op1)) in sccp_visit_instr()
1286 SET_RESULT_BOT(op1); in sccp_visit_instr()
1318 if (op1) { in sccp_visit_instr()
1322 } else if (ct_eval_add_array_elem(&zv, op1, op2) == SUCCESS) { in sccp_visit_instr()
1323 if (IS_PARTIAL_ARRAY(op1)) { in sccp_visit_instr()
1340 if (IS_BOT(result) || IS_BOT(op1)) { in sccp_visit_instr()
1345 SKIP_IF_TOP(op1); in sccp_visit_instr()
1355 if (ct_eval_add_array_unpack(&zv, op1) == SUCCESS) { in sccp_visit_instr()
1378 SET_RESULT_BOT(op1); in sccp_visit_instr()
1382 SET_RESULT_BOT(op1); in sccp_visit_instr()
1386 if ((op1 && IS_BOT(op1)) || (op2 && IS_BOT(op2))) { in sccp_visit_instr()
1390 SET_RESULT_BOT(op1); in sccp_visit_instr()
1418 SKIP_IF_TOP(op1); in sccp_visit_instr()
1421 if (ct_eval_binary_op(&zv, opline->opcode, op1, op2) == SUCCESS) { in sccp_visit_instr()
1432 if (op1) { in sccp_visit_instr()
1433 SKIP_IF_TOP(op1); in sccp_visit_instr()
1439 if (ct_eval_binary_op(&zv, opline->extended_value, op1, op2) == SUCCESS) { in sccp_visit_instr()
1440 SET_RESULT(op1, &zv); in sccp_visit_instr()
1446 if ((IS_PARTIAL_ARRAY(op1) || Z_TYPE_P(op1) == IS_ARRAY) in sccp_visit_instr()
1453 if (ct_eval_fetch_dim(&tmp, op1, op2, 0) == SUCCESS) { in sccp_visit_instr()
1455 dup_partial_array(&zv, op1); in sccp_visit_instr()
1458 SET_RESULT(op1, &zv); in sccp_visit_instr()
1466 SET_RESULT_BOT(op1); in sccp_visit_instr()
1471 if (IS_PARTIAL_ARRAY(op1)) { in sccp_visit_instr()
1472 dup_partial_array(&zv, op1); in sccp_visit_instr()
1474 ZVAL_COPY(&zv, op1); in sccp_visit_instr()
1479 SET_RESULT(op1, &zv); in sccp_visit_instr()
1490 if (op1 && IS_PARTIAL_OBJECT(op1) in sccp_visit_instr()
1498 if (ct_eval_fetch_obj(&tmp, op1, op2) == SUCCESS) { in sccp_visit_instr()
1500 dup_partial_object(&zv, op1); in sccp_visit_instr()
1503 SET_RESULT(op1, &zv); in sccp_visit_instr()
1511 SET_RESULT_BOT(op1); in sccp_visit_instr()
1516 dup_partial_object(&zv, op1); in sccp_visit_instr()
1520 SET_RESULT(op1, &zv); in sccp_visit_instr()
1532 SET_RESULT_BOT(op1); in sccp_visit_instr()
1538 if (op1) { in sccp_visit_instr()
1539 SKIP_IF_TOP(op1); in sccp_visit_instr()
1541 if (IS_PARTIAL_OBJECT(op1) in sccp_visit_instr()
1546 if (ct_eval_fetch_obj(&tmp1, op1, op2) == SUCCESS in sccp_visit_instr()
1549 dup_partial_object(&zv, op1); in sccp_visit_instr()
1558 SET_RESULT(op1, &zv); in sccp_visit_instr()
1564 SET_RESULT_BOT(op1); in sccp_visit_instr()
1569 SKIP_IF_TOP(op1); in sccp_visit_instr()
1570 if (ct_eval_incdec(&zv, opline->opcode, op1) == SUCCESS) { in sccp_visit_instr()
1571 SET_RESULT(op1, &zv); in sccp_visit_instr()
1576 SET_RESULT_BOT(op1); in sccp_visit_instr()
1581 SKIP_IF_TOP(op1); in sccp_visit_instr()
1582 SET_RESULT(result, op1); in sccp_visit_instr()
1583 if (ct_eval_incdec(&zv, opline->opcode, op1) == SUCCESS) { in sccp_visit_instr()
1584 SET_RESULT(op1, &zv); in sccp_visit_instr()
1588 SET_RESULT_BOT(op1); in sccp_visit_instr()
1592 SKIP_IF_TOP(op1); in sccp_visit_instr()
1593 if (IS_PARTIAL_ARRAY(op1)) { in sccp_visit_instr()
1597 if (zend_optimizer_eval_unary_op(&zv, opline->opcode, op1) == SUCCESS) { in sccp_visit_instr()
1605 SKIP_IF_TOP(op1); in sccp_visit_instr()
1606 if (IS_PARTIAL_ARRAY(op1)) { in sccp_visit_instr()
1610 if (zend_optimizer_eval_cast(&zv, opline->extended_value, op1) == SUCCESS) { in sccp_visit_instr()
1620 SKIP_IF_TOP(op1); in sccp_visit_instr()
1621 if (ct_eval_bool_cast(&zv, op1) == SUCCESS) { in sccp_visit_instr()
1629 SKIP_IF_TOP(op1); in sccp_visit_instr()
1630 if (zend_optimizer_eval_strlen(&zv, op1) == SUCCESS) { in sccp_visit_instr()
1639 SKIP_IF_TOP(op1); in sccp_visit_instr()
1640 if (Z_TYPE_P(op1) == IS_ARRAY && zend_hash_num_elements(Z_ARR_P(op1)) == 0) { in sccp_visit_instr()
1648 SKIP_IF_TOP(op1); in sccp_visit_instr()
1649 if (Z_TYPE_P(op1) == IS_ARRAY) { in sccp_visit_instr()
1650 ZVAL_LONG(&zv, zend_hash_num_elements(Z_ARRVAL_P(op1))); in sccp_visit_instr()
1658 SKIP_IF_TOP(op1); in sccp_visit_instr()
1660 if (ct_eval_in_array(&zv, opline->extended_value, op1, op2) == SUCCESS) { in sccp_visit_instr()
1668 SKIP_IF_TOP(op1); in sccp_visit_instr()
1670 if (ct_eval_array_key_exists(&zv, op1, op2) == SUCCESS) { in sccp_visit_instr()
1680 SKIP_IF_TOP(op1); in sccp_visit_instr()
1683 if (ct_eval_fetch_dim(&zv, op1, op2, (opline->opcode != ZEND_FETCH_LIST_R)) == SUCCESS) { in sccp_visit_instr()
1691 SKIP_IF_TOP(op1); in sccp_visit_instr()
1694 if (ct_eval_isset_dim(&zv, opline->extended_value, op1, op2) == SUCCESS) { in sccp_visit_instr()
1703 if (op1) { in sccp_visit_instr()
1704 SKIP_IF_TOP(op1); in sccp_visit_instr()
1707 if (ct_eval_fetch_obj(&zv, op1, op2) == SUCCESS) { in sccp_visit_instr()
1716 if (op1) { in sccp_visit_instr()
1717 SKIP_IF_TOP(op1); in sccp_visit_instr()
1720 if (ct_eval_isset_obj(&zv, opline->extended_value, op1, op2) == SUCCESS) { in sccp_visit_instr()
1732 SET_RESULT(result, op1); in sccp_visit_instr()
1751 if (!op1) { in sccp_visit_instr()
1755 SET_RESULT(result, op1); in sccp_visit_instr()
1759 SKIP_IF_TOP(op1); in sccp_visit_instr()
1760 if (ct_eval_isset_isempty(&zv, opline->extended_value, op1) == SUCCESS) { in sccp_visit_instr()
1768 SKIP_IF_TOP(op1); in sccp_visit_instr()
1769 ct_eval_type_check(&zv, opline->extended_value, op1); in sccp_visit_instr()
1774 SKIP_IF_TOP(op1); in sccp_visit_instr()
1796 SKIP_IF_TOP(op1); in sccp_visit_instr()
1798 if (ct_eval_binary_op(&zv, ZEND_CONCAT, op1, op2) == SUCCESS) { in sccp_visit_instr()
1877 SET_RESULT_BOT(op1); in sccp_visit_instr()
1890 zval *op1, zv; in sccp_mark_feasible_successors() local
1904 op1 = get_op1_value(ctx, opline, ssa_op); in sccp_mark_feasible_successors()
1907 if (!op1 || IS_BOT(op1)) { in sccp_mark_feasible_successors()
1915 if (IS_TOP(op1)) { in sccp_mark_feasible_successors()
1924 if (ct_eval_bool_cast(&zv, op1) == FAILURE) { in sccp_mark_feasible_successors()
1936 if (ct_eval_bool_cast(&zv, op1) == FAILURE) { in sccp_mark_feasible_successors()
1945 s = (Z_TYPE_P(op1) == IS_NULL); in sccp_mark_feasible_successors()
1948 s = (Z_TYPE_P(op1) != IS_NULL); in sccp_mark_feasible_successors()
1954 if (Z_TYPE_P(op1) != IS_ARRAY || in sccp_mark_feasible_successors()
1955 (IS_PARTIAL_ARRAY(op1) && zend_hash_num_elements(Z_ARR_P(op1)) == 0)) { in sccp_mark_feasible_successors()
1960 s = zend_hash_num_elements(Z_ARR_P(op1)) != 0; in sccp_mark_feasible_successors()
1967 zend_uchar type = Z_TYPE_P(op1); in sccp_mark_feasible_successors()
1978 ? zend_hash_index_find(jmptable, Z_LVAL_P(op1)) in sccp_mark_feasible_successors()
1979 : zend_hash_find(jmptable, Z_STR_P(op1)); in sccp_mark_feasible_successors()