Lines Matching refs:val
42 zval val; in zend_optimizer_collect_constant() local
48 ZVAL_COPY(&val, value); in zend_optimizer_collect_constant()
49 zend_hash_add(ctx->constants, Z_STR_P(name), &val); in zend_optimizer_collect_constant()
134 zval *val; in zend_optimizer_get_collected_constant() local
136 if ((val = zend_hash_find(constants, Z_STR_P(name))) != NULL) { in zend_optimizer_get_collected_constant()
137 ZVAL_COPY(value, val); in zend_optimizer_get_collected_constant()
160 static inline void drop_leading_backslash(zval *val) { in drop_leading_backslash() argument
161 if (Z_STRVAL_P(val)[0] == '\\') { in drop_leading_backslash() local
162 zend_string *str = zend_string_init(Z_STRVAL_P(val) + 1, Z_STRLEN_P(val) - 1, 0); in drop_leading_backslash()
163 zval_ptr_dtor_nogc(val); in drop_leading_backslash()
164 ZVAL_STR(val, str); in drop_leading_backslash()
174 #define REQUIRES_STRING(val) do { \ argument
175 if (Z_TYPE_P(val) != IS_STRING) { \
180 #define TO_STRING_NOWARN(val) do { \ argument
181 if (Z_TYPE_P(val) >= IS_ARRAY) { \
184 convert_to_string(val); \
189 zval *val) in zend_optimizer_update_op1_const() argument
198 opline->op1.constant = zend_optimizer_add_literal(op_array, val); in zend_optimizer_update_op1_const()
203 zval_ptr_dtor_nogc(val); in zend_optimizer_update_op1_const()
218 REQUIRES_STRING(val); in zend_optimizer_update_op1_const()
219 drop_leading_backslash(val); in zend_optimizer_update_op1_const()
220 opline->op1.constant = zend_optimizer_add_literal(op_array, val); in zend_optimizer_update_op1_const()
222 zend_optimizer_add_literal_string(op_array, zend_string_tolower(Z_STR_P(val))); in zend_optimizer_update_op1_const()
225 REQUIRES_STRING(val); in zend_optimizer_update_op1_const()
226 drop_leading_backslash(val); in zend_optimizer_update_op1_const()
227 opline->op1.constant = zend_optimizer_add_literal(op_array, val); in zend_optimizer_update_op1_const()
229 zend_optimizer_add_literal_string(op_array, zend_string_tolower(Z_STR_P(val))); in zend_optimizer_update_op1_const()
232 REQUIRES_STRING(val); in zend_optimizer_update_op1_const()
233 drop_leading_backslash(val); in zend_optimizer_update_op1_const()
234 opline->op1.constant = zend_optimizer_add_literal(op_array, val); in zend_optimizer_update_op1_const()
236 zend_optimizer_add_literal_string(op_array, zend_string_tolower(Z_STR_P(val))); in zend_optimizer_update_op1_const()
239 REQUIRES_STRING(val); in zend_optimizer_update_op1_const()
240 drop_leading_backslash(val); in zend_optimizer_update_op1_const()
241 opline->op1.constant = zend_optimizer_add_literal(op_array, val); in zend_optimizer_update_op1_const()
245 zend_optimizer_add_literal_string(op_array, zend_string_tolower(Z_STR_P(val))); in zend_optimizer_update_op1_const()
248 REQUIRES_STRING(val); in zend_optimizer_update_op1_const()
249 drop_leading_backslash(val); in zend_optimizer_update_op1_const()
250 opline->op1.constant = zend_optimizer_add_literal(op_array, val); in zend_optimizer_update_op1_const()
254 zend_optimizer_add_literal_string(op_array, zend_string_tolower(Z_STR_P(val))); in zend_optimizer_update_op1_const()
275 TO_STRING_NOWARN(val); in zend_optimizer_update_op1_const()
276 opline->op1.constant = zend_optimizer_add_literal(op_array, val); in zend_optimizer_update_op1_const()
285 opline->op1.constant = zend_optimizer_add_literal(op_array, val); in zend_optimizer_update_op1_const()
304 if (Z_TYPE_P(val) != IS_STRING && zend_optimizer_eval_cast(&zv, IS_STRING, val) == SUCCESS) { in zend_optimizer_update_op1_const()
305 zval_ptr_dtor_nogc(val); in zend_optimizer_update_op1_const()
306 val = &zv; in zend_optimizer_update_op1_const()
308 opline->op1.constant = zend_optimizer_add_literal(op_array, val); in zend_optimizer_update_op1_const()
309 if (Z_TYPE_P(val) == IS_STRING && Z_STRLEN_P(val) == 0) { in zend_optimizer_update_op1_const()
324 TO_STRING_NOWARN(val); in zend_optimizer_update_op1_const()
330 opline->op1.constant = zend_optimizer_add_literal(op_array, val); in zend_optimizer_update_op1_const()
343 zval *val) in zend_optimizer_update_op2_const() argument
358 REQUIRES_STRING(val); in zend_optimizer_update_op2_const()
359 drop_leading_backslash(val); in zend_optimizer_update_op2_const()
360 opline->op2.constant = zend_optimizer_add_literal(op_array, val); in zend_optimizer_update_op2_const()
361 zend_optimizer_add_literal_string(op_array, zend_string_tolower(Z_STR_P(val))); in zend_optimizer_update_op2_const()
365 REQUIRES_STRING(val); in zend_optimizer_update_op2_const()
366 drop_leading_backslash(val); in zend_optimizer_update_op2_const()
367 opline->op2.constant = zend_optimizer_add_literal(op_array, val); in zend_optimizer_update_op2_const()
368 zend_optimizer_add_literal_string(op_array, zend_string_tolower(Z_STR_P(val))); in zend_optimizer_update_op2_const()
386 REQUIRES_STRING(val); in zend_optimizer_update_op2_const()
387 drop_leading_backslash(val); in zend_optimizer_update_op2_const()
388 opline->op2.constant = zend_optimizer_add_literal(op_array, val); in zend_optimizer_update_op2_const()
389 zend_optimizer_add_literal_string(op_array, zend_string_tolower(Z_STR_P(val))); in zend_optimizer_update_op2_const()
395 REQUIRES_STRING(val); in zend_optimizer_update_op2_const()
396 if (Z_REFCOUNT_P(val) == 1) { in zend_optimizer_update_op2_const()
397 zend_str_tolower(Z_STRVAL_P(val), Z_STRLEN_P(val)); in zend_optimizer_update_op2_const()
399 ZVAL_STR(&tmp, zend_string_tolower(Z_STR_P(val))); in zend_optimizer_update_op2_const()
400 zval_ptr_dtor_nogc(val); in zend_optimizer_update_op2_const()
401 val = &tmp; in zend_optimizer_update_op2_const()
403 opline->op2.constant = zend_optimizer_add_literal(op_array, val); in zend_optimizer_update_op2_const()
407 if (Z_TYPE_P(val) == IS_STRING) { in zend_optimizer_update_op2_const()
408 if (zend_memrchr(Z_STRVAL_P(val), ':', Z_STRLEN_P(val))) { in zend_optimizer_update_op2_const()
412 if (zend_optimizer_classify_function(Z_STR_P(val), opline->extended_value)) { in zend_optimizer_update_op2_const()
419 drop_leading_backslash(val); in zend_optimizer_update_op2_const()
420 opline->op2.constant = zend_optimizer_add_literal(op_array, val); in zend_optimizer_update_op2_const()
421 zend_optimizer_add_literal_string(op_array, zend_string_tolower(Z_STR_P(val))); in zend_optimizer_update_op2_const()
424 opline->op2.constant = zend_optimizer_add_literal(op_array, val); in zend_optimizer_update_op2_const()
428 REQUIRES_STRING(val); in zend_optimizer_update_op2_const()
429 opline->op2.constant = zend_optimizer_add_literal(op_array, val); in zend_optimizer_update_op2_const()
430 zend_optimizer_add_literal_string(op_array, zend_string_tolower(Z_STR_P(val))); in zend_optimizer_update_op2_const()
434 REQUIRES_STRING(val); in zend_optimizer_update_op2_const()
435 opline->op2.constant = zend_optimizer_add_literal(op_array, val); in zend_optimizer_update_op2_const()
436 zend_optimizer_add_literal_string(op_array, zend_string_tolower(Z_STR_P(val))); in zend_optimizer_update_op2_const()
454 TO_STRING_NOWARN(val); in zend_optimizer_update_op2_const()
455 opline->op2.constant = zend_optimizer_add_literal(op_array, val); in zend_optimizer_update_op2_const()
459 TO_STRING_NOWARN(val); in zend_optimizer_update_op2_const()
460 opline->op2.constant = zend_optimizer_add_literal(op_array, val); in zend_optimizer_update_op2_const()
465 TO_STRING_NOWARN(val); in zend_optimizer_update_op2_const()
466 opline->op2.constant = zend_optimizer_add_literal(op_array, val); in zend_optimizer_update_op2_const()
481 if (Z_TYPE_P(val) == IS_STRING) { in zend_optimizer_update_op2_const()
484 if (ZEND_HANDLE_NUMERIC(Z_STR_P(val), index)) { in zend_optimizer_update_op2_const()
487 zend_string_hash_val(Z_STR_P(val)); in zend_optimizer_update_op2_const()
488 zend_optimizer_add_literal(op_array, val); in zend_optimizer_update_op2_const()
493 opline->op2.constant = zend_optimizer_add_literal(op_array, val); in zend_optimizer_update_op2_const()
497 if (Z_TYPE_P(val) == IS_STRING) { in zend_optimizer_update_op2_const()
499 if (ZEND_HANDLE_NUMERIC(Z_STR_P(val), index)) { in zend_optimizer_update_op2_const()
500 zval_ptr_dtor_nogc(val); in zend_optimizer_update_op2_const()
501 ZVAL_LONG(val, index); in zend_optimizer_update_op2_const()
504 opline->op2.constant = zend_optimizer_add_literal(op_array, val); in zend_optimizer_update_op2_const()
511 TO_STRING_NOWARN(val); in zend_optimizer_update_op2_const()
517 opline->op2.constant = zend_optimizer_add_literal(op_array, val); in zend_optimizer_update_op2_const()
532 zval *val) in zend_optimizer_replace_by_const() argument
580 ZVAL_COPY(&v, val); in zend_optimizer_replace_by_const()
592 zval_ptr_dtor_nogc(val); in zend_optimizer_replace_by_const()
617 ZVAL_COPY(&v, val); in zend_optimizer_replace_by_const()
638 zval_ptr_dtor_nogc(val); in zend_optimizer_replace_by_const()
643 if (!ZEND_TYPE_CONTAINS_CODE(ret_info->type, Z_TYPE_P(val)) in zend_optimizer_replace_by_const()
660 return zend_optimizer_update_op1_const(op_array, opline, val); in zend_optimizer_replace_by_const()
665 return zend_optimizer_update_op2_const(op_array, opline, val); in zend_optimizer_replace_by_const()