Lines Matching refs:op1
191 return CT_CONSTANT_EX(ctx->scdf.op_array, opline->op1.constant); in get_op1_value()
318 static inline zend_result ct_eval_binary_op(zval *result, uint8_t binop, zval *op1, zval *op2) { in ct_eval_binary_op() argument
320 if (IS_PARTIAL_ARRAY(op1) || IS_PARTIAL_ARRAY(op2)) { in ct_eval_binary_op()
324 return zend_optimizer_eval_binary_op(result, binop, op1, op2); in ct_eval_binary_op()
359 static inline zend_result fetch_array_elem(zval **result, zval *op1, zval *op2) { in fetch_array_elem() argument
362 *result = zend_hash_find(Z_ARR_P(op1), ZSTR_EMPTY_ALLOC()); in fetch_array_elem()
365 *result = zend_hash_index_find(Z_ARR_P(op1), 0); in fetch_array_elem()
368 *result = zend_hash_index_find(Z_ARR_P(op1), 1); in fetch_array_elem()
371 *result = zend_hash_index_find(Z_ARR_P(op1), Z_LVAL_P(op2)); in fetch_array_elem()
378 *result = zend_hash_index_find(Z_ARR_P(op1), lval); in fetch_array_elem()
382 *result = zend_symtable_find(Z_ARR_P(op1), Z_STR_P(op2)); in fetch_array_elem()
389 static inline zend_result ct_eval_fetch_dim(zval *result, zval *op1, zval *op2, int support_strings… in ct_eval_fetch_dim() argument
390 if (Z_TYPE_P(op1) == IS_ARRAY || IS_PARTIAL_ARRAY(op1)) { in ct_eval_fetch_dim()
392 if (fetch_array_elem(&value, op1, op2) == SUCCESS && value && !IS_BOT(value)) { in ct_eval_fetch_dim()
396 } else if (support_strings && Z_TYPE_P(op1) == IS_STRING) { in ct_eval_fetch_dim()
401 if (index >= 0 && index < Z_STRLEN_P(op1)) { in ct_eval_fetch_dim()
402 ZVAL_STR(result, zend_string_init(&Z_STRVAL_P(op1)[index], 1, 0)); in ct_eval_fetch_dim()
410 static inline zend_result ct_eval_isset_isempty(zval *result, uint32_t extended_value, zval *op1) { in ct_eval_isset_isempty() argument
413 ZVAL_BOOL(result, op1 && Z_TYPE_P(op1) != IS_NULL); in ct_eval_isset_isempty()
415 } else if (!op1) { in ct_eval_isset_isempty()
418 } else if (ct_eval_bool_cast(&zv, op1) == SUCCESS) { in ct_eval_isset_isempty()
426 static inline zend_result ct_eval_isset_dim(zval *result, uint32_t extended_value, zval *op1, zval … in ct_eval_isset_dim() argument
427 if (Z_TYPE_P(op1) == IS_ARRAY || IS_PARTIAL_ARRAY(op1)) { in ct_eval_isset_dim()
429 if (fetch_array_elem(&value, op1, op2) == FAILURE) { in ct_eval_isset_dim()
432 if (IS_PARTIAL_ARRAY(op1) && (!value || IS_BOT(value))) { in ct_eval_isset_dim()
436 } else if (Z_TYPE_P(op1) == IS_STRING) { in ct_eval_isset_dim()
589 static inline zend_result fetch_obj_prop(zval **result, zval *op1, zval *op2) { in fetch_obj_prop() argument
592 *result = zend_symtable_find(Z_ARR_P(op1), Z_STR_P(op2)); in fetch_obj_prop()
599 static inline zend_result ct_eval_fetch_obj(zval *result, zval *op1, zval *op2) { in ct_eval_fetch_obj() argument
600 if (IS_PARTIAL_OBJECT(op1)) { in ct_eval_fetch_obj()
602 if (fetch_obj_prop(&value, op1, op2) == SUCCESS && value && !IS_BOT(value)) { in ct_eval_fetch_obj()
610 static inline zend_result ct_eval_isset_obj(zval *result, uint32_t extended_value, zval *op1, zval … in ct_eval_isset_obj() argument
611 if (IS_PARTIAL_OBJECT(op1)) { in ct_eval_isset_obj()
613 if (fetch_obj_prop(&value, op1, op2) == FAILURE) { in ct_eval_isset_obj()
666 static inline zend_result ct_eval_incdec(zval *result, uint8_t opcode, zval *op1) { in ct_eval_incdec() argument
672 if (Z_TYPE_P(op1) != IS_LONG && Z_TYPE_P(op1) != IS_DOUBLE && Z_TYPE_P(op1) != IS_NULL) { in ct_eval_incdec()
676 ZVAL_COPY(result, op1); in ct_eval_incdec()
684 if (Z_TYPE_P(op1) == IS_NULL) { in ct_eval_incdec()
693 static inline void ct_eval_type_check(zval *result, uint32_t type_mask, zval *op1) { in ct_eval_type_check() argument
694 uint32_t type = Z_TYPE_P(op1); in ct_eval_type_check()
703 static inline zend_result ct_eval_in_array(zval *result, uint32_t extended_value, zval *op1, zval *… in ct_eval_in_array() argument
711 if (EXPECTED(Z_TYPE_P(op1) == IS_STRING)) { in ct_eval_in_array()
712 res = zend_hash_exists(ht, Z_STR_P(op1)); in ct_eval_in_array()
714 if (EXPECTED(Z_TYPE_P(op1) == IS_LONG)) { in ct_eval_in_array()
715 res = zend_hash_index_exists(ht, Z_LVAL_P(op1)); in ct_eval_in_array()
719 } else if (Z_TYPE_P(op1) <= IS_FALSE) { in ct_eval_in_array()
728 if (zend_compare(op1, &key_tmp) == 0) { in ct_eval_in_array()
738 static inline zend_result ct_eval_array_key_exists(zval *result, zval *op1, zval *op2) { in ct_eval_array_key_exists() argument
744 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()
747 if (fetch_array_elem(&value, op2, op1) == FAILURE) { in ct_eval_array_key_exists()
875 zval *op1, *op2, zv; /* zv is a temporary to hold result values */ in sccp_visit_instr() local
877 op1 = get_op1_value(ctx, opline, ssa_op); in sccp_visit_instr()
885 if (IS_BOT(op1) && (ctx->scdf.ssa->var_info[ssa_op->op1_use].type & MAY_BE_REF)) { in sccp_visit_instr()
886 SET_RESULT_BOT(op1); in sccp_visit_instr()
889 SET_RESULT(op1, op2); in sccp_visit_instr()
899 op1 = &EG(uninitialized_zval); in sccp_visit_instr()
902 if (IS_BOT(op1)) { in sccp_visit_instr()
904 SET_RESULT_BOT(op1); in sccp_visit_instr()
908 SKIP_IF_TOP(op1); in sccp_visit_instr()
919 SET_RESULT(op1, &zv); in sccp_visit_instr()
922 SET_RESULT_BOT(op1); in sccp_visit_instr()
930 if ((IS_PARTIAL_ARRAY(op1) in sccp_visit_instr()
931 || Z_TYPE_P(op1) == IS_NULL in sccp_visit_instr()
932 || Z_TYPE_P(op1) == IS_FALSE in sccp_visit_instr()
933 || Z_TYPE_P(op1) == IS_ARRAY) in sccp_visit_instr()
936 if (Z_TYPE_P(op1) == IS_NULL || Z_TYPE_P(op1) == IS_FALSE) { in sccp_visit_instr()
939 dup_partial_array(&zv, op1); in sccp_visit_instr()
944 SET_RESULT(op1, &zv); in sccp_visit_instr()
946 SET_RESULT(op1, &zv); in sccp_visit_instr()
948 SET_RESULT_BOT(op1); in sccp_visit_instr()
953 SET_RESULT_BOT(op1); in sccp_visit_instr()
958 if (IS_PARTIAL_ARRAY(op1)) { in sccp_visit_instr()
959 dup_partial_array(&zv, op1); in sccp_visit_instr()
961 ZVAL_COPY(&zv, op1); in sccp_visit_instr()
967 SET_RESULT(op1, &zv); in sccp_visit_instr()
974 SET_RESULT(op1, &zv); in sccp_visit_instr()
977 SET_RESULT_BOT(op1); in sccp_visit_instr()
997 SET_RESULT_BOT(op1); in sccp_visit_instr()
1001 if (IS_BOT(op1)) { in sccp_visit_instr()
1003 SET_RESULT_BOT(op1); in sccp_visit_instr()
1007 SKIP_IF_TOP(op1); in sccp_visit_instr()
1015 SET_RESULT(op1, &zv); in sccp_visit_instr()
1022 if (IS_PARTIAL_OBJECT(op1) in sccp_visit_instr()
1023 || Z_TYPE_P(op1) == IS_NULL in sccp_visit_instr()
1024 || Z_TYPE_P(op1) == IS_FALSE) { in sccp_visit_instr()
1026 if (Z_TYPE_P(op1) == IS_NULL || Z_TYPE_P(op1) == IS_FALSE) { in sccp_visit_instr()
1029 dup_partial_object(&zv, op1); in sccp_visit_instr()
1033 SET_RESULT(op1, &zv); in sccp_visit_instr()
1035 SET_RESULT_BOT(op1); in sccp_visit_instr()
1039 SET_RESULT_BOT(op1); in sccp_visit_instr()
1044 if (IS_PARTIAL_OBJECT(op1)) { in sccp_visit_instr()
1045 dup_partial_object(&zv, op1); in sccp_visit_instr()
1047 ZVAL_COPY(&zv, op1); in sccp_visit_instr()
1052 SET_RESULT(op1, &zv); in sccp_visit_instr()
1055 SET_RESULT_BOT(op1); in sccp_visit_instr()
1062 SET_RESULT_BOT(op1); in sccp_visit_instr()
1077 if (IS_TOP(op1) || !call || !call->caller_call_opline in sccp_visit_instr()
1095 SET_RESULT_BOT(op1); in sccp_visit_instr()
1101 if (op1) { in sccp_visit_instr()
1102 SKIP_IF_TOP(op1); in sccp_visit_instr()
1119 SET_RESULT_BOT(op1); in sccp_visit_instr()
1130 if ((op1 && IS_BOT(op1)) in sccp_visit_instr()
1133 SET_RESULT_BOT(op1); in sccp_visit_instr()
1165 if (op1) { in sccp_visit_instr()
1169 } else if (ct_eval_add_array_elem(&zv, op1, op2) == SUCCESS) { in sccp_visit_instr()
1170 if (IS_PARTIAL_ARRAY(op1)) { in sccp_visit_instr()
1187 if (IS_BOT(result) || IS_BOT(op1)) { in sccp_visit_instr()
1192 SKIP_IF_TOP(op1); in sccp_visit_instr()
1202 if (ct_eval_add_array_unpack(&zv, op1) == SUCCESS) { in sccp_visit_instr()
1225 SET_RESULT_BOT(op1); in sccp_visit_instr()
1229 SET_RESULT_BOT(op1); in sccp_visit_instr()
1233 if ((op1 && IS_BOT(op1)) || (op2 && IS_BOT(op2))) { in sccp_visit_instr()
1237 SET_RESULT_BOT(op1); in sccp_visit_instr()
1265 SKIP_IF_TOP(op1); in sccp_visit_instr()
1268 if (ct_eval_binary_op(&zv, opline->opcode, op1, op2) == SUCCESS) { in sccp_visit_instr()
1279 if (op1) { in sccp_visit_instr()
1280 SKIP_IF_TOP(op1); in sccp_visit_instr()
1286 if (ct_eval_binary_op(&zv, opline->extended_value, op1, op2) == SUCCESS) { in sccp_visit_instr()
1287 SET_RESULT(op1, &zv); in sccp_visit_instr()
1293 if ((IS_PARTIAL_ARRAY(op1) || Z_TYPE_P(op1) == IS_ARRAY) in sccp_visit_instr()
1300 if (ct_eval_fetch_dim(&tmp, op1, op2, 0) == SUCCESS) { in sccp_visit_instr()
1302 dup_partial_array(&zv, op1); in sccp_visit_instr()
1305 SET_RESULT(op1, &zv); in sccp_visit_instr()
1313 SET_RESULT_BOT(op1); in sccp_visit_instr()
1318 if (IS_PARTIAL_ARRAY(op1)) { in sccp_visit_instr()
1319 dup_partial_array(&zv, op1); in sccp_visit_instr()
1321 ZVAL_COPY(&zv, op1); in sccp_visit_instr()
1326 SET_RESULT(op1, &zv); in sccp_visit_instr()
1337 if (op1 && IS_PARTIAL_OBJECT(op1) in sccp_visit_instr()
1345 if (ct_eval_fetch_obj(&tmp, op1, op2) == SUCCESS) { in sccp_visit_instr()
1347 dup_partial_object(&zv, op1); in sccp_visit_instr()
1350 SET_RESULT(op1, &zv); in sccp_visit_instr()
1358 SET_RESULT_BOT(op1); in sccp_visit_instr()
1363 dup_partial_object(&zv, op1); in sccp_visit_instr()
1367 SET_RESULT(op1, &zv); in sccp_visit_instr()
1379 SET_RESULT_BOT(op1); in sccp_visit_instr()
1385 if (op1) { in sccp_visit_instr()
1386 SKIP_IF_TOP(op1); in sccp_visit_instr()
1388 if (IS_PARTIAL_OBJECT(op1) in sccp_visit_instr()
1393 if (ct_eval_fetch_obj(&tmp1, op1, op2) == SUCCESS) { in sccp_visit_instr()
1395 dup_partial_object(&zv, op1); in sccp_visit_instr()
1404 SET_RESULT(op1, &zv); in sccp_visit_instr()
1412 SET_RESULT_BOT(op1); in sccp_visit_instr()
1417 SKIP_IF_TOP(op1); in sccp_visit_instr()
1418 if (ct_eval_incdec(&zv, opline->opcode, op1) == SUCCESS) { in sccp_visit_instr()
1419 SET_RESULT(op1, &zv); in sccp_visit_instr()
1424 SET_RESULT_BOT(op1); in sccp_visit_instr()
1429 SKIP_IF_TOP(op1); in sccp_visit_instr()
1430 SET_RESULT(result, op1); in sccp_visit_instr()
1431 if (ct_eval_incdec(&zv, opline->opcode, op1) == SUCCESS) { in sccp_visit_instr()
1432 SET_RESULT(op1, &zv); in sccp_visit_instr()
1436 SET_RESULT_BOT(op1); in sccp_visit_instr()
1440 SKIP_IF_TOP(op1); in sccp_visit_instr()
1441 if (IS_PARTIAL_ARRAY(op1)) { in sccp_visit_instr()
1445 if (zend_optimizer_eval_unary_op(&zv, opline->opcode, op1) == SUCCESS) { in sccp_visit_instr()
1453 SKIP_IF_TOP(op1); in sccp_visit_instr()
1454 if (IS_PARTIAL_ARRAY(op1)) { in sccp_visit_instr()
1458 if (zend_optimizer_eval_cast(&zv, opline->extended_value, op1) == SUCCESS) { in sccp_visit_instr()
1468 SKIP_IF_TOP(op1); in sccp_visit_instr()
1469 if (ct_eval_bool_cast(&zv, op1) == SUCCESS) { in sccp_visit_instr()
1477 SKIP_IF_TOP(op1); in sccp_visit_instr()
1478 if (zend_optimizer_eval_strlen(&zv, op1) == SUCCESS) { in sccp_visit_instr()
1487 SKIP_IF_TOP(op1); in sccp_visit_instr()
1488 if (Z_TYPE_P(op1) == IS_ARRAY && zend_hash_num_elements(Z_ARR_P(op1)) == 0) { in sccp_visit_instr()
1496 SKIP_IF_TOP(op1); in sccp_visit_instr()
1497 if (Z_TYPE_P(op1) == IS_ARRAY) { in sccp_visit_instr()
1498 ZVAL_LONG(&zv, zend_hash_num_elements(Z_ARRVAL_P(op1))); in sccp_visit_instr()
1506 SKIP_IF_TOP(op1); in sccp_visit_instr()
1508 if (ct_eval_in_array(&zv, opline->extended_value, op1, op2) == SUCCESS) { in sccp_visit_instr()
1516 SKIP_IF_TOP(op1); in sccp_visit_instr()
1518 if (ct_eval_array_key_exists(&zv, op1, op2) == SUCCESS) { in sccp_visit_instr()
1528 SKIP_IF_TOP(op1); in sccp_visit_instr()
1531 if (ct_eval_fetch_dim(&zv, op1, op2, (opline->opcode != ZEND_FETCH_LIST_R)) == SUCCESS) { in sccp_visit_instr()
1539 SKIP_IF_TOP(op1); in sccp_visit_instr()
1542 if (ct_eval_isset_dim(&zv, opline->extended_value, op1, op2) == SUCCESS) { in sccp_visit_instr()
1551 if (op1) { in sccp_visit_instr()
1552 SKIP_IF_TOP(op1); in sccp_visit_instr()
1555 if (ct_eval_fetch_obj(&zv, op1, op2) == SUCCESS) { in sccp_visit_instr()
1564 if (op1) { in sccp_visit_instr()
1565 SKIP_IF_TOP(op1); in sccp_visit_instr()
1568 if (ct_eval_isset_obj(&zv, opline->extended_value, op1, op2) == SUCCESS) { in sccp_visit_instr()
1580 SET_RESULT(result, op1); in sccp_visit_instr()
1601 SKIP_IF_TOP(op1); in sccp_visit_instr()
1602 if (ct_eval_isset_isempty(&zv, opline->extended_value, op1) == SUCCESS) { in sccp_visit_instr()
1610 SKIP_IF_TOP(op1); in sccp_visit_instr()
1611 ct_eval_type_check(&zv, opline->extended_value, op1); in sccp_visit_instr()
1616 SKIP_IF_TOP(op1); in sccp_visit_instr()
1638 SKIP_IF_TOP(op1); in sccp_visit_instr()
1640 if (ct_eval_binary_op(&zv, ZEND_CONCAT, op1, op2) == SUCCESS) { in sccp_visit_instr()
1765 SET_RESULT_BOT(op1); in sccp_visit_instr()
1829 zval *op1, zv; in sccp_mark_feasible_successors() local
1844 op1 = get_op1_value(ctx, opline, ssa_op); in sccp_mark_feasible_successors()
1845 if (IS_BOT(op1)) { in sccp_mark_feasible_successors()
1847 op1 = value_from_type_and_range(ctx, ssa_op->op1_use, &zv); in sccp_mark_feasible_successors()
1851 if (!op1 || IS_BOT(op1)) { in sccp_mark_feasible_successors()
1859 if (IS_TOP(op1)) { in sccp_mark_feasible_successors()
1867 if (ct_eval_bool_cast(&zv, op1) == FAILURE) { in sccp_mark_feasible_successors()
1879 if (ct_eval_bool_cast(&zv, op1) == FAILURE) { in sccp_mark_feasible_successors()
1888 s = (Z_TYPE_P(op1) == IS_NULL); in sccp_mark_feasible_successors()
1891 s = (Z_TYPE_P(op1) != IS_NULL); in sccp_mark_feasible_successors()
1897 if (Z_TYPE_P(op1) != IS_ARRAY || in sccp_mark_feasible_successors()
1898 (IS_PARTIAL_ARRAY(op1) && zend_hash_num_elements(Z_ARR_P(op1)) == 0)) { in sccp_mark_feasible_successors()
1903 s = zend_hash_num_elements(Z_ARR_P(op1)) != 0; in sccp_mark_feasible_successors()
1910 uint8_t type = Z_TYPE_P(op1); in sccp_mark_feasible_successors()
1921 ? zend_hash_index_find(jmptable, Z_LVAL_P(op1)) in sccp_mark_feasible_successors()
1922 : zend_hash_find(jmptable, Z_STR_P(op1)); in sccp_mark_feasible_successors()