Lines Matching refs:op1

191 		return CT_CONSTANT_EX(ctx->scdf.op_array, opline->op1.constant);  in get_op1_value()
310 opline->op1.constant = zend_optimizer_add_literal(ctx->scdf.op_array, &zv); in try_replace_op1()
318 opline->op1.constant = zend_optimizer_add_literal(ctx->scdf.op_array, &zv); in try_replace_op1()
368 static inline int ct_eval_binary_op(zval *result, zend_uchar binop, zval *op1, zval *op2) { in ct_eval_binary_op() argument
370 if (IS_PARTIAL_ARRAY(op1) || IS_PARTIAL_ARRAY(op2)) { in ct_eval_binary_op()
374 return zend_optimizer_eval_binary_op(result, binop, op1, op2); in ct_eval_binary_op()
409 static inline int fetch_array_elem(zval **result, zval *op1, zval *op2) { in fetch_array_elem() argument
412 *result = zend_hash_find(Z_ARR_P(op1), ZSTR_EMPTY_ALLOC()); in fetch_array_elem()
415 *result = zend_hash_index_find(Z_ARR_P(op1), 0); in fetch_array_elem()
418 *result = zend_hash_index_find(Z_ARR_P(op1), 1); in fetch_array_elem()
421 *result = zend_hash_index_find(Z_ARR_P(op1), Z_LVAL_P(op2)); in fetch_array_elem()
424 *result = zend_hash_index_find(Z_ARR_P(op1), zend_dval_to_lval(Z_DVAL_P(op2))); in fetch_array_elem()
427 *result = zend_symtable_find(Z_ARR_P(op1), Z_STR_P(op2)); in fetch_array_elem()
434 static inline int ct_eval_fetch_dim(zval *result, zval *op1, zval *op2, int support_strings) { in ct_eval_fetch_dim() argument
435 if (Z_TYPE_P(op1) == IS_ARRAY || IS_PARTIAL_ARRAY(op1)) { in ct_eval_fetch_dim()
437 if (fetch_array_elem(&value, op1, op2) == SUCCESS && value && !IS_BOT(value)) { in ct_eval_fetch_dim()
441 } else if (support_strings && Z_TYPE_P(op1) == IS_STRING) { in ct_eval_fetch_dim()
446 if (index >= 0 && index < Z_STRLEN_P(op1)) { in ct_eval_fetch_dim()
447 ZVAL_STR(result, zend_string_init(&Z_STRVAL_P(op1)[index], 1, 0)); in ct_eval_fetch_dim()
455 static inline int ct_eval_isset_isempty(zval *result, uint32_t extended_value, zval *op1) { in ct_eval_isset_isempty() argument
458 ZVAL_BOOL(result, op1 && Z_TYPE_P(op1) != IS_NULL); in ct_eval_isset_isempty()
460 } else if (!op1) { in ct_eval_isset_isempty()
463 } else if (ct_eval_bool_cast(&zv, op1) == SUCCESS) { in ct_eval_isset_isempty()
471 static inline int ct_eval_isset_dim(zval *result, uint32_t extended_value, zval *op1, zval *op2) { in ct_eval_isset_dim() argument
472 if (Z_TYPE_P(op1) == IS_ARRAY || IS_PARTIAL_ARRAY(op1)) { in ct_eval_isset_dim()
474 if (fetch_array_elem(&value, op1, op2) == FAILURE) { in ct_eval_isset_dim()
477 if (IS_PARTIAL_ARRAY(op1) && (!value || IS_BOT(value))) { in ct_eval_isset_dim()
481 } else if (Z_TYPE_P(op1) == IS_STRING) { in ct_eval_isset_dim()
623 static inline int fetch_obj_prop(zval **result, zval *op1, zval *op2) { in fetch_obj_prop() argument
626 *result = zend_symtable_find(Z_ARR_P(op1), Z_STR_P(op2)); in fetch_obj_prop()
633 static inline int ct_eval_fetch_obj(zval *result, zval *op1, zval *op2) { in ct_eval_fetch_obj() argument
634 if (IS_PARTIAL_OBJECT(op1)) { in ct_eval_fetch_obj()
636 if (fetch_obj_prop(&value, op1, op2) == SUCCESS && value && !IS_BOT(value)) { in ct_eval_fetch_obj()
644 static inline int ct_eval_isset_obj(zval *result, uint32_t extended_value, zval *op1, zval *op2) { in ct_eval_isset_obj() argument
645 if (IS_PARTIAL_OBJECT(op1)) { in ct_eval_isset_obj()
647 if (fetch_obj_prop(&value, op1, op2) == FAILURE) { in ct_eval_isset_obj()
700 static inline int ct_eval_incdec(zval *result, zend_uchar opcode, zval *op1) { in ct_eval_incdec() argument
701 ZVAL_COPY(result, op1); in ct_eval_incdec()
713 static inline void ct_eval_type_check(zval *result, uint32_t type_mask, zval *op1) { in ct_eval_type_check() argument
714 uint32_t type = Z_TYPE_P(op1); in ct_eval_type_check()
723 static inline int ct_eval_in_array(zval *result, uint32_t extended_value, zval *op1, zval *op2) { in ct_eval_in_array() argument
731 if (EXPECTED(Z_TYPE_P(op1) == IS_STRING)) { in ct_eval_in_array()
732 res = zend_hash_exists(ht, Z_STR_P(op1)); in ct_eval_in_array()
734 if (EXPECTED(Z_TYPE_P(op1) == IS_LONG)) { in ct_eval_in_array()
735 res = zend_hash_index_exists(ht, Z_LVAL_P(op1)); in ct_eval_in_array()
739 } else if (Z_TYPE_P(op1) <= IS_FALSE) { in ct_eval_in_array()
748 compare_function(&result_tmp, op1, &key_tmp); in ct_eval_in_array()
759 static inline int ct_eval_array_key_exists(zval *result, zval *op1, zval *op2) { in ct_eval_array_key_exists() argument
765 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()
768 if (fetch_array_elem(&value, op2, op1) == FAILURE) { in ct_eval_array_key_exists()
1069 zval *op1, *op2, zv; /* zv is a temporary to hold result values */ in sccp_visit_instr() local
1071 op1 = get_op1_value(ctx, opline, ssa_op); in sccp_visit_instr()
1078 if (IS_BOT(op1) && (ctx->scdf.ssa->var_info[ssa_op->op1_use].type & MAY_BE_REF)) { in sccp_visit_instr()
1079 SET_RESULT_BOT(op1); in sccp_visit_instr()
1081 SET_RESULT(op1, op2); in sccp_visit_instr()
1089 if (!value_known(op1)) { in sccp_visit_instr()
1110 op1 = &EG(uninitialized_zval); in sccp_visit_instr()
1113 if (IS_BOT(op1)) { in sccp_visit_instr()
1115 SET_RESULT_BOT(op1); in sccp_visit_instr()
1119 SKIP_IF_TOP(op1); in sccp_visit_instr()
1130 SET_RESULT(op1, &zv); in sccp_visit_instr()
1133 SET_RESULT_BOT(op1); in sccp_visit_instr()
1141 if ((IS_PARTIAL_ARRAY(op1) in sccp_visit_instr()
1142 || Z_TYPE_P(op1) == IS_NULL in sccp_visit_instr()
1143 || Z_TYPE_P(op1) == IS_FALSE in sccp_visit_instr()
1144 || Z_TYPE_P(op1) == IS_ARRAY) in sccp_visit_instr()
1147 if (Z_TYPE_P(op1) == IS_NULL || Z_TYPE_P(op1) == IS_FALSE) { in sccp_visit_instr()
1150 dup_partial_array(&zv, op1); in sccp_visit_instr()
1155 SET_RESULT(op1, &zv); in sccp_visit_instr()
1157 SET_RESULT(op1, &zv); in sccp_visit_instr()
1159 SET_RESULT_BOT(op1); in sccp_visit_instr()
1164 SET_RESULT_BOT(op1); in sccp_visit_instr()
1169 if (IS_PARTIAL_ARRAY(op1)) { in sccp_visit_instr()
1170 dup_partial_array(&zv, op1); in sccp_visit_instr()
1172 ZVAL_COPY(&zv, op1); in sccp_visit_instr()
1178 SET_RESULT(op1, &zv); in sccp_visit_instr()
1185 SET_RESULT(op1, &zv); in sccp_visit_instr()
1188 SET_RESULT_BOT(op1); in sccp_visit_instr()
1206 SET_RESULT_BOT(op1); in sccp_visit_instr()
1212 op1 = &EG(uninitialized_zval); in sccp_visit_instr()
1215 if (IS_BOT(op1)) { in sccp_visit_instr()
1217 SET_RESULT_BOT(op1); in sccp_visit_instr()
1221 SKIP_IF_TOP(op1); in sccp_visit_instr()
1229 SET_RESULT(op1, &zv); in sccp_visit_instr()
1236 if (IS_PARTIAL_OBJECT(op1) in sccp_visit_instr()
1237 || Z_TYPE_P(op1) == IS_NULL in sccp_visit_instr()
1238 || Z_TYPE_P(op1) == IS_FALSE) { in sccp_visit_instr()
1240 if (Z_TYPE_P(op1) == IS_NULL || Z_TYPE_P(op1) == IS_FALSE) { in sccp_visit_instr()
1243 dup_partial_object(&zv, op1); in sccp_visit_instr()
1247 SET_RESULT(op1, &zv); in sccp_visit_instr()
1249 SET_RESULT_BOT(op1); in sccp_visit_instr()
1253 SET_RESULT_BOT(op1); in sccp_visit_instr()
1258 if (IS_PARTIAL_OBJECT(op1)) { in sccp_visit_instr()
1259 dup_partial_object(&zv, op1); in sccp_visit_instr()
1261 ZVAL_COPY(&zv, op1); in sccp_visit_instr()
1266 SET_RESULT(op1, &zv); in sccp_visit_instr()
1269 SET_RESULT_BOT(op1); in sccp_visit_instr()
1276 SET_RESULT_BOT(op1); in sccp_visit_instr()
1291 if (IS_TOP(op1) || !call || !call->caller_call_opline in sccp_visit_instr()
1309 SET_RESULT_BOT(op1); in sccp_visit_instr()
1315 if (op1) { in sccp_visit_instr()
1316 SKIP_IF_TOP(op1); in sccp_visit_instr()
1333 SET_RESULT_BOT(op1); in sccp_visit_instr()
1344 if ((op1 && IS_BOT(op1)) in sccp_visit_instr()
1347 SET_RESULT_BOT(op1); in sccp_visit_instr()
1379 if (op1) { in sccp_visit_instr()
1383 } else if (ct_eval_add_array_elem(&zv, op1, op2) == SUCCESS) { in sccp_visit_instr()
1384 if (IS_PARTIAL_ARRAY(op1)) { in sccp_visit_instr()
1401 if (IS_BOT(result) || IS_BOT(op1)) { in sccp_visit_instr()
1406 SKIP_IF_TOP(op1); in sccp_visit_instr()
1416 if (ct_eval_add_array_unpack(&zv, op1) == SUCCESS) { in sccp_visit_instr()
1439 SET_RESULT_BOT(op1); in sccp_visit_instr()
1443 SET_RESULT_BOT(op1); in sccp_visit_instr()
1447 if ((op1 && IS_BOT(op1)) || (op2 && IS_BOT(op2))) { in sccp_visit_instr()
1451 SET_RESULT_BOT(op1); in sccp_visit_instr()
1478 SKIP_IF_TOP(op1); in sccp_visit_instr()
1481 if (ct_eval_binary_op(&zv, opline->opcode, op1, op2) == SUCCESS) { in sccp_visit_instr()
1492 if (op1) { in sccp_visit_instr()
1493 SKIP_IF_TOP(op1); in sccp_visit_instr()
1499 if (ct_eval_binary_op(&zv, opline->extended_value, op1, op2) == SUCCESS) { in sccp_visit_instr()
1500 SET_RESULT(op1, &zv); in sccp_visit_instr()
1506 if ((IS_PARTIAL_ARRAY(op1) || Z_TYPE_P(op1) == IS_ARRAY) in sccp_visit_instr()
1513 if (ct_eval_fetch_dim(&tmp, op1, op2, 0) == SUCCESS) { in sccp_visit_instr()
1515 dup_partial_array(&zv, op1); in sccp_visit_instr()
1518 SET_RESULT(op1, &zv); in sccp_visit_instr()
1526 SET_RESULT_BOT(op1); in sccp_visit_instr()
1531 if (IS_PARTIAL_ARRAY(op1)) { in sccp_visit_instr()
1532 dup_partial_array(&zv, op1); in sccp_visit_instr()
1534 ZVAL_COPY(&zv, op1); in sccp_visit_instr()
1539 SET_RESULT(op1, &zv); in sccp_visit_instr()
1550 if (op1 && IS_PARTIAL_OBJECT(op1) in sccp_visit_instr()
1558 if (ct_eval_fetch_obj(&tmp, op1, op2) == SUCCESS) { in sccp_visit_instr()
1560 dup_partial_object(&zv, op1); in sccp_visit_instr()
1563 SET_RESULT(op1, &zv); in sccp_visit_instr()
1571 SET_RESULT_BOT(op1); in sccp_visit_instr()
1576 dup_partial_object(&zv, op1); in sccp_visit_instr()
1580 SET_RESULT(op1, &zv); in sccp_visit_instr()
1592 SET_RESULT_BOT(op1); in sccp_visit_instr()
1598 if (op1) { in sccp_visit_instr()
1599 SKIP_IF_TOP(op1); in sccp_visit_instr()
1601 if (IS_PARTIAL_OBJECT(op1) in sccp_visit_instr()
1606 if (ct_eval_fetch_obj(&tmp1, op1, op2) == SUCCESS in sccp_visit_instr()
1609 dup_partial_object(&zv, op1); in sccp_visit_instr()
1617 SET_RESULT(op1, &zv); in sccp_visit_instr()
1623 SET_RESULT_BOT(op1); in sccp_visit_instr()
1628 SKIP_IF_TOP(op1); in sccp_visit_instr()
1629 if (ct_eval_incdec(&zv, opline->opcode, op1) == SUCCESS) { in sccp_visit_instr()
1630 SET_RESULT(op1, &zv); in sccp_visit_instr()
1635 SET_RESULT_BOT(op1); in sccp_visit_instr()
1640 SKIP_IF_TOP(op1); in sccp_visit_instr()
1641 SET_RESULT(result, op1); in sccp_visit_instr()
1642 if (ct_eval_incdec(&zv, opline->opcode, op1) == SUCCESS) { in sccp_visit_instr()
1643 SET_RESULT(op1, &zv); in sccp_visit_instr()
1647 SET_RESULT_BOT(op1); in sccp_visit_instr()
1651 SKIP_IF_TOP(op1); in sccp_visit_instr()
1652 if (IS_PARTIAL_ARRAY(op1)) { in sccp_visit_instr()
1656 if (zend_optimizer_eval_unary_op(&zv, opline->opcode, op1) == SUCCESS) { in sccp_visit_instr()
1664 SKIP_IF_TOP(op1); in sccp_visit_instr()
1665 if (IS_PARTIAL_ARRAY(op1)) { in sccp_visit_instr()
1669 if (zend_optimizer_eval_cast(&zv, opline->extended_value, op1) == SUCCESS) { in sccp_visit_instr()
1679 SKIP_IF_TOP(op1); in sccp_visit_instr()
1680 if (ct_eval_bool_cast(&zv, op1) == SUCCESS) { in sccp_visit_instr()
1688 SKIP_IF_TOP(op1); in sccp_visit_instr()
1689 if (zend_optimizer_eval_strlen(&zv, op1) == SUCCESS) { in sccp_visit_instr()
1697 SKIP_IF_TOP(op1); in sccp_visit_instr()
1698 if (Z_TYPE_P(op1) == IS_ARRAY) { in sccp_visit_instr()
1699 ZVAL_LONG(&zv, zend_hash_num_elements(Z_ARRVAL_P(op1))); in sccp_visit_instr()
1707 SKIP_IF_TOP(op1); in sccp_visit_instr()
1709 if (ct_eval_in_array(&zv, opline->extended_value, op1, op2) == SUCCESS) { in sccp_visit_instr()
1717 SKIP_IF_TOP(op1); in sccp_visit_instr()
1719 if (ct_eval_array_key_exists(&zv, op1, op2) == SUCCESS) { in sccp_visit_instr()
1729 SKIP_IF_TOP(op1); in sccp_visit_instr()
1732 if (ct_eval_fetch_dim(&zv, op1, op2, (opline->opcode != ZEND_FETCH_LIST_R)) == SUCCESS) { in sccp_visit_instr()
1740 SKIP_IF_TOP(op1); in sccp_visit_instr()
1743 if (ct_eval_isset_dim(&zv, opline->extended_value, op1, op2) == SUCCESS) { in sccp_visit_instr()
1752 if (op1) { in sccp_visit_instr()
1753 SKIP_IF_TOP(op1); in sccp_visit_instr()
1756 if (ct_eval_fetch_obj(&zv, op1, op2) == SUCCESS) { in sccp_visit_instr()
1765 if (op1) { in sccp_visit_instr()
1766 SKIP_IF_TOP(op1); in sccp_visit_instr()
1769 if (ct_eval_isset_obj(&zv, opline->extended_value, op1, op2) == SUCCESS) { in sccp_visit_instr()
1781 SET_RESULT(result, op1); in sccp_visit_instr()
1785 if (!op1) { in sccp_visit_instr()
1789 SET_RESULT(result, op1); in sccp_visit_instr()
1793 SKIP_IF_TOP(op1); in sccp_visit_instr()
1794 if (ct_eval_isset_isempty(&zv, opline->extended_value, op1) == SUCCESS) { in sccp_visit_instr()
1802 SKIP_IF_TOP(op1); in sccp_visit_instr()
1803 ct_eval_type_check(&zv, opline->extended_value, op1); in sccp_visit_instr()
1808 SKIP_IF_TOP(op1); in sccp_visit_instr()
1830 SKIP_IF_TOP(op1); in sccp_visit_instr()
1832 if (ct_eval_binary_op(&zv, ZEND_CONCAT, op1, op2) == SUCCESS) { in sccp_visit_instr()
1911 SET_RESULT_BOT(op1); in sccp_visit_instr()
1924 zval *op1, zv; in sccp_mark_feasible_successors() local
1938 op1 = get_op1_value(ctx, opline, ssa_op); in sccp_mark_feasible_successors()
1941 if (!op1 || IS_BOT(op1)) { in sccp_mark_feasible_successors()
1949 if (IS_TOP(op1)) { in sccp_mark_feasible_successors()
1958 if (ct_eval_bool_cast(&zv, op1) == FAILURE) { in sccp_mark_feasible_successors()
1970 if (ct_eval_bool_cast(&zv, op1) == FAILURE) { in sccp_mark_feasible_successors()
1979 s = (Z_TYPE_P(op1) == IS_NULL); in sccp_mark_feasible_successors()
1985 if (Z_TYPE_P(op1) != IS_ARRAY || in sccp_mark_feasible_successors()
1986 (IS_PARTIAL_ARRAY(op1) && zend_hash_num_elements(Z_ARR_P(op1)) == 0)) { in sccp_mark_feasible_successors()
1991 s = zend_hash_num_elements(Z_ARR_P(op1)) != 0; in sccp_mark_feasible_successors()
1994 if (Z_TYPE_P(op1) == IS_LONG) { in sccp_mark_feasible_successors()
1998 zval *jmp_zv = zend_hash_index_find(jmptable, Z_LVAL_P(op1)); in sccp_mark_feasible_successors()
2012 if (Z_TYPE_P(op1) == IS_STRING) { in sccp_mark_feasible_successors()
2016 zval *jmp_zv = zend_hash_find(jmptable, Z_STR_P(op1)); in sccp_mark_feasible_successors()