Lines Matching refs:op1

191 		return CT_CONSTANT_EX(ctx->scdf.op_array, opline->op1.constant);  in get_op1_value()
320 opline->op1.constant = zend_optimizer_add_literal(ctx->scdf.op_array, &zv); in try_replace_op1()
328 opline->op1.constant = zend_optimizer_add_literal(ctx->scdf.op_array, &zv); in try_replace_op1()
379 static inline int ct_eval_binary_op(zval *result, zend_uchar binop, zval *op1, zval *op2) { in ct_eval_binary_op() argument
381 if (IS_PARTIAL_ARRAY(op1) || IS_PARTIAL_ARRAY(op2)) { in ct_eval_binary_op()
385 return zend_optimizer_eval_binary_op(result, binop, op1, op2); in ct_eval_binary_op()
420 static inline int fetch_array_elem(zval **result, zval *op1, zval *op2) { in fetch_array_elem() argument
423 *result = zend_hash_find(Z_ARR_P(op1), ZSTR_EMPTY_ALLOC()); in fetch_array_elem()
426 *result = zend_hash_index_find(Z_ARR_P(op1), 0); in fetch_array_elem()
429 *result = zend_hash_index_find(Z_ARR_P(op1), 1); in fetch_array_elem()
432 *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), zend_dval_to_lval(Z_DVAL_P(op2))); in fetch_array_elem()
438 *result = zend_symtable_find(Z_ARR_P(op1), Z_STR_P(op2)); in fetch_array_elem()
445 static inline int ct_eval_fetch_dim(zval *result, zval *op1, zval *op2, int support_strings) { in ct_eval_fetch_dim() argument
446 if (Z_TYPE_P(op1) == IS_ARRAY || IS_PARTIAL_ARRAY(op1)) { in ct_eval_fetch_dim()
448 if (fetch_array_elem(&value, op1, op2) == SUCCESS && value && !IS_BOT(value)) { in ct_eval_fetch_dim()
452 } else if (support_strings && Z_TYPE_P(op1) == IS_STRING) { in ct_eval_fetch_dim()
457 if (index >= 0 && index < Z_STRLEN_P(op1)) { in ct_eval_fetch_dim()
458 ZVAL_STR(result, zend_string_init(&Z_STRVAL_P(op1)[index], 1, 0)); in ct_eval_fetch_dim()
466 static inline int ct_eval_isset_isempty(zval *result, uint32_t extended_value, zval *op1) { in ct_eval_isset_isempty() argument
469 ZVAL_BOOL(result, op1 && Z_TYPE_P(op1) != IS_NULL); in ct_eval_isset_isempty()
471 } else if (!op1) { in ct_eval_isset_isempty()
474 } else if (ct_eval_bool_cast(&zv, op1) == SUCCESS) { in ct_eval_isset_isempty()
482 static inline int ct_eval_isset_dim(zval *result, uint32_t extended_value, zval *op1, zval *op2) { in ct_eval_isset_dim() argument
483 if (Z_TYPE_P(op1) == IS_ARRAY || IS_PARTIAL_ARRAY(op1)) { in ct_eval_isset_dim()
485 if (fetch_array_elem(&value, op1, op2) == FAILURE) { in ct_eval_isset_dim()
488 if (IS_PARTIAL_ARRAY(op1) && (!value || IS_BOT(value))) { in ct_eval_isset_dim()
492 } else if (Z_TYPE_P(op1) == IS_STRING) { in ct_eval_isset_dim()
613 static inline int fetch_obj_prop(zval **result, zval *op1, zval *op2) { in fetch_obj_prop() argument
616 *result = zend_symtable_find(Z_ARR_P(op1), Z_STR_P(op2)); in fetch_obj_prop()
623 static inline int ct_eval_fetch_obj(zval *result, zval *op1, zval *op2) { in ct_eval_fetch_obj() argument
624 if (IS_PARTIAL_OBJECT(op1)) { in ct_eval_fetch_obj()
626 if (fetch_obj_prop(&value, op1, op2) == SUCCESS && value && !IS_BOT(value)) { in ct_eval_fetch_obj()
634 static inline int ct_eval_isset_obj(zval *result, uint32_t extended_value, zval *op1, zval *op2) { in ct_eval_isset_obj() argument
635 if (IS_PARTIAL_OBJECT(op1)) { in ct_eval_isset_obj()
637 if (fetch_obj_prop(&value, op1, op2) == FAILURE) { in ct_eval_isset_obj()
690 static inline int ct_eval_incdec(zval *result, zend_uchar opcode, zval *op1) { in ct_eval_incdec() argument
691 ZVAL_COPY(result, op1); in ct_eval_incdec()
703 static inline void ct_eval_type_check(zval *result, uint32_t type_mask, zval *op1) { in ct_eval_type_check() argument
704 uint32_t type = Z_TYPE_P(op1); in ct_eval_type_check()
713 static inline int ct_eval_in_array(zval *result, uint32_t extended_value, zval *op1, zval *op2) { in ct_eval_in_array() argument
721 if (EXPECTED(Z_TYPE_P(op1) == IS_STRING)) { in ct_eval_in_array()
722 res = zend_hash_exists(ht, Z_STR_P(op1)); in ct_eval_in_array()
724 if (EXPECTED(Z_TYPE_P(op1) == IS_LONG)) { in ct_eval_in_array()
725 res = zend_hash_index_exists(ht, Z_LVAL_P(op1)); in ct_eval_in_array()
729 } else if (Z_TYPE_P(op1) <= IS_FALSE) { in ct_eval_in_array()
738 compare_function(&result_tmp, op1, &key_tmp); in ct_eval_in_array()
1039 zval *op1, *op2, zv; /* zv is a temporary to hold result values */ in sccp_visit_instr() local
1041 op1 = get_op1_value(ctx, opline, ssa_op); in sccp_visit_instr()
1048 if (IS_BOT(op1) && (ctx->scdf.ssa->var_info[ssa_op->op1_use].type & MAY_BE_REF)) { in sccp_visit_instr()
1049 SET_RESULT_BOT(op1); in sccp_visit_instr()
1051 SET_RESULT(op1, op2); in sccp_visit_instr()
1059 if (!value_known(op1)) { in sccp_visit_instr()
1080 op1 = &EG(uninitialized_zval); in sccp_visit_instr()
1083 if (IS_BOT(op1)) { in sccp_visit_instr()
1085 SET_RESULT_BOT(op1); in sccp_visit_instr()
1089 SKIP_IF_TOP(op1); in sccp_visit_instr()
1101 SET_RESULT(op1, &zv); in sccp_visit_instr()
1104 SET_RESULT_BOT(op1); in sccp_visit_instr()
1112 if ((IS_PARTIAL_ARRAY(op1) in sccp_visit_instr()
1113 || Z_TYPE_P(op1) == IS_NULL in sccp_visit_instr()
1114 || Z_TYPE_P(op1) == IS_FALSE in sccp_visit_instr()
1115 || Z_TYPE_P(op1) == IS_ARRAY) in sccp_visit_instr()
1119 if (Z_TYPE_P(op1) == IS_NULL || Z_TYPE_P(op1) == IS_FALSE) { in sccp_visit_instr()
1122 dup_partial_array(&zv, op1); in sccp_visit_instr()
1127 SET_RESULT(op1, &zv); in sccp_visit_instr()
1129 SET_RESULT(op1, &zv); in sccp_visit_instr()
1131 SET_RESULT_BOT(op1); in sccp_visit_instr()
1136 SET_RESULT_BOT(op1); in sccp_visit_instr()
1141 if (IS_PARTIAL_ARRAY(op1)) { in sccp_visit_instr()
1142 dup_partial_array(&zv, op1); in sccp_visit_instr()
1144 ZVAL_COPY(&zv, op1); in sccp_visit_instr()
1150 SET_RESULT(op1, &zv); in sccp_visit_instr()
1157 SET_RESULT(op1, &zv); in sccp_visit_instr()
1160 SET_RESULT_BOT(op1); in sccp_visit_instr()
1175 op1 = &EG(uninitialized_zval); in sccp_visit_instr()
1178 if (IS_BOT(op1)) { in sccp_visit_instr()
1180 SET_RESULT_BOT(op1); in sccp_visit_instr()
1184 SKIP_IF_TOP(op1); in sccp_visit_instr()
1192 SET_RESULT(op1, &zv); in sccp_visit_instr()
1199 if (IS_PARTIAL_OBJECT(op1) in sccp_visit_instr()
1200 || Z_TYPE_P(op1) == IS_NULL in sccp_visit_instr()
1201 || Z_TYPE_P(op1) == IS_FALSE) { in sccp_visit_instr()
1203 if (Z_TYPE_P(op1) == IS_NULL || Z_TYPE_P(op1) == IS_FALSE) { in sccp_visit_instr()
1206 dup_partial_object(&zv, op1); in sccp_visit_instr()
1210 SET_RESULT(op1, &zv); in sccp_visit_instr()
1212 SET_RESULT_BOT(op1); in sccp_visit_instr()
1216 SET_RESULT_BOT(op1); in sccp_visit_instr()
1221 if (IS_PARTIAL_OBJECT(op1)) { in sccp_visit_instr()
1222 dup_partial_object(&zv, op1); in sccp_visit_instr()
1224 ZVAL_COPY(&zv, op1); in sccp_visit_instr()
1229 SET_RESULT(op1, &zv); in sccp_visit_instr()
1232 SET_RESULT_BOT(op1); in sccp_visit_instr()
1239 SET_RESULT_BOT(op1); in sccp_visit_instr()
1254 if (IS_TOP(op1) || !call || !call->caller_call_opline in sccp_visit_instr()
1272 SET_RESULT_BOT(op1); in sccp_visit_instr()
1278 if (op1) { in sccp_visit_instr()
1279 SKIP_IF_TOP(op1); in sccp_visit_instr()
1296 SET_RESULT_BOT(op1); in sccp_visit_instr()
1308 if ((op1 && IS_BOT(op1)) in sccp_visit_instr()
1311 SET_RESULT_BOT(op1); in sccp_visit_instr()
1344 if (op1) { in sccp_visit_instr()
1348 } else if (ct_eval_add_array_elem(&zv, op1, op2) == SUCCESS) { in sccp_visit_instr()
1349 if (IS_PARTIAL_ARRAY(op1)) { in sccp_visit_instr()
1376 if ((op1 && IS_BOT(op1)) || (op2 && IS_BOT(op2))) { in sccp_visit_instr()
1380 SET_RESULT_BOT(op1); in sccp_visit_instr()
1407 SKIP_IF_TOP(op1); in sccp_visit_instr()
1410 if (ct_eval_binary_op(&zv, opline->opcode, op1, op2) == SUCCESS) { in sccp_visit_instr()
1429 if (op1) { in sccp_visit_instr()
1430 SKIP_IF_TOP(op1); in sccp_visit_instr()
1436 …if (ct_eval_binary_op(&zv, zend_compound_assign_to_binary_op(opline->opcode), op1, op2) == SUCCESS… in sccp_visit_instr()
1437 SET_RESULT(op1, &zv); in sccp_visit_instr()
1443 if ((IS_PARTIAL_ARRAY(op1) || Z_TYPE_P(op1) == IS_ARRAY) in sccp_visit_instr()
1452 if (ct_eval_fetch_dim(&tmp, op1, op2, 0) == SUCCESS) { in sccp_visit_instr()
1454 dup_partial_array(&zv, op1); in sccp_visit_instr()
1457 SET_RESULT(op1, &zv); in sccp_visit_instr()
1465 SET_RESULT_BOT(op1); in sccp_visit_instr()
1470 if (IS_PARTIAL_ARRAY(op1)) { in sccp_visit_instr()
1471 dup_partial_array(&zv, op1); in sccp_visit_instr()
1473 ZVAL_COPY(&zv, op1); in sccp_visit_instr()
1478 SET_RESULT(op1, &zv); in sccp_visit_instr()
1489 if (op1 && IS_PARTIAL_OBJECT(op1) in sccp_visit_instr()
1497 if (ct_eval_fetch_obj(&tmp, op1, op2) == SUCCESS) { in sccp_visit_instr()
1499 dup_partial_object(&zv, op1); in sccp_visit_instr()
1502 SET_RESULT(op1, &zv); in sccp_visit_instr()
1510 SET_RESULT_BOT(op1); in sccp_visit_instr()
1515 dup_partial_object(&zv, op1); in sccp_visit_instr()
1519 SET_RESULT(op1, &zv); in sccp_visit_instr()
1531 SET_RESULT_BOT(op1); in sccp_visit_instr()
1537 if (op1) { in sccp_visit_instr()
1538 SKIP_IF_TOP(op1); in sccp_visit_instr()
1540 if (IS_PARTIAL_OBJECT(op1) in sccp_visit_instr()
1545 if (ct_eval_fetch_obj(&tmp1, op1, op2) == SUCCESS in sccp_visit_instr()
1548 dup_partial_object(&zv, op1); in sccp_visit_instr()
1556 SET_RESULT(op1, &zv); in sccp_visit_instr()
1562 SET_RESULT_BOT(op1); in sccp_visit_instr()
1567 SKIP_IF_TOP(op1); in sccp_visit_instr()
1568 if (ct_eval_incdec(&zv, opline->opcode, op1) == SUCCESS) { in sccp_visit_instr()
1569 SET_RESULT(op1, &zv); in sccp_visit_instr()
1574 SET_RESULT_BOT(op1); in sccp_visit_instr()
1579 SKIP_IF_TOP(op1); in sccp_visit_instr()
1580 SET_RESULT(result, op1); in sccp_visit_instr()
1581 if (ct_eval_incdec(&zv, opline->opcode, op1) == SUCCESS) { in sccp_visit_instr()
1582 SET_RESULT(op1, &zv); in sccp_visit_instr()
1586 SET_RESULT_BOT(op1); in sccp_visit_instr()
1590 SKIP_IF_TOP(op1); in sccp_visit_instr()
1591 if (IS_PARTIAL_ARRAY(op1)) { in sccp_visit_instr()
1595 if (zend_optimizer_eval_unary_op(&zv, opline->opcode, op1) == SUCCESS) { in sccp_visit_instr()
1603 SKIP_IF_TOP(op1); in sccp_visit_instr()
1604 if (IS_PARTIAL_ARRAY(op1)) { in sccp_visit_instr()
1608 if (zend_optimizer_eval_cast(&zv, opline->extended_value, op1) == SUCCESS) { in sccp_visit_instr()
1618 SKIP_IF_TOP(op1); in sccp_visit_instr()
1619 if (ct_eval_bool_cast(&zv, op1) == SUCCESS) { in sccp_visit_instr()
1627 SKIP_IF_TOP(op1); in sccp_visit_instr()
1628 if (zend_optimizer_eval_strlen(&zv, op1) == SUCCESS) { in sccp_visit_instr()
1636 SKIP_IF_TOP(op1); in sccp_visit_instr()
1637 if (Z_TYPE_P(op1) == IS_ARRAY) { in sccp_visit_instr()
1638 ZVAL_LONG(&zv, zend_hash_num_elements(Z_ARRVAL_P(op1))); in sccp_visit_instr()
1646 SKIP_IF_TOP(op1); in sccp_visit_instr()
1648 if (ct_eval_in_array(&zv, opline->extended_value, op1, op2) == SUCCESS) { in sccp_visit_instr()
1658 SKIP_IF_TOP(op1); in sccp_visit_instr()
1661 if (ct_eval_fetch_dim(&zv, op1, op2, (opline->opcode != ZEND_FETCH_LIST_R)) == SUCCESS) { in sccp_visit_instr()
1669 SKIP_IF_TOP(op1); in sccp_visit_instr()
1672 if (ct_eval_isset_dim(&zv, opline->extended_value, op1, op2) == SUCCESS) { in sccp_visit_instr()
1681 if (op1) { in sccp_visit_instr()
1682 SKIP_IF_TOP(op1); in sccp_visit_instr()
1685 if (ct_eval_fetch_obj(&zv, op1, op2) == SUCCESS) { in sccp_visit_instr()
1694 if (op1) { in sccp_visit_instr()
1695 SKIP_IF_TOP(op1); in sccp_visit_instr()
1698 if (ct_eval_isset_obj(&zv, opline->extended_value, op1, op2) == SUCCESS) { in sccp_visit_instr()
1709 SET_RESULT(result, op1); in sccp_visit_instr()
1713 if (!op1) { in sccp_visit_instr()
1717 SET_RESULT(result, op1); in sccp_visit_instr()
1721 SKIP_IF_TOP(op1); in sccp_visit_instr()
1722 if (ct_eval_isset_isempty(&zv, opline->extended_value, op1) == SUCCESS) { in sccp_visit_instr()
1730 SKIP_IF_TOP(op1); in sccp_visit_instr()
1731 ct_eval_type_check(&zv, opline->extended_value, op1); in sccp_visit_instr()
1736 SKIP_IF_TOP(op1); in sccp_visit_instr()
1758 SKIP_IF_TOP(op1); in sccp_visit_instr()
1760 if (ct_eval_binary_op(&zv, ZEND_CONCAT, op1, op2) == SUCCESS) { in sccp_visit_instr()
1839 SET_RESULT_BOT(op1); in sccp_visit_instr()
1852 zval *op1, zv; in sccp_mark_feasible_successors() local
1868 op1 = get_op1_value(ctx, opline, ssa_op); in sccp_mark_feasible_successors()
1871 if (!op1 || IS_BOT(op1)) { in sccp_mark_feasible_successors()
1879 if (IS_TOP(op1)) { in sccp_mark_feasible_successors()
1888 if (ct_eval_bool_cast(&zv, op1) == FAILURE) { in sccp_mark_feasible_successors()
1900 if (ct_eval_bool_cast(&zv, op1) == FAILURE) { in sccp_mark_feasible_successors()
1909 s = (Z_TYPE_P(op1) == IS_NULL); in sccp_mark_feasible_successors()
1915 if (Z_TYPE_P(op1) != IS_ARRAY || in sccp_mark_feasible_successors()
1916 (IS_PARTIAL_ARRAY(op1) && zend_hash_num_elements(Z_ARR_P(op1)) == 0)) { in sccp_mark_feasible_successors()
1921 s = zend_hash_num_elements(Z_ARR_P(op1)) != 0; in sccp_mark_feasible_successors()