Lines Matching refs:zv

90 #define IS_TOP(zv) (Z_TYPE_P(zv) == TOP)  argument
91 #define IS_BOT(zv) (Z_TYPE_P(zv) == BOT) argument
92 #define IS_PARTIAL_ARRAY(zv) (Z_TYPE_P(zv) == PARTIAL_ARRAY) argument
93 #define IS_PARTIAL_OBJECT(zv) (Z_TYPE_P(zv) == PARTIAL_OBJECT) argument
95 #define MAKE_PARTIAL_ARRAY(zv) (Z_TYPE_INFO_P(zv) = PARTIAL_ARRAY | (IS_TYPE_REFCOUNTED << Z_TYPE_F… argument
96 #define MAKE_PARTIAL_OBJECT(zv) (Z_TYPE_INFO_P(zv) = PARTIAL_OBJECT | (IS_TYPE_REFCOUNTED << Z_TYPE… argument
98 #define MAKE_TOP(zv) (Z_TYPE_INFO_P(zv) = TOP) argument
99 #define MAKE_BOT(zv) (Z_TYPE_INFO_P(zv) = BOT) argument
101 static void scp_dump_value(zval *zv) { in scp_dump_value() argument
102 if (IS_TOP(zv)) { in scp_dump_value()
104 } else if (IS_BOT(zv)) { in scp_dump_value()
106 } else if (Z_TYPE_P(zv) == IS_ARRAY || IS_PARTIAL_ARRAY(zv)) { in scp_dump_value()
107 fprintf(stderr, " %s[", IS_PARTIAL_ARRAY(zv) ? "partial " : ""); in scp_dump_value()
108 zend_dump_ht(Z_ARRVAL_P(zv)); in scp_dump_value()
110 } else if (IS_PARTIAL_OBJECT(zv)) { in scp_dump_value()
112 zend_dump_ht(Z_ARRVAL_P(zv)); in scp_dump_value()
115 zend_dump_const(zv); in scp_dump_value()
119 static void empty_partial_array(zval *zv) in empty_partial_array() argument
121 MAKE_PARTIAL_ARRAY(zv); in empty_partial_array()
122 Z_ARR_P(zv) = zend_new_array(8); in empty_partial_array()
131 static void empty_partial_object(zval *zv) in empty_partial_object() argument
133 MAKE_PARTIAL_OBJECT(zv); in empty_partial_object()
134 Z_ARR_P(zv) = zend_new_array(8); in empty_partial_object()
143 static inline bool value_known(zval *zv) { in value_known() argument
144 return !IS_TOP(zv) && !IS_BOT(zv); in value_known()
295 zval zv; in try_replace_op1() local
296 ZVAL_COPY(&zv, value); in try_replace_op1()
297 if (zend_optimizer_update_op1_const(ctx->scdf.op_array, opline, &zv)) { in try_replace_op1()
300 zval_ptr_dtor_nogc(&zv); in try_replace_op1()
308 zval zv; in try_replace_op2() local
309 ZVAL_COPY(&zv, value); in try_replace_op2()
310 if (zend_optimizer_update_op2_const(ctx->scdf.op_array, opline, &zv)) { in try_replace_op2()
313 zval_ptr_dtor_nogc(&zv); in try_replace_op2()
411 zval zv; in ct_eval_isset_isempty() local
418 } else if (ct_eval_bool_cast(&zv, op1) == SUCCESS) { in ct_eval_isset_isempty()
419 ZVAL_BOOL(result, Z_TYPE(zv) == IS_FALSE); in ct_eval_isset_isempty()
863 #define SET_RESULT(op, zv) do { \ argument
865 set_value(scdf, ctx, ssa_op->op##_def, zv); \
875 zval *op1, *op2, zv; /* zv is a temporary to hold result values */ in sccp_visit_instr() local
918 empty_partial_array(&zv); in sccp_visit_instr()
919 SET_RESULT(op1, &zv); in sccp_visit_instr()
920 zval_ptr_dtor_nogc(&zv); in sccp_visit_instr()
937 empty_partial_array(&zv); in sccp_visit_instr()
939 dup_partial_array(&zv, op1); in sccp_visit_instr()
944 SET_RESULT(op1, &zv); in sccp_visit_instr()
945 } else if (ct_eval_del_array_elem(&zv, op2) == SUCCESS) { in sccp_visit_instr()
946 SET_RESULT(op1, &zv); in sccp_visit_instr()
951 zval_ptr_dtor_nogc(&zv); in sccp_visit_instr()
959 dup_partial_array(&zv, op1); in sccp_visit_instr()
961 ZVAL_COPY(&zv, op1); in sccp_visit_instr()
964 if (!op2 && IS_PARTIAL_ARRAY(&zv)) { in sccp_visit_instr()
967 SET_RESULT(op1, &zv); in sccp_visit_instr()
968 } else if (ct_eval_assign_dim(&zv, data, op2) == SUCCESS) { in sccp_visit_instr()
971 MAKE_PARTIAL_ARRAY(&zv); in sccp_visit_instr()
974 SET_RESULT(op1, &zv); in sccp_visit_instr()
980 zval_ptr_dtor_nogc(&zv); in sccp_visit_instr()
1014 empty_partial_object(&zv); in sccp_visit_instr()
1015 SET_RESULT(op1, &zv); in sccp_visit_instr()
1016 zval_ptr_dtor_nogc(&zv); in sccp_visit_instr()
1027 empty_partial_object(&zv); in sccp_visit_instr()
1029 dup_partial_object(&zv, op1); in sccp_visit_instr()
1032 if (ct_eval_del_obj_prop(&zv, op2) == SUCCESS) { in sccp_visit_instr()
1033 SET_RESULT(op1, &zv); in sccp_visit_instr()
1037 zval_ptr_dtor_nogc(&zv); in sccp_visit_instr()
1045 dup_partial_object(&zv, op1); in sccp_visit_instr()
1047 ZVAL_COPY(&zv, op1); in sccp_visit_instr()
1050 if (ct_eval_assign_obj(&zv, data, op2) == SUCCESS) { in sccp_visit_instr()
1052 SET_RESULT(op1, &zv); in sccp_visit_instr()
1058 zval_ptr_dtor_nogc(&zv); in sccp_visit_instr()
1121 empty_partial_array(&zv); in sccp_visit_instr()
1122 SET_RESULT(result, &zv); in sccp_visit_instr()
1123 zval_ptr_dtor_nogc(&zv); in sccp_visit_instr()
1136 empty_partial_array(&zv); in sccp_visit_instr()
1139 ZVAL_COPY_VALUE(&zv, result); in sccp_visit_instr()
1144 SET_RESULT(result, &zv); in sccp_visit_instr()
1145 } else if (ct_eval_del_array_elem(&zv, op2) == SUCCESS) { in sccp_visit_instr()
1146 SET_RESULT(result, &zv); in sccp_visit_instr()
1150 zval_ptr_dtor_nogc(&zv); in sccp_visit_instr()
1159 ZVAL_COPY_VALUE(&zv, result); in sccp_visit_instr()
1162 array_init(&zv); in sccp_visit_instr()
1166 if (!op2 && IS_PARTIAL_ARRAY(&zv)) { in sccp_visit_instr()
1168 SET_RESULT(result, &zv); in sccp_visit_instr()
1169 } else if (ct_eval_add_array_elem(&zv, op1, op2) == SUCCESS) { in sccp_visit_instr()
1171 MAKE_PARTIAL_ARRAY(&zv); in sccp_visit_instr()
1173 SET_RESULT(result, &zv); in sccp_visit_instr()
1178 SET_RESULT(result, &zv); in sccp_visit_instr()
1181 zval_ptr_dtor_nogc(&zv); in sccp_visit_instr()
1199 ZVAL_COPY_VALUE(&zv, result); in sccp_visit_instr()
1202 if (ct_eval_add_array_unpack(&zv, op1) == SUCCESS) { in sccp_visit_instr()
1203 SET_RESULT(result, &zv); in sccp_visit_instr()
1207 zval_ptr_dtor_nogc(&zv); in sccp_visit_instr()
1213 empty_partial_object(&zv); in sccp_visit_instr()
1214 SET_RESULT(result, &zv); in sccp_visit_instr()
1215 zval_ptr_dtor_nogc(&zv); in sccp_visit_instr()
1268 if (ct_eval_binary_op(&zv, opline->opcode, op1, op2) == SUCCESS) { in sccp_visit_instr()
1269 SET_RESULT(result, &zv); in sccp_visit_instr()
1270 zval_ptr_dtor_nogc(&zv); 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()
1288 SET_RESULT(result, &zv); in sccp_visit_instr()
1289 zval_ptr_dtor_nogc(&zv); in sccp_visit_instr()
1302 dup_partial_array(&zv, op1); in sccp_visit_instr()
1303 ct_eval_del_array_elem(&zv, op2); in sccp_visit_instr()
1305 SET_RESULT(op1, &zv); in sccp_visit_instr()
1307 zval_ptr_dtor_nogc(&zv); in sccp_visit_instr()
1319 dup_partial_array(&zv, op1); in sccp_visit_instr()
1321 ZVAL_COPY(&zv, op1); in sccp_visit_instr()
1324 if (ct_eval_assign_dim(&zv, &tmp, op2) == SUCCESS) { in sccp_visit_instr()
1326 SET_RESULT(op1, &zv); in sccp_visit_instr()
1328 zval_ptr_dtor_nogc(&zv); in sccp_visit_instr()
1333 zval_ptr_dtor_nogc(&zv); in sccp_visit_instr()
1347 dup_partial_object(&zv, op1); in sccp_visit_instr()
1348 ct_eval_del_obj_prop(&zv, op2); in sccp_visit_instr()
1350 SET_RESULT(op1, &zv); in sccp_visit_instr()
1352 zval_ptr_dtor_nogc(&zv); in sccp_visit_instr()
1363 dup_partial_object(&zv, op1); in sccp_visit_instr()
1365 if (ct_eval_assign_obj(&zv, &tmp, op2) == SUCCESS) { in sccp_visit_instr()
1367 SET_RESULT(op1, &zv); in sccp_visit_instr()
1369 zval_ptr_dtor_nogc(&zv); in sccp_visit_instr()
1374 zval_ptr_dtor_nogc(&zv); in sccp_visit_instr()
1395 dup_partial_object(&zv, op1); in sccp_visit_instr()
1396 ct_eval_assign_obj(&zv, &tmp2, op2); in sccp_visit_instr()
1404 SET_RESULT(op1, &zv); in sccp_visit_instr()
1405 zval_ptr_dtor_nogc(&zv); 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()
1420 SET_RESULT(result, &zv); in sccp_visit_instr()
1421 zval_ptr_dtor_nogc(&zv); 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()
1433 zval_ptr_dtor_nogc(&zv); in sccp_visit_instr()
1445 if (zend_optimizer_eval_unary_op(&zv, opline->opcode, op1) == SUCCESS) { in sccp_visit_instr()
1446 SET_RESULT(result, &zv); in sccp_visit_instr()
1447 zval_ptr_dtor_nogc(&zv); in sccp_visit_instr()
1458 if (zend_optimizer_eval_cast(&zv, opline->extended_value, op1) == SUCCESS) { in sccp_visit_instr()
1459 SET_RESULT(result, &zv); in sccp_visit_instr()
1460 zval_ptr_dtor_nogc(&zv); in sccp_visit_instr()
1469 if (ct_eval_bool_cast(&zv, op1) == SUCCESS) { in sccp_visit_instr()
1470 SET_RESULT(result, &zv); in sccp_visit_instr()
1471 zval_ptr_dtor_nogc(&zv); in sccp_visit_instr()
1478 if (zend_optimizer_eval_strlen(&zv, op1) == SUCCESS) { in sccp_visit_instr()
1479 SET_RESULT(result, &zv); in sccp_visit_instr()
1480 zval_ptr_dtor_nogc(&zv); in sccp_visit_instr()
1489 ZVAL_NULL(&zv); in sccp_visit_instr()
1490 SET_RESULT(result, &zv); in sccp_visit_instr()
1498 ZVAL_LONG(&zv, zend_hash_num_elements(Z_ARRVAL_P(op1))); in sccp_visit_instr()
1499 SET_RESULT(result, &zv); in sccp_visit_instr()
1500 zval_ptr_dtor_nogc(&zv); in sccp_visit_instr()
1508 if (ct_eval_in_array(&zv, opline->extended_value, op1, op2) == SUCCESS) { in sccp_visit_instr()
1509 SET_RESULT(result, &zv); in sccp_visit_instr()
1510 zval_ptr_dtor_nogc(&zv); in sccp_visit_instr()
1518 if (ct_eval_array_key_exists(&zv, op1, op2) == SUCCESS) { in sccp_visit_instr()
1519 SET_RESULT(result, &zv); in sccp_visit_instr()
1520 zval_ptr_dtor_nogc(&zv); in sccp_visit_instr()
1531 if (ct_eval_fetch_dim(&zv, op1, op2, (opline->opcode != ZEND_FETCH_LIST_R)) == SUCCESS) { in sccp_visit_instr()
1532 SET_RESULT(result, &zv); in sccp_visit_instr()
1533 zval_ptr_dtor_nogc(&zv); in sccp_visit_instr()
1542 if (ct_eval_isset_dim(&zv, opline->extended_value, op1, op2) == SUCCESS) { in sccp_visit_instr()
1543 SET_RESULT(result, &zv); in sccp_visit_instr()
1544 zval_ptr_dtor_nogc(&zv); in sccp_visit_instr()
1555 if (ct_eval_fetch_obj(&zv, op1, op2) == SUCCESS) { in sccp_visit_instr()
1556 SET_RESULT(result, &zv); in sccp_visit_instr()
1557 zval_ptr_dtor_nogc(&zv); in sccp_visit_instr()
1568 if (ct_eval_isset_obj(&zv, opline->extended_value, op1, op2) == SUCCESS) { in sccp_visit_instr()
1569 SET_RESULT(result, &zv); in sccp_visit_instr()
1570 zval_ptr_dtor_nogc(&zv); in sccp_visit_instr()
1585 ZVAL_NULL(&zv); in sccp_visit_instr()
1588 ZVAL_FALSE(&zv); in sccp_visit_instr()
1591 ZVAL_TRUE(&zv); in sccp_visit_instr()
1595 SET_RESULT(result, &zv); in sccp_visit_instr()
1602 if (ct_eval_isset_isempty(&zv, opline->extended_value, op1) == SUCCESS) { in sccp_visit_instr()
1603 SET_RESULT(result, &zv); in sccp_visit_instr()
1604 zval_ptr_dtor_nogc(&zv); in sccp_visit_instr()
1611 ct_eval_type_check(&zv, opline->extended_value, op1); in sccp_visit_instr()
1612 SET_RESULT(result, &zv); in sccp_visit_instr()
1613 zval_ptr_dtor_nogc(&zv); in sccp_visit_instr()
1617 ZVAL_FALSE(&zv); in sccp_visit_instr()
1618 SET_RESULT(result, &zv); in sccp_visit_instr()
1626 if (zend_optimizer_eval_cast(&zv, IS_STRING, op2) == SUCCESS) { in sccp_visit_instr()
1627 SET_RESULT(result, &zv); in sccp_visit_instr()
1628 zval_ptr_dtor_nogc(&zv); in sccp_visit_instr()
1640 if (ct_eval_binary_op(&zv, ZEND_CONCAT, op1, op2) == SUCCESS) { in sccp_visit_instr()
1641 SET_RESULT(result, &zv); in sccp_visit_instr()
1642 zval_ptr_dtor_nogc(&zv); in sccp_visit_instr()
1697 if (ct_eval_func_call(scdf->op_array, &zv, Z_STR_P(name), call->num_args, args) == SUCCESS) { in sccp_visit_instr()
1698 SET_RESULT(result, &zv); in sccp_visit_instr()
1699 zval_ptr_dtor_nogc(&zv); in sccp_visit_instr()
1753 if (ct_eval_func_call_ex(scdf->op_array, &zv, func, num_args, args) == SUCCESS) { in sccp_visit_instr()
1754 SET_RESULT(result, &zv); in sccp_visit_instr()
1755 zval_ptr_dtor_nogc(&zv); in sccp_visit_instr()
1829 zval *op1, zv; in sccp_mark_feasible_successors() local
1847 op1 = value_from_type_and_range(ctx, ssa_op->op1_use, &zv); in sccp_mark_feasible_successors()
1867 if (ct_eval_bool_cast(&zv, op1) == FAILURE) { in sccp_mark_feasible_successors()
1872 s = Z_TYPE(zv) == IS_TRUE; in sccp_mark_feasible_successors()
1879 if (ct_eval_bool_cast(&zv, op1) == FAILURE) { in sccp_mark_feasible_successors()
1884 s = Z_TYPE(zv) == IS_FALSE; in sccp_mark_feasible_successors()
2488 zval *zv = &sccp.values[i]; in sccp_optimize_op_array() local
2490 if (IS_TOP(zv) || IS_BOT(zv)) { in sccp_optimize_op_array()
2502 scp_dump_value(zv); in sccp_optimize_op_array()