Lines Matching refs:result

81 static zend_op *zend_emit_op(znode *result, zend_uchar opcode, znode *op1, znode *op2);
82 static zend_bool zend_try_ct_eval_array(zval *result, zend_ast *ast);
133 zend_string *result = zend_strpprintf(0, "%c%s%s:%" PRIu32 "$%" PRIx32,
135 return zend_new_interned_string(result);
139 static zend_bool zend_get_unqualified_name(const zend_string *name, const char **result, size_t *result_len) /* {{{ */
143 *result = ns_separator + 1;
144 *result_len = ZSTR_VAL(name) + ZSTR_LEN(name) - *result;
688 if (opline->result_type == IS_TMP_VAR && opline->result.var == op1->u.op.var) {
703 && opline->result.var == op1->u.op.var) {
720 && opline->result.var == op1->u.op.var) {
815 void *result;
821 result = zend_hash_find_ptr(ht, lcname);
824 return result;
1151 prev_opline_num = &opline->result.opline_num;
1199 opline_num = op_array->opcodes[opline_num].result.opline_num;
1501 static void zend_add_to_list(void *result, void *item) /* {{{ */
1503 void** list = *(void**)result;
1517 *(void**)result = list;
1714 zend_string *result;
1718 result = zend_string_extend(left, len, 0);
1719 ZSTR_VAL(result)[left_len] = '\\';
1720 memcpy(&ZSTR_VAL(result)[left_len + 1], ZSTR_VAL(right), ZSTR_LEN(right));
1721 ZSTR_VAL(result)[len] = '\0';
1724 ZVAL_STR(left_zv, result);
1826 static void zend_adjust_for_fetch_type(zend_op *opline, znode *result, uint32_t type) /* {{{ */
1833 result->op_type = IS_TMP_VAR;
1843 result->op_type = IS_TMP_VAR;
1857 static inline void zend_make_var_result(znode *result, zend_op *opline) /* {{{ */
1860 opline->result.var = get_temporary_variable();
1861 GET_NODE(result, opline->result);
1865 static inline void zend_make_tmp_result(znode *result, zend_op *opline) /* {{{ */
1868 opline->result.var = get_temporary_variable();
1869 GET_NODE(result, opline->result);
1873 static zend_op *zend_emit_op(znode *result, zend_uchar opcode, znode *op1, znode *op2) /* {{{ */
1886 if (result) {
1887 zend_make_var_result(result, opline);
1893 static zend_op *zend_emit_op_tmp(znode *result, zend_uchar opcode, znode *op1, znode *op2) /* {{{ */
1906 if (result) {
1907 zend_make_tmp_result(result, opline);
2016 static inline zend_op *zend_delayed_emit_op(znode *result, zend_uchar opcode, znode *op1, znode *op2) /* {{{ */
2029 if (result) {
2030 zend_make_var_result(result, &tmp_opline);
2063 static void zend_compile_memoized_expr(znode *result, zend_ast *expr) /* {{{ */
2071 zend_compile_expr(result, expr);
2074 if (result->op_type == IS_VAR) {
2075 zend_emit_op(&memoized_result, ZEND_COPY_TMP, result, NULL);
2076 } else if (result->op_type == IS_TMP_VAR) {
2077 zend_emit_op_tmp(&memoized_result, ZEND_COPY_TMP, result, NULL);
2079 if (result->op_type == IS_CONST) {
2080 Z_TRY_ADDREF(result->u.constant);
2082 memoized_result = *result;
2089 *result = *memoized_result;
2090 if (result->op_type == IS_CONST) {
2091 Z_TRY_ADDREF(result->u.constant);
2146 opline->result.var = expr->u.op.var = get_temporary_variable();
2274 static void zend_compile_class_ref(znode *result, zend_ast *name_ast, uint32_t fetch_flags) /* {{{ */
2294 result->op_type = IS_CONST;
2295 ZVAL_STR(&result->u.constant, zend_resolve_class_name(name, ZEND_NAME_FQ));
2298 result->op_type = IS_UNUSED;
2299 result->u.op.num = fetch_type | fetch_flags;
2304 zend_op *opline = zend_emit_op(result, ZEND_FETCH_CLASS, NULL, &name_node);
2312 result->op_type = IS_CONST;
2313 ZVAL_STR(&result->u.constant, zend_resolve_class_name_ast(name_ast));
2319 result->op_type = IS_CONST;
2320 ZVAL_STR(&result->u.constant, zend_resolve_class_name_ast(name_ast));
2323 result->op_type = IS_UNUSED;
2324 result->u.op.num = fetch_type | fetch_flags;
2329 static int zend_try_compile_cv(znode *result, zend_ast *ast) /* {{{ */
2346 result->op_type = IS_CV;
2347 result->u.op.var = lookup_cv(name);
2360 static zend_op *zend_compile_simple_var_no_cv(znode *result, zend_ast *ast, uint32_t type, int delayed) /* {{{ */
2372 opline = zend_delayed_emit_op(result, ZEND_FETCH_R, &name_node, NULL);
2374 opline = zend_emit_op(result, ZEND_FETCH_R, &name_node, NULL);
2385 zend_adjust_for_fetch_type(opline, result, type);
2401 static zend_op *zend_compile_simple_var(znode *result, zend_ast *ast, uint32_t type, int delayed) /* {{{ */
2404 zend_op *opline = zend_emit_op(result, ZEND_FETCH_THIS, NULL, NULL);
2407 result->op_type = IS_TMP_VAR;
2411 } else if (zend_try_compile_cv(result, ast) == FAILURE) {
2412 return zend_compile_simple_var_no_cv(result, ast, type, delayed);
2424 opline->result.var = opline->op1.var;
2426 zend_error_noreturn(E_COMPILE_ERROR, "Cannot use result of built-in function in write context");
2432 zend_op *zend_delayed_compile_var(znode *result, zend_ast *ast, uint32_t type, zend_bool by_ref);
2433 void zend_compile_assign(znode *result, zend_ast *ast);
2445 static zend_op *zend_delayed_compile_dim(znode *result, zend_ast *ast, uint32_t type) /* {{{ */
2476 opline = zend_delayed_emit_op(result, ZEND_FETCH_DIM_R, &var_node, &dim_node);
2477 zend_adjust_for_fetch_type(opline, result, type);
2486 static zend_op *zend_compile_dim(znode *result, zend_ast *ast, uint32_t type) /* {{{ */
2489 zend_delayed_compile_dim(result, ast, type);
2494 static zend_op *zend_delayed_compile_prop(znode *result, zend_ast *ast, uint32_t type) /* {{{ */
2515 opline = zend_delayed_emit_op(result, ZEND_FETCH_OBJ_R, &obj_node, &prop_node);
2521 zend_adjust_for_fetch_type(opline, result, type);
2526 static zend_op *zend_compile_prop(znode *result, zend_ast *ast, uint32_t type, int by_ref) /* {{{ */
2529 zend_op *opline = zend_delayed_compile_prop(result, ast, type);
2537 zend_op *zend_compile_static_prop(znode *result, zend_ast *ast, uint32_t type, int by_ref, int delayed) /* {{{ */
2550 opline = zend_delayed_emit_op(result, ZEND_FETCH_STATIC_PROP_R, &prop_node, NULL);
2552 opline = zend_emit_op(result, ZEND_FETCH_STATIC_PROP_R, &prop_node, NULL);
2573 zend_adjust_for_fetch_type(opline, result, type);
2617 znode *result, zend_ast *ast, znode *expr_node, zend_bool old_style) /* {{{ */
2699 if (result) {
2700 *result = *expr_node;
2736 zend_bool result = zend_string_equals(name1, name2);
2739 return result;
2744 void zend_compile_assign(znode *result, zend_ast *ast) /* {{{ */
2765 zend_emit_op(result, ZEND_ASSIGN, &var_node, &expr_node);
2769 zend_delayed_compile_var(result, var_ast, BP_VAR_W, 0);
2779 zend_delayed_compile_dim(result, var_ast, BP_VAR_W);
2802 zend_delayed_compile_prop(result, var_ast, BP_VAR_W);
2836 zend_compile_list_assign(result, var_ast, &expr_node, var_ast->attr);
2843 void zend_compile_assign_ref(znode *result, zend_ast *ast) /* {{{ */
2866 * to the result of the LHS evaluation.
2876 zend_error_noreturn(E_COMPILE_ERROR, "Cannot use result of built-in function in write context");
2886 if (result != NULL) {
2887 *result = target_node;
2894 if (result != NULL) {
2895 *result = target_node;
2898 opline = zend_emit_op(result, ZEND_ASSIGN_REF, &target_node, &source_node);
2912 void zend_compile_compound_assign(znode *result, zend_ast *ast) /* {{{ */
2930 opline = zend_emit_op(result, ZEND_ASSIGN_OP, &var_node, &expr_node);
2935 zend_delayed_compile_var(result, var_ast, BP_VAR_RW, 0);
2948 zend_delayed_compile_dim(result, var_ast, BP_VAR_RW);
2959 zend_delayed_compile_prop(result, var_ast, BP_VAR_RW);
2997 opline->result.var = (uint32_t)(zend_intptr_t)ZEND_CALL_ARG(NULL, arg_count);
3097 opline->result.var = (uint32_t)(zend_intptr_t)ZEND_CALL_ARG(NULL, arg_num);
3130 void zend_compile_call_common(znode *result, zend_ast *args_ast, zend_function *fbc) /* {{{ */
3147 opline = zend_emit_op(result, zend_get_call_op(opline, fbc), NULL, NULL);
3165 void zend_compile_ns_call(znode *result, znode *name_node, zend_ast *args_ast) /* {{{ */
3172 opline->result.num = zend_alloc_cache_slot();
3174 zend_compile_call_common(result, args_ast, NULL);
3178 void zend_compile_dynamic_call(znode *result, znode *name_node, zend_ast *args_ast) /* {{{ */
3194 opline->result.num = zend_alloc_cache_slots(2);
3202 opline->result.num = zend_alloc_cache_slot();
3208 zend_compile_call_common(result, args_ast, NULL);
3224 int zend_compile_func_strlen(znode *result, zend_ast_list *args) /* {{{ */
3236 result->op_type = IS_CONST;
3237 ZVAL_LONG(&result->u.constant, Z_STRLEN(arg_node.u.constant));
3240 zend_emit_op_tmp(result, ZEND_STRLEN, &arg_node, NULL);
3246 int zend_compile_func_typecheck(znode *result, zend_ast_list *args, uint32_t type) /* {{{ */
3256 opline = zend_emit_op_tmp(result, ZEND_TYPE_CHECK, &arg_node, NULL);
3266 int zend_compile_func_cast(znode *result, zend_ast_list *args, uint32_t type) /* {{{ */
3276 opline = zend_emit_op_tmp(result, ZEND_CAST, &arg_node, NULL);
3282 int zend_compile_func_defined(znode *result, zend_ast_list *args) /* {{{ */
3297 if (zend_try_ct_eval_const(&result->u.constant, name, 0)) {
3299 zval_ptr_dtor(&result->u.constant);
3300 ZVAL_TRUE(&result->u.constant);
3301 result->op_type = IS_CONST;
3305 opline = zend_emit_op_tmp(result, ZEND_DEFINED, NULL, NULL);
3321 int zend_compile_func_chr(znode *result, zend_ast_list *args) /* {{{ */
3330 result->op_type = IS_CONST;
3331 ZVAL_INTERNED_STR(&result->u.constant, ZSTR_CHAR(c));
3339 int zend_compile_func_ord(znode *result, zend_ast_list *args) /* {{{ */
3345 result->op_type = IS_CONST;
3346 ZVAL_LONG(&result->u.constant, (unsigned char)Z_STRVAL_P(zend_ast_get_zval(args->child[0]))[0]);
3389 opline->result.num = zend_alloc_cache_slot();
3414 int zend_compile_func_cufa(znode *result, zend_ast_list *args, zend_string *lcname) /* {{{ */
3447 zend_emit_op(result, ZEND_DO_FCALL, NULL, NULL);
3456 zend_emit_op(result, ZEND_DO_FCALL, NULL, NULL);
3463 int zend_compile_func_cuf(znode *result, zend_ast_list *args, zend_string *lcname) /* {{{ */
3481 opline->result.var = (uint32_t)(zend_intptr_t)ZEND_CALL_ARG(NULL, i);
3483 zend_emit_op(result, ZEND_DO_FCALL, NULL, NULL);
3489 static void zend_compile_assert(znode *result, zend_ast_list *args, zend_string *name, zend_function *fbc) /* {{{ */
3508 opline->result.num = zend_alloc_cache_slot();
3519 zend_compile_call_common(result, (zend_ast*)args, fbc);
3523 SET_NODE(opline->result, result);
3528 result->op_type = IS_CONST;
3529 ZVAL_TRUE(&result->u.constant);
3534 static int zend_compile_func_in_array(znode *result, zend_ast_list *args) /* {{{ */
3612 opline = zend_emit_op_tmp(result, ZEND_IN_ARRAY, &needly, &array);
3619 int zend_compile_func_count(znode *result, zend_ast_list *args, zend_string *lcname) /* {{{ */
3629 opline = zend_emit_op_tmp(result, ZEND_COUNT, &arg_node, NULL);
3636 int zend_compile_func_get_class(znode *result, zend_ast_list *args) /* {{{ */
3639 zend_emit_op_tmp(result, ZEND_GET_CLASS, NULL, NULL);
3648 zend_emit_op_tmp(result, ZEND_GET_CLASS, &arg_node, NULL);
3654 int zend_compile_func_get_called_class(znode *result, zend_ast_list *args) /* {{{ */
3660 zend_emit_op_tmp(result, ZEND_GET_CALLED_CLASS, NULL, NULL);
3665 int zend_compile_func_gettype(znode *result, zend_ast_list *args) /* {{{ */
3674 zend_emit_op_tmp(result, ZEND_GET_TYPE, &arg_node, NULL);
3679 int zend_compile_func_num_args(znode *result, zend_ast_list *args) /* {{{ */
3682 zend_emit_op_tmp(result, ZEND_FUNC_NUM_ARGS, NULL, NULL);
3690 int zend_compile_func_get_args(znode *result, zend_ast_list *args) /* {{{ */
3693 zend_emit_op_tmp(result, ZEND_FUNC_GET_ARGS, NULL, NULL);
3701 int zend_compile_func_array_key_exists(znode *result, zend_ast_list *args) /* {{{ */
3712 zend_emit_op_tmp(result, ZEND_ARRAY_KEY_EXISTS, &needle, &subject);
3717 int zend_compile_func_array_slice(znode *result, zend_ast_list *args) /* {{{ */
3740 zend_emit_op_tmp(result, ZEND_FUNC_GET_ARGS, &first, NULL);
3750 int zend_try_compile_special_func(znode *result, zend_string *lcname, zend_ast_list *args, zend_function *fbc, uint32_t type) /* {{{ */
3765 return zend_compile_func_strlen(result, args);
3767 return zend_compile_func_typecheck(result, args, IS_NULL);
3769 return zend_compile_func_typecheck(result, args, _IS_BOOL);
3774 return zend_compile_func_typecheck(result, args, IS_LONG);
3778 return zend_compile_func_typecheck(result, args, IS_DOUBLE);
3780 return zend_compile_func_typecheck(result, args, IS_STRING);
3782 return zend_compile_func_typecheck(result, args, IS_ARRAY);
3784 return zend_compile_func_typecheck(result, args, IS_OBJECT);
3786 return zend_compile_func_typecheck(result, args, IS_RESOURCE);
3788 return zend_compile_func_cast(result, args, _IS_BOOL);
3790 return zend_compile_func_cast(result, args, IS_LONG);
3794 return zend_compile_func_cast(result, args, IS_DOUBLE);
3796 return zend_compile_func_cast(result, args, IS_STRING);
3798 return zend_compile_func_defined(result, args);
3800 return zend_compile_func_chr(result, args);
3802 return zend_compile_func_ord(result, args);
3804 return zend_compile_func_cufa(result, args, lcname);
3806 return zend_compile_func_cuf(result, args, lcname);
3808 return zend_compile_func_in_array(result, args);
3811 return zend_compile_func_count(result, args, lcname);
3813 return zend_compile_func_get_class(result, args);
3815 return zend_compile_func_get_called_class(result, args);
3817 return zend_compile_func_gettype(result, args);
3819 return zend_compile_func_num_args(result, args);
3821 return zend_compile_func_get_args(result, args);
3823 return zend_compile_func_array_slice(result, args);
3825 return zend_compile_func_array_key_exists(result, args);
3832 void zend_compile_call(znode *result, zend_ast *ast, uint32_t type) /* {{{ */
3841 zend_compile_dynamic_call(result, &name_node, args_ast);
3849 zend_compile_assert(result, zend_ast_get_list(args_ast), Z_STR(name_node.u.constant), NULL);
3851 zend_compile_ns_call(result, &name_node, args_ast);
3868 zend_compile_assert(result, zend_ast_get_list(args_ast), lcname, fbc);
3880 zend_compile_dynamic_call(result, &name_node, args_ast);
3884 if (zend_try_compile_special_func(result, lcname,
3896 opline->result.num = zend_alloc_cache_slot();
3898 zend_compile_call_common(result, args_ast, fbc);
3903 void zend_compile_method_call(znode *result, zend_ast *ast, uint32_t type) /* {{{ */
3931 opline->result.num = zend_alloc_cache_slots(2);
3949 zend_compile_call_common(result, args_ast, fbc);
3959 void zend_compile_static_call(znode *result, zend_ast *ast, uint32_t type) /* {{{ */
3992 opline->result.num = zend_alloc_cache_slots(2);
3995 opline->result.num = zend_alloc_cache_slot();
4032 zend_compile_call_common(result, args_ast, fbc);
4038 void zend_compile_new(znode *result, zend_ast *ast) /* {{{ */
4050 class_node.u.op.var = opline->result.var;
4055 opline = zend_emit_op(result, ZEND_NEW, NULL, NULL);
4071 void zend_compile_clone(znode *result, zend_ast *ast) /* {{{ */
4078 zend_emit_op_tmp(result, ZEND_CLONE, &obj_node, NULL);
4087 znode name_node, result;
4096 } else if (zend_try_compile_cv(&result, var_ast) == SUCCESS) {
4097 zend_op *opline = zend_emit_op(NULL, ZEND_BIND_GLOBAL, &result, &name_node);
4103 zend_op *opline = zend_emit_op(&result, ZEND_FETCH_W, &name_node, NULL);
4112 &result
4208 opline->result.var = loop_var->var_num;
4475 SET_UNUSED(opline->result);
4568 void zend_compile_expr_list(znode *result, zend_ast *ast) /* {{{ */
4573 result->op_type = IS_CONST;
4574 ZVAL_TRUE(&result->u.constant);
4584 zend_do_free(result);
4585 zend_compile_expr(result, expr_ast);
4597 znode result;
4600 zend_compile_expr_list(&result, init_ast);
4601 zend_do_free(&result);
4611 zend_compile_expr_list(&result, loop_ast);
4612 zend_do_free(&result);
4615 zend_compile_expr_list(&result, cond_ast);
4618 zend_emit_cond_jump(ZEND_JMPNZ, &result, opnum_start);
4882 SET_NODE(opline->result, &case_node);
5040 opline->result.var = lookup_cv(var_name);
5094 opline->result.var = CG(context).fast_call_var;
5497 SET_NODE(opline->result, &var_node);
5904 static void zend_begin_func_decl(znode *result, zend_op_array *op_array, zend_ast_decl *decl, zend_bool toplevel) /* {{{ */
5955 opline = zend_emit_op_tmp(result, ZEND_DECLARE_LAMBDA_FUNCTION, NULL, NULL);
5971 void zend_compile_func_decl(znode *result, zend_ast *ast, zend_bool toplevel) /* {{{ */
6013 zend_begin_func_decl(result, op_array, decl, toplevel);
6016 compile_implicit_lexical_binds(&info, result, op_array);
6018 zend_compile_closure_binding(result, op_array, uses_ast);
6377 zend_string *result = zend_strpprintf(0, "class@anonymous%c%s:%" PRIu32 "$%" PRIx32,
6379 return zend_new_interned_string(result);
6581 opline->result.var = get_temporary_variable();
6608 opline->result.opline_num = -1;
7039 static inline zend_bool zend_try_ct_eval_binary_op(zval *result, uint32_t opcode, zval *op1, zval *op2) /* {{{ */
7061 fn(result, op1, op2);
7066 static inline void zend_ct_eval_unary_op(zval *result, uint32_t opcode, zval *op) /* {{{ */
7069 fn(result, op);
7073 static inline zend_bool zend_try_ct_eval_unary_pm(zval *result, zend_ast_kind kind, zval *op) /* {{{ */
7077 return zend_try_ct_eval_binary_op(result, ZEND_MUL, &left, op);
7081 static inline void zend_ct_eval_greater(zval *result, zend_ast_kind kind, zval *op1, zval *op2) /* {{{ */
7085 fn(result, op2, op1);
7089 static zend_bool zend_try_ct_eval_array(zval *result, zend_ast *ast) /* {{{ */
7137 ZVAL_EMPTY_ARRAY(result);
7141 array_init_size(result, list->children);
7158 if (!zend_hash_next_index_insert(Z_ARRVAL_P(result), val)) {
7159 zval_ptr_dtor(result);
7178 zend_hash_index_update(Z_ARRVAL_P(result), Z_LVAL_P(key), value);
7181 zend_symtable_update(Z_ARRVAL_P(result), Z_STR_P(key), value);
7184 zend_hash_index_update(Z_ARRVAL_P(result),
7188 zend_hash_index_update(Z_ARRVAL_P(result), 0, value);
7191 zend_hash_index_update(Z_ARRVAL_P(result), 1, value);
7194 zend_hash_update(Z_ARRVAL_P(result), ZSTR_EMPTY_ALLOC(), value);
7201 if (!zend_hash_next_index_insert(Z_ARRVAL_P(result), value)) {
7203 zval_ptr_dtor(result);
7213 void zend_compile_binary_op(znode *result, zend_ast *ast) /* {{{ */
7234 if (zend_try_ct_eval_binary_op(&result->u.constant, opcode,
7237 result->op_type = IS_CONST;
7249 zend_emit_op_tmp(result, opcode, &right_node, NULL);
7253 zend_emit_op_tmp(result, opcode, &right_node, NULL);
7259 zend_emit_op_tmp(result, opcode, &left_node, NULL);
7263 zend_emit_op_tmp(result, opcode, &left_node, NULL);
7288 zend_emit_op_tmp(result, opcode, &left_node, &right_node);
7295 void zend_compile_greater(znode *result, zend_ast *ast) /* {{{ */
7307 result->op_type = IS_CONST;
7308 zend_ct_eval_greater(&result->u.constant, ast->kind,
7315 zend_emit_op_tmp(result,
7321 void zend_compile_unary_op(znode *result, zend_ast *ast) /* {{{ */
7330 result->op_type = IS_CONST;
7331 zend_ct_eval_unary_op(&result->u.constant, opcode,
7337 zend_emit_op_tmp(result, opcode, &expr_node, NULL);
7341 void zend_compile_unary_pm(znode *result, zend_ast *ast) /* {{{ */
7352 if (zend_try_ct_eval_unary_pm(&result->u.constant, ast->kind, &expr_node.u.constant)) {
7353 result->op_type = IS_CONST;
7361 zend_emit_op_tmp(result, ZEND_MUL, &lefthand_node, &expr_node);
7365 void zend_compile_short_circuiting(znode *result, zend_ast *ast) /* {{{ */
7381 result->op_type = IS_CONST;
7382 ZVAL_BOOL(&result->u.constant, zend_is_true(&left_node.u.constant));
7387 result->op_type = IS_CONST;
7388 ZVAL_BOOL(&result->u.constant, zend_is_true(&right_node.u.constant));
7392 zend_emit_op_tmp(result, ZEND_BOOL, &right_node, NULL);
7405 SET_NODE(opline_jmpz->result, &left_node);
7407 opline_jmpz->result.var = get_temporary_variable();
7411 GET_NODE(result, opline_jmpz->result);
7415 SET_NODE(opline_bool->result, result);
7421 void zend_compile_post_incdec(znode *result, zend_ast *ast) /* {{{ */
7431 zend_make_tmp_result(result, opline);
7435 zend_make_tmp_result(result, opline);
7439 zend_emit_op_tmp(result, ast->kind == ZEND_AST_POST_INC ? ZEND_POST_INC : ZEND_POST_DEC,
7445 void zend_compile_pre_incdec(znode *result, zend_ast *ast) /* {{{ */
7453 zend_op *opline = zend_compile_prop(result, var_ast, BP_VAR_RW, 0);
7456 zend_op *opline = zend_compile_static_prop(result, var_ast, BP_VAR_RW, 0, 0);
7461 zend_emit_op(result, ast->kind == ZEND_AST_PRE_INC ? ZEND_PRE_INC : ZEND_PRE_DEC,
7467 void zend_compile_cast(znode *result, zend_ast *ast) /* {{{ */
7475 opline = zend_emit_op_tmp(result, ZEND_CAST, &expr_node, NULL);
7484 static void zend_compile_shorthand_conditional(znode *result, zend_ast *ast) /* {{{ */
7498 zend_emit_op_tmp(result, ZEND_JMP_SET, &cond_node, NULL);
7503 SET_NODE(opline_qm_assign->result, result);
7509 void zend_compile_conditional(znode *result, zend_ast *ast) /* {{{ */
7537 /* This case is harmless: (a ?: b) ?: c always produces the same result
7544 zend_compile_shorthand_conditional(result, ast);
7554 zend_emit_op_tmp(result, ZEND_QM_ASSIGN, &true_node, NULL);
7563 SET_NODE(opline_qm_assign2->result, result);
7569 void zend_compile_coalesce(znode *result, zend_ast *ast) /* {{{ */
7581 zend_emit_op_tmp(result, ZEND_COALESCE, &expr_node, NULL);
7586 SET_NODE(opline->result, result);
7601 void zend_compile_assign_coalesce(znode *result, zend_ast *ast) /* {{{ */
7628 zend_emit_op_tmp(result, ZEND_COALESCE, &var_node_is, NULL);
7661 SET_NODE(opline->result, result);
7691 void zend_compile_print(znode *result, zend_ast *ast) /* {{{ */
7702 result->op_type = IS_CONST;
7703 ZVAL_LONG(&result->u.constant, 1);
7707 void zend_compile_exit(znode *result, zend_ast *ast) /* {{{ */
7719 result->op_type = IS_CONST;
7720 ZVAL_BOOL(&result->u.constant, 1);
7724 void zend_compile_yield(znode *result, zend_ast *ast) /* {{{ */
7750 opline = zend_emit_op(result, ZEND_YIELD, value_node_ptr, key_node_ptr);
7758 void zend_compile_yield_from(znode *result, zend_ast *ast) /* {{{ */
7771 zend_emit_op_tmp(result, ZEND_YIELD_FROM, &expr_node, NULL);
7775 void zend_compile_instanceof(znode *result, zend_ast *ast) /* {{{ */
7786 result->op_type = IS_CONST;
7787 ZVAL_FALSE(&result->u.constant);
7794 opline = zend_emit_op_tmp(result, ZEND_INSTANCEOF, &obj_node, NULL);
7807 void zend_compile_include_or_eval(znode *result, zend_ast *ast) /* {{{ */
7816 opline = zend_emit_op(result, ZEND_INCLUDE_OR_EVAL, &expr_node, NULL);
7823 void zend_compile_isset_or_empty(znode *result, zend_ast *ast) /* {{{ */
7836 zend_compile_expr(result, not_ast);
7840 "Cannot use isset() on the result of an expression "
7848 opline = zend_emit_op(result, ZEND_ISSET_ISEMPTY_THIS, NULL, NULL);
7851 opline = zend_emit_op(result, ZEND_ISSET_ISEMPTY_CV, &var_node, NULL);
7853 opline = zend_compile_simple_var_no_cv(result, var_ast, BP_VAR_IS, 0);
7858 opline = zend_compile_dim(result, var_ast, BP_VAR_IS);
7862 opline = zend_compile_prop(result, var_ast, BP_VAR_IS, 0);
7866 opline = zend_compile_static_prop(result, var_ast, BP_VAR_IS, 0, 0);
7872 result->op_type = opline->result_type = IS_TMP_VAR;
7879 void zend_compile_silence(znode *result, zend_ast *ast) /* {{{ */
7889 zend_compile_simple_var_no_cv(result, expr_ast, BP_VAR_R, 0 );
7891 zend_compile_expr(result, expr_ast);
7898 void zend_compile_shell_exec(znode *result, zend_ast *ast) /* {{{ */
7910 zend_compile_expr(result, call_ast);
7916 void zend_compile_array(znode *result, zend_ast *ast) /* {{{ */
7923 if (zend_try_ct_eval_array(&result->u.constant, ast)) {
7924 result->op_type = IS_CONST;
7947 opline = zend_emit_op_tmp(result, ZEND_INIT_ARRAY, NULL, NULL);
7950 SET_NODE(opline->result, result);
7972 opline = zend_emit_op_tmp(result, ZEND_INIT_ARRAY, &value_node, key_node_ptr);
7977 SET_NODE(opline->result, result);
7995 void zend_compile_const(znode *result, zend_ast *ast) /* {{{ */
8016 result->op_type = IS_CONST;
8017 ZVAL_LONG(&result->u.constant, Z_LVAL_P(zend_ast_get_zval(last->child[0])));
8023 if (zend_try_ct_eval_const(&result->u.constant, resolved_name, is_fully_qualified)) {
8024 result->op_type = IS_CONST;
8029 opline = zend_emit_op_tmp(result, ZEND_FETCH_CONSTANT, NULL, NULL);
8050 void zend_compile_class_const(znode *result, zend_ast *ast) /* {{{ */
8068 if (const_ast->kind == ZEND_AST_ZVAL && zend_try_ct_eval_class_const(&result->u.constant, resolved_name, zend_ast_get_str(const_ast))) {
8069 result->op_type = IS_CONST;
8080 opline = zend_emit_op_tmp(result, ZEND_FETCH_CLASS_CONSTANT, NULL, &const_node);
8088 void zend_compile_class_name(znode *result, zend_ast *ast) /* {{{ */
8093 if (zend_try_compile_const_expr_resolve_class_name(&result->u.constant, class_ast)) {
8094 result->op_type = IS_CONST;
8098 opline = zend_emit_op_tmp(result, ZEND_FETCH_CLASS_NAME, NULL, NULL);
8103 static zend_op *zend_compile_rope_add_ex(zend_op *opline, znode *result, uint32_t num, znode *elem_node) /* {{{ */
8106 result->op_type = IS_TMP_VAR;
8107 result->u.op.var = -1;
8111 SET_NODE(opline->op1, result);
8114 SET_NODE(opline->result, result);
8120 static zend_op *zend_compile_rope_add(znode *result, uint32_t num, znode *elem_node) /* {{{ */
8125 result->op_type = IS_TMP_VAR;
8126 result->u.op.var = -1;
8130 SET_NODE(opline->op1, result);
8133 SET_NODE(opline->result, result);
8139 static void zend_compile_encaps_list(znode *result, zend_ast *ast) /* {{{ */
8182 zend_compile_rope_add_ex(opline, result, j++, &last_const_node);
8185 opline = zend_compile_rope_add(result, j++, &elem_node);
8190 result->op_type = IS_CONST;
8192 ZVAL_COPY_VALUE(&result->u.constant, &last_const_node.u.constant);
8194 ZVAL_EMPTY_STRING(&result->u.constant);
8201 opline = zend_compile_rope_add_ex(opline, result, j++, &last_const_node);
8206 GET_NODE(result, opline->op2);
8214 opline->result.var = get_temporary_variable();
8216 GET_NODE(result, opline->result);
8224 opline->result.var = get_temporary_variable();
8226 GET_NODE(result, opline->result);
8232 opline->result.var = get_temporary_variable();
8234 GET_NODE(result, opline->result);
8247 opline->result.var == (uint32_t)-1) {
8249 opline->result.var = var;
8251 opline->result.var == (uint32_t)-1) {
8252 opline->result.var = var;
8259 void zend_compile_magic_const(znode *result, zend_ast *ast) /* {{{ */
8263 if (zend_try_ct_eval_magic_const(&result->u.constant, ast)) {
8264 result->op_type = IS_CONST;
8272 opline = zend_emit_op_tmp(result, ZEND_FETCH_CLASS_NAME, NULL, NULL);
8361 zval result;
8367 if (zend_try_ct_eval_const(&result, resolved_name, is_fully_qualified)) {
8370 *ast_ptr = zend_ast_create_zval(&result);
8422 void zend_const_expr_to_zval(zval *result, zend_ast *ast) /* {{{ */
8428 ZVAL_COPY_VALUE(result, zend_ast_get_zval(ast));
8430 ZVAL_AST(result, zend_ast_copy(ast));
8576 znode result;
8577 zend_compile_expr(&result, ast);
8578 zend_do_free(&result);
8588 void zend_compile_expr(znode *result, zend_ast *ast) /* {{{ */
8594 zend_compile_memoized_expr(result, ast);
8600 ZVAL_COPY(&result->u.constant, zend_ast_get_zval(ast));
8601 result->op_type = IS_CONST;
8604 *result = *zend_ast_get_znode(ast);
8613 zend_compile_var(result, ast, BP_VAR_R, 0);
8616 zend_compile_assign(result, ast);
8619 zend_compile_assign_ref(result, ast);
8622 zend_compile_new(result, ast);
8625 zend_compile_clone(result, ast);
8628 zend_compile_compound_assign(result, ast);
8631 zend_compile_binary_op(result, ast);
8635 zend_compile_greater(result, ast);
8638 zend_compile_unary_op(result, ast);
8642 zend_compile_unary_pm(result, ast);
8646 zend_compile_short_circuiting(result, ast);
8650 zend_compile_post_incdec(result, ast);
8654 zend_compile_pre_incdec(result, ast);
8657 zend_compile_cast(result, ast);
8660 zend_compile_conditional(result, ast);
8663 zend_compile_coalesce(result, ast);
8666 zend_compile_assign_coalesce(result, ast);
8669 zend_compile_print(result, ast);
8672 zend_compile_exit(result, ast);
8675 zend_compile_yield(result, ast);
8678 zend_compile_yield_from(result, ast);
8681 zend_compile_instanceof(result, ast);
8684 zend_compile_include_or_eval(result, ast);
8688 zend_compile_isset_or_empty(result, ast);
8691 zend_compile_silence(result, ast);
8694 zend_compile_shell_exec(result, ast);
8697 zend_compile_array(result, ast);
8700 zend_compile_const(result, ast);
8703 zend_compile_class_const(result, ast);
8706 zend_compile_class_name(result, ast);
8709 zend_compile_encaps_list(result, ast);
8712 zend_compile_magic_const(result, ast);
8716 zend_compile_func_decl(result, ast, 0);
8724 zend_op *zend_compile_var(znode *result, zend_ast *ast, uint32_t type, int by_ref) /* {{{ */
8730 return zend_compile_simple_var(result, ast, type, 0);
8732 return zend_compile_dim(result, ast, type);
8734 return zend_compile_prop(result, ast, type, by_ref);
8736 return zend_compile_static_prop(result, ast, type, by_ref, 0);
8738 zend_compile_call(result, ast, type);
8741 zend_compile_method_call(result, ast, type);
8744 zend_compile_static_call(result, ast, type);
8747 *result = *zend_ast_get_znode(ast);
8755 zend_compile_expr(result, ast);
8761 zend_op *zend_delayed_compile_var(znode *result, zend_ast *ast, uint32_t type, zend_bool by_ref) /* {{{ */
8765 return zend_compile_simple_var(result, ast, type, 1);
8767 return zend_delayed_compile_dim(result, ast, type);
8770 zend_op *opline = zend_delayed_compile_prop(result, ast, type);
8777 return zend_compile_static_prop(result, ast, type, by_ref, 1);
8779 return zend_compile_var(result, ast, type, 0);
8787 zval result;
8801 if (!zend_try_ct_eval_binary_op(&result, ast->attr,
8815 zend_ct_eval_greater(&result, ast->kind,
8830 ZVAL_BOOL(&result, ast->kind == ZEND_AST_OR);
8840 ZVAL_BOOL(&result, child0_is_true || child1_is_true);
8842 ZVAL_BOOL(&result, child0_is_true && child1_is_true);
8852 zend_ct_eval_unary_op(&result, ast->attr, zend_ast_get_zval(ast->child[0]));
8861 if (!zend_try_ct_eval_unary_pm(&result, ast->kind, zend_ast_get_zval(ast->child[0]))) {
8946 ZVAL_COPY(&result, el);
8953 ZVAL_COPY(&result, el);
8972 ZVAL_INTERNED_STR(&result, ZSTR_CHAR(c));
8974 ZVAL_NULL(&result);
8981 if (!zend_try_ct_eval_array(&result, ast)) {
8986 if (!zend_try_ct_eval_magic_const(&result, ast)) {
8997 if (!zend_try_ct_eval_const(&result, resolved_name, is_fully_qualified)) {
9023 if (!zend_try_ct_eval_class_const(&result, resolved_name, zend_ast_get_str(name_ast))) {
9034 if (!zend_try_compile_const_expr_resolve_class_name(&result, class_ast)) {
9044 *ast_ptr = zend_ast_create_zval(&result);