Lines Matching refs:op1

191 		return CT_CONSTANT_EX(ctx->scdf.op_array, opline->op1.constant);  in get_op1_value()
317 static inline zend_result ct_eval_binary_op(zval *result, zend_uchar binop, zval *op1, zval *op2) { in ct_eval_binary_op() argument
319 if (IS_PARTIAL_ARRAY(op1) || IS_PARTIAL_ARRAY(op2)) { in ct_eval_binary_op()
323 return zend_optimizer_eval_binary_op(result, binop, op1, op2); in ct_eval_binary_op()
358 static inline zend_result fetch_array_elem(zval **result, zval *op1, zval *op2) { in fetch_array_elem() argument
361 *result = zend_hash_find(Z_ARR_P(op1), ZSTR_EMPTY_ALLOC()); in fetch_array_elem()
364 *result = zend_hash_index_find(Z_ARR_P(op1), 0); in fetch_array_elem()
367 *result = zend_hash_index_find(Z_ARR_P(op1), 1); in fetch_array_elem()
370 *result = zend_hash_index_find(Z_ARR_P(op1), Z_LVAL_P(op2)); in fetch_array_elem()
377 *result = zend_hash_index_find(Z_ARR_P(op1), lval); in fetch_array_elem()
381 *result = zend_symtable_find(Z_ARR_P(op1), Z_STR_P(op2)); in fetch_array_elem()
388 static inline zend_result ct_eval_fetch_dim(zval *result, zval *op1, zval *op2, int support_strings… in ct_eval_fetch_dim() argument
389 if (Z_TYPE_P(op1) == IS_ARRAY || IS_PARTIAL_ARRAY(op1)) { in ct_eval_fetch_dim()
391 if (fetch_array_elem(&value, op1, op2) == SUCCESS && value && !IS_BOT(value)) { in ct_eval_fetch_dim()
395 } else if (support_strings && Z_TYPE_P(op1) == IS_STRING) { in ct_eval_fetch_dim()
400 if (index >= 0 && index < Z_STRLEN_P(op1)) { in ct_eval_fetch_dim()
401 ZVAL_STR(result, zend_string_init(&Z_STRVAL_P(op1)[index], 1, 0)); in ct_eval_fetch_dim()
409 static inline zend_result ct_eval_isset_isempty(zval *result, uint32_t extended_value, zval *op1) { in ct_eval_isset_isempty() argument
412 ZVAL_BOOL(result, op1 && Z_TYPE_P(op1) != IS_NULL); in ct_eval_isset_isempty()
414 } else if (!op1) { in ct_eval_isset_isempty()
417 } else if (ct_eval_bool_cast(&zv, op1) == SUCCESS) { in ct_eval_isset_isempty()
425 static inline zend_result ct_eval_isset_dim(zval *result, uint32_t extended_value, zval *op1, zval … in ct_eval_isset_dim() argument
426 if (Z_TYPE_P(op1) == IS_ARRAY || IS_PARTIAL_ARRAY(op1)) { in ct_eval_isset_dim()
428 if (fetch_array_elem(&value, op1, op2) == FAILURE) { in ct_eval_isset_dim()
431 if (IS_PARTIAL_ARRAY(op1) && (!value || IS_BOT(value))) { in ct_eval_isset_dim()
435 } else if (Z_TYPE_P(op1) == IS_STRING) { in ct_eval_isset_dim()
588 static inline zend_result fetch_obj_prop(zval **result, zval *op1, zval *op2) { in fetch_obj_prop() argument
591 *result = zend_symtable_find(Z_ARR_P(op1), Z_STR_P(op2)); in fetch_obj_prop()
598 static inline zend_result ct_eval_fetch_obj(zval *result, zval *op1, zval *op2) { in ct_eval_fetch_obj() argument
599 if (IS_PARTIAL_OBJECT(op1)) { in ct_eval_fetch_obj()
601 if (fetch_obj_prop(&value, op1, op2) == SUCCESS && value && !IS_BOT(value)) { in ct_eval_fetch_obj()
609 static inline zend_result ct_eval_isset_obj(zval *result, uint32_t extended_value, zval *op1, zval … in ct_eval_isset_obj() argument
610 if (IS_PARTIAL_OBJECT(op1)) { in ct_eval_isset_obj()
612 if (fetch_obj_prop(&value, op1, op2) == FAILURE) { in ct_eval_isset_obj()
665 static inline zend_result ct_eval_incdec(zval *result, zend_uchar opcode, zval *op1) { in ct_eval_incdec() argument
666 if (Z_TYPE_P(op1) == IS_ARRAY || IS_PARTIAL_ARRAY(op1)) { in ct_eval_incdec()
670 ZVAL_COPY(result, op1); in ct_eval_incdec()
682 static inline void ct_eval_type_check(zval *result, uint32_t type_mask, zval *op1) { in ct_eval_type_check() argument
683 uint32_t type = Z_TYPE_P(op1); in ct_eval_type_check()
692 static inline zend_result ct_eval_in_array(zval *result, uint32_t extended_value, zval *op1, zval *… in ct_eval_in_array() argument
700 if (EXPECTED(Z_TYPE_P(op1) == IS_STRING)) { in ct_eval_in_array()
701 res = zend_hash_exists(ht, Z_STR_P(op1)); in ct_eval_in_array()
703 if (EXPECTED(Z_TYPE_P(op1) == IS_LONG)) { in ct_eval_in_array()
704 res = zend_hash_index_exists(ht, Z_LVAL_P(op1)); in ct_eval_in_array()
708 } else if (Z_TYPE_P(op1) <= IS_FALSE) { in ct_eval_in_array()
717 if (zend_compare(op1, &key_tmp) == 0) { in ct_eval_in_array()
727 static inline zend_result ct_eval_array_key_exists(zval *result, zval *op1, zval *op2) { in ct_eval_array_key_exists() argument
733 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()
736 if (fetch_array_elem(&value, op2, op1) == FAILURE) { in ct_eval_array_key_exists()
859 zval *op1, *op2, zv; /* zv is a temporary to hold result values */ in sccp_visit_instr() local
861 op1 = get_op1_value(ctx, opline, ssa_op); in sccp_visit_instr()
869 if (IS_BOT(op1) && (ctx->scdf.ssa->var_info[ssa_op->op1_use].type & MAY_BE_REF)) { in sccp_visit_instr()
870 SET_RESULT_BOT(op1); in sccp_visit_instr()
873 SET_RESULT(op1, op2); in sccp_visit_instr()
883 op1 = &EG(uninitialized_zval); in sccp_visit_instr()
886 if (IS_BOT(op1)) { in sccp_visit_instr()
888 SET_RESULT_BOT(op1); in sccp_visit_instr()
892 SKIP_IF_TOP(op1); in sccp_visit_instr()
903 SET_RESULT(op1, &zv); in sccp_visit_instr()
906 SET_RESULT_BOT(op1); in sccp_visit_instr()
914 if ((IS_PARTIAL_ARRAY(op1) in sccp_visit_instr()
915 || Z_TYPE_P(op1) == IS_NULL in sccp_visit_instr()
916 || Z_TYPE_P(op1) == IS_FALSE in sccp_visit_instr()
917 || Z_TYPE_P(op1) == IS_ARRAY) in sccp_visit_instr()
920 if (Z_TYPE_P(op1) == IS_NULL || Z_TYPE_P(op1) == IS_FALSE) { in sccp_visit_instr()
923 dup_partial_array(&zv, op1); in sccp_visit_instr()
928 SET_RESULT(op1, &zv); in sccp_visit_instr()
930 SET_RESULT(op1, &zv); in sccp_visit_instr()
932 SET_RESULT_BOT(op1); in sccp_visit_instr()
937 SET_RESULT_BOT(op1); in sccp_visit_instr()
942 if (IS_PARTIAL_ARRAY(op1)) { in sccp_visit_instr()
943 dup_partial_array(&zv, op1); in sccp_visit_instr()
945 ZVAL_COPY(&zv, op1); in sccp_visit_instr()
951 SET_RESULT(op1, &zv); in sccp_visit_instr()
958 SET_RESULT(op1, &zv); in sccp_visit_instr()
961 SET_RESULT_BOT(op1); in sccp_visit_instr()
981 SET_RESULT_BOT(op1); in sccp_visit_instr()
985 if (IS_BOT(op1)) { in sccp_visit_instr()
987 SET_RESULT_BOT(op1); in sccp_visit_instr()
991 SKIP_IF_TOP(op1); in sccp_visit_instr()
999 SET_RESULT(op1, &zv); in sccp_visit_instr()
1006 if (IS_PARTIAL_OBJECT(op1) in sccp_visit_instr()
1007 || Z_TYPE_P(op1) == IS_NULL in sccp_visit_instr()
1008 || Z_TYPE_P(op1) == IS_FALSE) { in sccp_visit_instr()
1010 if (Z_TYPE_P(op1) == IS_NULL || Z_TYPE_P(op1) == IS_FALSE) { in sccp_visit_instr()
1013 dup_partial_object(&zv, op1); in sccp_visit_instr()
1017 SET_RESULT(op1, &zv); in sccp_visit_instr()
1019 SET_RESULT_BOT(op1); in sccp_visit_instr()
1023 SET_RESULT_BOT(op1); in sccp_visit_instr()
1028 if (IS_PARTIAL_OBJECT(op1)) { in sccp_visit_instr()
1029 dup_partial_object(&zv, op1); in sccp_visit_instr()
1031 ZVAL_COPY(&zv, op1); in sccp_visit_instr()
1036 SET_RESULT(op1, &zv); in sccp_visit_instr()
1039 SET_RESULT_BOT(op1); in sccp_visit_instr()
1046 SET_RESULT_BOT(op1); in sccp_visit_instr()
1061 if (IS_TOP(op1) || !call || !call->caller_call_opline in sccp_visit_instr()
1079 SET_RESULT_BOT(op1); in sccp_visit_instr()
1085 if (op1) { in sccp_visit_instr()
1086 SKIP_IF_TOP(op1); in sccp_visit_instr()
1103 SET_RESULT_BOT(op1); in sccp_visit_instr()
1114 if ((op1 && IS_BOT(op1)) in sccp_visit_instr()
1117 SET_RESULT_BOT(op1); in sccp_visit_instr()
1149 if (op1) { in sccp_visit_instr()
1153 } else if (ct_eval_add_array_elem(&zv, op1, op2) == SUCCESS) { in sccp_visit_instr()
1154 if (IS_PARTIAL_ARRAY(op1)) { in sccp_visit_instr()
1171 if (IS_BOT(result) || IS_BOT(op1)) { in sccp_visit_instr()
1176 SKIP_IF_TOP(op1); in sccp_visit_instr()
1186 if (ct_eval_add_array_unpack(&zv, op1) == SUCCESS) { in sccp_visit_instr()
1209 SET_RESULT_BOT(op1); in sccp_visit_instr()
1213 SET_RESULT_BOT(op1); in sccp_visit_instr()
1217 if ((op1 && IS_BOT(op1)) || (op2 && IS_BOT(op2))) { in sccp_visit_instr()
1221 SET_RESULT_BOT(op1); in sccp_visit_instr()
1249 SKIP_IF_TOP(op1); in sccp_visit_instr()
1252 if (ct_eval_binary_op(&zv, opline->opcode, op1, op2) == SUCCESS) { in sccp_visit_instr()
1263 if (op1) { in sccp_visit_instr()
1264 SKIP_IF_TOP(op1); in sccp_visit_instr()
1270 if (ct_eval_binary_op(&zv, opline->extended_value, op1, op2) == SUCCESS) { in sccp_visit_instr()
1271 SET_RESULT(op1, &zv); in sccp_visit_instr()
1277 if ((IS_PARTIAL_ARRAY(op1) || Z_TYPE_P(op1) == IS_ARRAY) in sccp_visit_instr()
1284 if (ct_eval_fetch_dim(&tmp, op1, op2, 0) == SUCCESS) { in sccp_visit_instr()
1286 dup_partial_array(&zv, op1); in sccp_visit_instr()
1289 SET_RESULT(op1, &zv); in sccp_visit_instr()
1297 SET_RESULT_BOT(op1); in sccp_visit_instr()
1302 if (IS_PARTIAL_ARRAY(op1)) { in sccp_visit_instr()
1303 dup_partial_array(&zv, op1); in sccp_visit_instr()
1305 ZVAL_COPY(&zv, op1); in sccp_visit_instr()
1310 SET_RESULT(op1, &zv); in sccp_visit_instr()
1321 if (op1 && IS_PARTIAL_OBJECT(op1) in sccp_visit_instr()
1329 if (ct_eval_fetch_obj(&tmp, op1, op2) == SUCCESS) { in sccp_visit_instr()
1331 dup_partial_object(&zv, op1); in sccp_visit_instr()
1334 SET_RESULT(op1, &zv); in sccp_visit_instr()
1342 SET_RESULT_BOT(op1); in sccp_visit_instr()
1347 dup_partial_object(&zv, op1); in sccp_visit_instr()
1351 SET_RESULT(op1, &zv); in sccp_visit_instr()
1363 SET_RESULT_BOT(op1); in sccp_visit_instr()
1369 if (op1) { in sccp_visit_instr()
1370 SKIP_IF_TOP(op1); in sccp_visit_instr()
1372 if (IS_PARTIAL_OBJECT(op1) in sccp_visit_instr()
1377 if (ct_eval_fetch_obj(&tmp1, op1, op2) == SUCCESS in sccp_visit_instr()
1380 dup_partial_object(&zv, op1); in sccp_visit_instr()
1389 SET_RESULT(op1, &zv); in sccp_visit_instr()
1395 SET_RESULT_BOT(op1); in sccp_visit_instr()
1400 SKIP_IF_TOP(op1); in sccp_visit_instr()
1401 if (ct_eval_incdec(&zv, opline->opcode, op1) == SUCCESS) { in sccp_visit_instr()
1402 SET_RESULT(op1, &zv); in sccp_visit_instr()
1407 SET_RESULT_BOT(op1); in sccp_visit_instr()
1412 SKIP_IF_TOP(op1); in sccp_visit_instr()
1413 SET_RESULT(result, op1); in sccp_visit_instr()
1414 if (ct_eval_incdec(&zv, opline->opcode, op1) == SUCCESS) { in sccp_visit_instr()
1415 SET_RESULT(op1, &zv); in sccp_visit_instr()
1419 SET_RESULT_BOT(op1); in sccp_visit_instr()
1423 SKIP_IF_TOP(op1); in sccp_visit_instr()
1424 if (IS_PARTIAL_ARRAY(op1)) { in sccp_visit_instr()
1428 if (zend_optimizer_eval_unary_op(&zv, opline->opcode, op1) == SUCCESS) { in sccp_visit_instr()
1436 SKIP_IF_TOP(op1); in sccp_visit_instr()
1437 if (IS_PARTIAL_ARRAY(op1)) { in sccp_visit_instr()
1441 if (zend_optimizer_eval_cast(&zv, opline->extended_value, op1) == SUCCESS) { in sccp_visit_instr()
1451 SKIP_IF_TOP(op1); in sccp_visit_instr()
1452 if (ct_eval_bool_cast(&zv, op1) == SUCCESS) { in sccp_visit_instr()
1460 SKIP_IF_TOP(op1); in sccp_visit_instr()
1461 if (zend_optimizer_eval_strlen(&zv, op1) == SUCCESS) { in sccp_visit_instr()
1470 SKIP_IF_TOP(op1); in sccp_visit_instr()
1471 if (Z_TYPE_P(op1) == IS_ARRAY && zend_hash_num_elements(Z_ARR_P(op1)) == 0) { in sccp_visit_instr()
1479 SKIP_IF_TOP(op1); in sccp_visit_instr()
1480 if (Z_TYPE_P(op1) == IS_ARRAY) { in sccp_visit_instr()
1481 ZVAL_LONG(&zv, zend_hash_num_elements(Z_ARRVAL_P(op1))); in sccp_visit_instr()
1489 SKIP_IF_TOP(op1); in sccp_visit_instr()
1491 if (ct_eval_in_array(&zv, opline->extended_value, op1, op2) == SUCCESS) { in sccp_visit_instr()
1499 SKIP_IF_TOP(op1); in sccp_visit_instr()
1501 if (ct_eval_array_key_exists(&zv, op1, op2) == SUCCESS) { in sccp_visit_instr()
1511 SKIP_IF_TOP(op1); in sccp_visit_instr()
1514 if (ct_eval_fetch_dim(&zv, op1, op2, (opline->opcode != ZEND_FETCH_LIST_R)) == SUCCESS) { in sccp_visit_instr()
1522 SKIP_IF_TOP(op1); in sccp_visit_instr()
1525 if (ct_eval_isset_dim(&zv, opline->extended_value, op1, op2) == SUCCESS) { in sccp_visit_instr()
1534 if (op1) { in sccp_visit_instr()
1535 SKIP_IF_TOP(op1); in sccp_visit_instr()
1538 if (ct_eval_fetch_obj(&zv, op1, op2) == SUCCESS) { in sccp_visit_instr()
1547 if (op1) { in sccp_visit_instr()
1548 SKIP_IF_TOP(op1); in sccp_visit_instr()
1551 if (ct_eval_isset_obj(&zv, opline->extended_value, op1, op2) == SUCCESS) { in sccp_visit_instr()
1563 SET_RESULT(result, op1); in sccp_visit_instr()
1584 SKIP_IF_TOP(op1); in sccp_visit_instr()
1585 if (ct_eval_isset_isempty(&zv, opline->extended_value, op1) == SUCCESS) { in sccp_visit_instr()
1593 SKIP_IF_TOP(op1); in sccp_visit_instr()
1594 ct_eval_type_check(&zv, opline->extended_value, op1); in sccp_visit_instr()
1599 SKIP_IF_TOP(op1); in sccp_visit_instr()
1621 SKIP_IF_TOP(op1); in sccp_visit_instr()
1623 if (ct_eval_binary_op(&zv, ZEND_CONCAT, op1, op2) == SUCCESS) { in sccp_visit_instr()
1703 SET_RESULT_BOT(op1); in sccp_visit_instr()
1767 zval *op1, zv; in sccp_mark_feasible_successors() local
1781 op1 = get_op1_value(ctx, opline, ssa_op); in sccp_mark_feasible_successors()
1782 if (IS_BOT(op1)) { in sccp_mark_feasible_successors()
1784 op1 = value_from_type_and_range(ctx, ssa_op->op1_use, &zv); in sccp_mark_feasible_successors()
1788 if (!op1 || IS_BOT(op1)) { in sccp_mark_feasible_successors()
1796 if (IS_TOP(op1)) { in sccp_mark_feasible_successors()
1804 if (ct_eval_bool_cast(&zv, op1) == FAILURE) { in sccp_mark_feasible_successors()
1816 if (ct_eval_bool_cast(&zv, op1) == FAILURE) { in sccp_mark_feasible_successors()
1825 s = (Z_TYPE_P(op1) == IS_NULL); in sccp_mark_feasible_successors()
1828 s = (Z_TYPE_P(op1) != IS_NULL); in sccp_mark_feasible_successors()
1834 if (Z_TYPE_P(op1) != IS_ARRAY || in sccp_mark_feasible_successors()
1835 (IS_PARTIAL_ARRAY(op1) && zend_hash_num_elements(Z_ARR_P(op1)) == 0)) { in sccp_mark_feasible_successors()
1840 s = zend_hash_num_elements(Z_ARR_P(op1)) != 0; in sccp_mark_feasible_successors()
1847 zend_uchar type = Z_TYPE_P(op1); in sccp_mark_feasible_successors()
1858 ? zend_hash_index_find(jmptable, Z_LVAL_P(op1)) in sccp_mark_feasible_successors()
1859 : zend_hash_find(jmptable, Z_STR_P(op1)); in sccp_mark_feasible_successors()