Lines Matching refs:val

50 	zval val;  in zend_optimizer_collect_constant()  local
56 ZVAL_COPY(&val, value); in zend_optimizer_collect_constant()
57 zend_hash_add(ctx->constants, Z_STR_P(name), &val); in zend_optimizer_collect_constant()
131 zval *val; in zend_optimizer_get_collected_constant() local
133 if ((val = zend_hash_find(constants, Z_STR_P(name))) != NULL) { in zend_optimizer_get_collected_constant()
134 ZVAL_COPY(value, val); in zend_optimizer_get_collected_constant()
157 static inline void drop_leading_backslash(zval *val) { in drop_leading_backslash() argument
158 if (Z_STRVAL_P(val)[0] == '\\') { in drop_leading_backslash() local
159 zend_string *str = zend_string_init(Z_STRVAL_P(val) + 1, Z_STRLEN_P(val) - 1, 0); in drop_leading_backslash()
160 zval_ptr_dtor_nogc(val); in drop_leading_backslash()
161 ZVAL_STR(val, str); in drop_leading_backslash()
171 #define REQUIRES_STRING(val) do { \ argument
172 if (Z_TYPE_P(val) != IS_STRING) { \
177 #define TO_STRING_NOWARN(val) do { \ argument
178 if (Z_TYPE_P(val) >= IS_ARRAY) { \
181 convert_to_string(val); \
186 zval *val) in zend_optimizer_update_op1_const() argument
195 opline->op1.constant = zend_optimizer_add_literal(op_array, val); in zend_optimizer_update_op1_const()
200 zval_ptr_dtor_nogc(val); in zend_optimizer_update_op1_const()
215 REQUIRES_STRING(val); in zend_optimizer_update_op1_const()
216 drop_leading_backslash(val); in zend_optimizer_update_op1_const()
217 opline->op1.constant = zend_optimizer_add_literal(op_array, val); in zend_optimizer_update_op1_const()
219 zend_optimizer_add_literal_string(op_array, zend_string_tolower(Z_STR_P(val))); in zend_optimizer_update_op1_const()
222 REQUIRES_STRING(val); in zend_optimizer_update_op1_const()
223 drop_leading_backslash(val); in zend_optimizer_update_op1_const()
224 opline->op1.constant = zend_optimizer_add_literal(op_array, val); in zend_optimizer_update_op1_const()
226 zend_optimizer_add_literal_string(op_array, zend_string_tolower(Z_STR_P(val))); in zend_optimizer_update_op1_const()
229 REQUIRES_STRING(val); in zend_optimizer_update_op1_const()
230 drop_leading_backslash(val); in zend_optimizer_update_op1_const()
231 opline->op1.constant = zend_optimizer_add_literal(op_array, val); in zend_optimizer_update_op1_const()
233 zend_optimizer_add_literal_string(op_array, zend_string_tolower(Z_STR_P(val))); in zend_optimizer_update_op1_const()
236 REQUIRES_STRING(val); in zend_optimizer_update_op1_const()
237 drop_leading_backslash(val); in zend_optimizer_update_op1_const()
238 opline->op1.constant = zend_optimizer_add_literal(op_array, val); in zend_optimizer_update_op1_const()
242 zend_optimizer_add_literal_string(op_array, zend_string_tolower(Z_STR_P(val))); in zend_optimizer_update_op1_const()
245 REQUIRES_STRING(val); in zend_optimizer_update_op1_const()
246 drop_leading_backslash(val); in zend_optimizer_update_op1_const()
247 opline->op1.constant = zend_optimizer_add_literal(op_array, val); in zend_optimizer_update_op1_const()
251 zend_optimizer_add_literal_string(op_array, zend_string_tolower(Z_STR_P(val))); in zend_optimizer_update_op1_const()
272 TO_STRING_NOWARN(val); in zend_optimizer_update_op1_const()
273 opline->op1.constant = zend_optimizer_add_literal(op_array, val); in zend_optimizer_update_op1_const()
282 opline->op1.constant = zend_optimizer_add_literal(op_array, val); in zend_optimizer_update_op1_const()
286 opline->op1.constant = zend_optimizer_add_literal(op_array, val); in zend_optimizer_update_op1_const()
290 opline->op1.constant = zend_optimizer_add_literal(op_array, val); in zend_optimizer_update_op1_const()
306 if (Z_TYPE_P(val) != IS_STRING && zend_optimizer_eval_cast(&zv, IS_STRING, val) == SUCCESS) { in zend_optimizer_update_op1_const()
307 zval_ptr_dtor_nogc(val); in zend_optimizer_update_op1_const()
308 val = &zv; in zend_optimizer_update_op1_const()
310 opline->op1.constant = zend_optimizer_add_literal(op_array, val); in zend_optimizer_update_op1_const()
311 if (Z_TYPE_P(val) == IS_STRING && Z_STRLEN_P(val) == 0) { in zend_optimizer_update_op1_const()
328 TO_STRING_NOWARN(val); in zend_optimizer_update_op1_const()
334 opline->op1.constant = zend_optimizer_add_literal(op_array, val); in zend_optimizer_update_op1_const()
347 zval *val) in zend_optimizer_update_op2_const() argument
362 REQUIRES_STRING(val); in zend_optimizer_update_op2_const()
363 drop_leading_backslash(val); in zend_optimizer_update_op2_const()
364 opline->op2.constant = zend_optimizer_add_literal(op_array, val); in zend_optimizer_update_op2_const()
365 zend_optimizer_add_literal_string(op_array, zend_string_tolower(Z_STR_P(val))); in zend_optimizer_update_op2_const()
369 REQUIRES_STRING(val); in zend_optimizer_update_op2_const()
370 drop_leading_backslash(val); in zend_optimizer_update_op2_const()
371 opline->op2.constant = zend_optimizer_add_literal(op_array, val); in zend_optimizer_update_op2_const()
372 zend_optimizer_add_literal_string(op_array, zend_string_tolower(Z_STR_P(val))); in zend_optimizer_update_op2_const()
390 REQUIRES_STRING(val); in zend_optimizer_update_op2_const()
391 drop_leading_backslash(val); in zend_optimizer_update_op2_const()
392 opline->op2.constant = zend_optimizer_add_literal(op_array, val); in zend_optimizer_update_op2_const()
393 zend_optimizer_add_literal_string(op_array, zend_string_tolower(Z_STR_P(val))); in zend_optimizer_update_op2_const()
399 REQUIRES_STRING(val); in zend_optimizer_update_op2_const()
400 if (Z_REFCOUNT_P(val) == 1) { in zend_optimizer_update_op2_const()
401 zend_str_tolower(Z_STRVAL_P(val), Z_STRLEN_P(val)); in zend_optimizer_update_op2_const()
403 ZVAL_STR(&tmp, zend_string_tolower(Z_STR_P(val))); in zend_optimizer_update_op2_const()
404 zval_ptr_dtor_nogc(val); in zend_optimizer_update_op2_const()
405 val = &tmp; in zend_optimizer_update_op2_const()
407 opline->op2.constant = zend_optimizer_add_literal(op_array, val); in zend_optimizer_update_op2_const()
411 if (Z_TYPE_P(val) == IS_STRING) { in zend_optimizer_update_op2_const()
412 if (zend_memrchr(Z_STRVAL_P(val), ':', Z_STRLEN_P(val))) { in zend_optimizer_update_op2_const()
416 if (zend_optimizer_classify_function(Z_STR_P(val), opline->extended_value)) { in zend_optimizer_update_op2_const()
423 drop_leading_backslash(val); in zend_optimizer_update_op2_const()
424 opline->op2.constant = zend_optimizer_add_literal(op_array, val); in zend_optimizer_update_op2_const()
425 zend_optimizer_add_literal_string(op_array, zend_string_tolower(Z_STR_P(val))); in zend_optimizer_update_op2_const()
428 opline->op2.constant = zend_optimizer_add_literal(op_array, val); in zend_optimizer_update_op2_const()
432 REQUIRES_STRING(val); in zend_optimizer_update_op2_const()
433 opline->op2.constant = zend_optimizer_add_literal(op_array, val); in zend_optimizer_update_op2_const()
434 zend_optimizer_add_literal_string(op_array, zend_string_tolower(Z_STR_P(val))); in zend_optimizer_update_op2_const()
438 REQUIRES_STRING(val); in zend_optimizer_update_op2_const()
439 opline->op2.constant = zend_optimizer_add_literal(op_array, val); in zend_optimizer_update_op2_const()
440 zend_optimizer_add_literal_string(op_array, zend_string_tolower(Z_STR_P(val))); in zend_optimizer_update_op2_const()
458 TO_STRING_NOWARN(val); in zend_optimizer_update_op2_const()
459 opline->op2.constant = zend_optimizer_add_literal(op_array, val); in zend_optimizer_update_op2_const()
463 TO_STRING_NOWARN(val); in zend_optimizer_update_op2_const()
464 opline->op2.constant = zend_optimizer_add_literal(op_array, val); in zend_optimizer_update_op2_const()
469 TO_STRING_NOWARN(val); in zend_optimizer_update_op2_const()
470 opline->op2.constant = zend_optimizer_add_literal(op_array, val); in zend_optimizer_update_op2_const()
485 if (Z_TYPE_P(val) == IS_STRING) { in zend_optimizer_update_op2_const()
488 if (ZEND_HANDLE_NUMERIC(Z_STR_P(val), index)) { in zend_optimizer_update_op2_const()
491 zend_string_hash_val(Z_STR_P(val)); in zend_optimizer_update_op2_const()
492 zend_optimizer_add_literal(op_array, val); in zend_optimizer_update_op2_const()
497 opline->op2.constant = zend_optimizer_add_literal(op_array, val); in zend_optimizer_update_op2_const()
501 if (Z_TYPE_P(val) == IS_STRING) { in zend_optimizer_update_op2_const()
503 if (ZEND_HANDLE_NUMERIC(Z_STR_P(val), index)) { in zend_optimizer_update_op2_const()
504 zval_ptr_dtor_nogc(val); in zend_optimizer_update_op2_const()
505 ZVAL_LONG(val, index); in zend_optimizer_update_op2_const()
508 opline->op2.constant = zend_optimizer_add_literal(op_array, val); in zend_optimizer_update_op2_const()
515 TO_STRING_NOWARN(val); in zend_optimizer_update_op2_const()
521 opline->op2.constant = zend_optimizer_add_literal(op_array, val); in zend_optimizer_update_op2_const()
536 zval *val) in zend_optimizer_replace_by_const() argument
597 Z_TRY_ADDREF_P(val); in zend_optimizer_replace_by_const()
598 if (!zend_optimizer_update_op1_const(op_array, opline, val)) { in zend_optimizer_replace_by_const()
599 zval_ptr_dtor(val); in zend_optimizer_replace_by_const()
608 zval_ptr_dtor_nogc(val); in zend_optimizer_replace_by_const()
613 if (!ZEND_TYPE_CONTAINS_CODE(ret_info->type, Z_TYPE_P(val)) in zend_optimizer_replace_by_const()
630 return zend_optimizer_update_op1_const(op_array, opline, val); in zend_optimizer_replace_by_const()
635 return zend_optimizer_update_op2_const(op_array, opline, val); in zend_optimizer_replace_by_const()