Lines Matching refs:opline

739 		zend_op *opline = &CG(active_op_array)->opcodes[CG(active_op_array)->last-1];  in zend_do_free()  local
741 while (opline->opcode == ZEND_END_SILENCE || in zend_do_free()
742 opline->opcode == ZEND_OP_DATA) { in zend_do_free()
743 opline--; in zend_do_free()
746 if (opline->result_type == IS_TMP_VAR && opline->result.var == op1->u.op.var) { in zend_do_free()
747 switch (opline->opcode) { in zend_do_free()
759 opline->opcode -= 2; in zend_do_free()
760 SET_UNUSED(opline->result); in zend_do_free()
776 SET_UNUSED(opline->result); in zend_do_free()
783 zend_op *opline = &CG(active_op_array)->opcodes[CG(active_op_array)->last-1]; in zend_do_free() local
784 while (opline->opcode == ZEND_END_SILENCE || in zend_do_free()
785 opline->opcode == ZEND_EXT_FCALL_END || in zend_do_free()
786 opline->opcode == ZEND_OP_DATA) { in zend_do_free()
787 opline--; in zend_do_free()
789 if (opline->result_type == IS_VAR in zend_do_free()
790 && opline->result.var == op1->u.op.var) { in zend_do_free()
791 if (opline->opcode == ZEND_FETCH_THIS) { in zend_do_free()
792 opline->opcode = ZEND_NOP; in zend_do_free()
794 if (!ZEND_OP_IS_FRAMELESS_ICALL(opline->opcode)) { in zend_do_free()
795 SET_UNUSED(opline->result); in zend_do_free()
804 while (opline >= CG(active_op_array)->opcodes) { in zend_do_free()
805 if ((opline->opcode == ZEND_FETCH_LIST_R || in zend_do_free()
806 opline->opcode == ZEND_FETCH_LIST_W) && in zend_do_free()
807 opline->op1_type == IS_VAR && in zend_do_free()
808 opline->op1.var == op1->u.op.var) { in zend_do_free()
812 if (opline->result_type == IS_VAR in zend_do_free()
813 && opline->result.var == op1->u.op.var) { in zend_do_free()
814 if (opline->opcode == ZEND_NEW) { in zend_do_free()
819 opline--; in zend_do_free()
1876 zend_op *opline; in zend_do_extended_stmt() local
1882 opline = get_next_op(); in zend_do_extended_stmt()
1884 opline->opcode = ZEND_EXT_STMT; in zend_do_extended_stmt()
1890 zend_op *opline; in zend_do_extended_fcall_begin() local
1896 opline = get_next_op(); in zend_do_extended_fcall_begin()
1898 opline->opcode = ZEND_EXT_FCALL_BEGIN; in zend_do_extended_fcall_begin()
1904 zend_op *opline; in zend_do_extended_fcall_end() local
1910 opline = get_next_op(); in zend_do_extended_fcall_end()
1912 opline->opcode = ZEND_EXT_FCALL_END; in zend_do_extended_fcall_end()
2182 static void zend_adjust_for_fetch_type(zend_op *opline, znode *result, uint32_t type) /* {{{ */ in zend_adjust_for_fetch_type() argument
2184 uint_fast8_t factor = (opline->opcode == ZEND_FETCH_STATIC_PROP_R) ? 1 : 3; in zend_adjust_for_fetch_type()
2188 opline->result_type = IS_TMP_VAR; in zend_adjust_for_fetch_type()
2192 opline->opcode += 1 * factor; in zend_adjust_for_fetch_type()
2195 opline->opcode += 2 * factor; in zend_adjust_for_fetch_type()
2198 opline->result_type = IS_TMP_VAR; in zend_adjust_for_fetch_type()
2200 opline->opcode += 3 * factor; in zend_adjust_for_fetch_type()
2203 opline->opcode += 4 * factor; in zend_adjust_for_fetch_type()
2206 opline->opcode += 5 * factor; in zend_adjust_for_fetch_type()
2213 static inline void zend_make_var_result(znode *result, zend_op *opline) /* {{{ */ in zend_make_var_result() argument
2215 opline->result_type = IS_VAR; in zend_make_var_result()
2216 opline->result.var = get_temporary_variable(); in zend_make_var_result()
2217 GET_NODE(result, opline->result); in zend_make_var_result()
2221 static inline void zend_make_tmp_result(znode *result, zend_op *opline) /* {{{ */ in zend_make_tmp_result() argument
2223 opline->result_type = IS_TMP_VAR; in zend_make_tmp_result()
2224 opline->result.var = get_temporary_variable(); in zend_make_tmp_result()
2225 GET_NODE(result, opline->result); in zend_make_tmp_result()
2231 zend_op *opline = get_next_op(); in zend_emit_op() local
2232 opline->opcode = opcode; in zend_emit_op()
2235 SET_NODE(opline->op1, op1); in zend_emit_op()
2239 SET_NODE(opline->op2, op2); in zend_emit_op()
2243 zend_make_var_result(result, opline); in zend_emit_op()
2245 return opline; in zend_emit_op()
2251 zend_op *opline = get_next_op(); in zend_emit_op_tmp() local
2252 opline->opcode = opcode; in zend_emit_op_tmp()
2255 SET_NODE(opline->op1, op1); in zend_emit_op_tmp()
2259 SET_NODE(opline->op2, op2); in zend_emit_op_tmp()
2263 zend_make_tmp_result(result, opline); in zend_emit_op_tmp()
2266 return opline; in zend_emit_op_tmp()
2272 zend_op *opline; in zend_emit_tick() local
2279 opline = get_next_op(); in zend_emit_tick()
2281 opline->opcode = ZEND_TICKS; in zend_emit_tick()
2282 opline->extended_value = FC(declarables).ticks; in zend_emit_tick()
2295 zend_op *opline = zend_emit_op(NULL, ZEND_JMP, NULL, NULL); in zend_emit_jump() local
2296 opline->op1.opline_num = opnum_target; in zend_emit_jump()
2301 ZEND_API bool zend_is_smart_branch(const zend_op *opline) /* {{{ */ in zend_is_smart_branch() argument
2303 switch (opline->opcode) { in zend_is_smart_branch()
2332 zend_op *opline; in zend_emit_cond_jump() local
2335 opline = CG(active_op_array)->opcodes + opnum - 1; in zend_emit_cond_jump()
2336 if (opline->result_type == IS_TMP_VAR in zend_emit_cond_jump()
2337 && opline->result.var == cond->u.op.var in zend_emit_cond_jump()
2338 && zend_is_smart_branch(opline)) { in zend_emit_cond_jump()
2340 opline->result_type = IS_TMP_VAR | IS_SMART_BRANCH_JMPZ; in zend_emit_cond_jump()
2343 opline->result_type = IS_TMP_VAR | IS_SMART_BRANCH_JMPNZ; in zend_emit_cond_jump()
2347 opline = zend_emit_op(NULL, opcode, cond, NULL); in zend_emit_cond_jump()
2348 opline->op2.opline_num = opnum_target; in zend_emit_cond_jump()
2355 zend_op *opline = &CG(active_op_array)->opcodes[opnum_jump]; in zend_update_jump_target() local
2356 switch (opline->opcode) { in zend_update_jump_target()
2358 opline->op1.opline_num = opnum_target; in zend_update_jump_target()
2369 opline->op2.opline_num = opnum_target; in zend_update_jump_target()
2412 zend_op *opline = NULL, *oplines = zend_stack_base(&CG(delayed_oplines_stack)); in zend_delayed_compile_end() local
2418 opline = get_next_op(); in zend_delayed_compile_end()
2419 memcpy(opline, &oplines[i], sizeof(zend_op)); in zend_delayed_compile_end()
2421 opline = CG(active_op_array)->opcodes + oplines[i].extended_value; in zend_delayed_compile_end()
2426 return opline; in zend_delayed_compile_end()
2497 zend_op *opline = &CG(active_op_array)->opcodes[opnum]; in zend_short_circuiting_commit() local
2498 opline->op2.opline_num = get_next_op_number(); in zend_short_circuiting_commit()
2499 SET_NODE(opline->result, result); in zend_short_circuiting_commit()
2500 opline->extended_value |= in zend_short_circuiting_commit()
2511 zend_op *opline = zend_emit_op(NULL, ZEND_JMP_NULL, obj_node, NULL); in zend_emit_jmp_null() local
2512 if (opline->op1_type == IS_CONST) { in zend_emit_jmp_null()
2513 Z_TRY_ADDREF_P(CT_CONSTANT(opline->op1)); in zend_emit_jmp_null()
2516 opline->extended_value |= ZEND_JMP_NULL_BP_VAR_IS; in zend_emit_jmp_null()
2589 zend_op *opline; in zend_emit_return_type_check() local
2640 opline = zend_emit_op(NULL, ZEND_VERIFY_RETURN_TYPE, expr, NULL); in zend_emit_return_type_check()
2642 opline->result_type = expr->op_type = IS_TMP_VAR; in zend_emit_return_type_check()
2643 opline->result.var = expr->u.op.var = get_temporary_variable(); in zend_emit_return_type_check()
2646 opline->op2.num = zend_alloc_cache_slots(zend_type_get_num_classes(return_info->type)); in zend_emit_return_type_check()
2750 static inline void zend_handle_numeric_dim(zend_op *opline, znode *dim_node) /* {{{ */ in zend_handle_numeric_dim() argument
2760 ZEND_ASSERT(opline->op2.constant + 1 == c); in zend_handle_numeric_dim()
2761 ZVAL_LONG(CT_CONSTANT(opline->op2), index); in zend_handle_numeric_dim()
2762 Z_EXTRA_P(CT_CONSTANT(opline->op2)) = ZEND_EXTRA_VALUE; in zend_handle_numeric_dim()
2769 static inline void zend_set_class_name_op1(zend_op *opline, znode *class_node) /* {{{ */ in zend_set_class_name_op1() argument
2772 opline->op1_type = IS_CONST; in zend_set_class_name_op1()
2773 opline->op1.constant = zend_add_class_name_literal( in zend_set_class_name_op1()
2776 SET_NODE(opline->op1, class_node); in zend_set_class_name_op1()
2811 zend_op *opline = zend_emit_op(result, ZEND_FETCH_CLASS, NULL, &name_node); in zend_compile_class_ref() local
2812 opline->op1.num = ZEND_FETCH_CLASS_DEFAULT | fetch_flags; in zend_compile_class_ref()
2871 zend_op *opline; in zend_compile_simple_var_no_cv() local
2879 opline = zend_delayed_emit_op(result, ZEND_FETCH_R, &name_node, NULL); in zend_compile_simple_var_no_cv()
2881 opline = zend_emit_op(result, ZEND_FETCH_R, &name_node, NULL); in zend_compile_simple_var_no_cv()
2887 opline->extended_value = ZEND_FETCH_GLOBAL; in zend_compile_simple_var_no_cv()
2889 opline->extended_value = ZEND_FETCH_LOCAL; in zend_compile_simple_var_no_cv()
2892 zend_adjust_for_fetch_type(opline, result, type); in zend_compile_simple_var_no_cv()
2893 return opline; in zend_compile_simple_var_no_cv()
2946 zend_op *opline = zend_emit_op(result, ZEND_FETCH_THIS, NULL, NULL); in zend_compile_simple_var() local
2948 opline->result_type = IS_TMP_VAR; in zend_compile_simple_var()
2952 return opline; in zend_compile_simple_var()
2954 zend_op *opline = zend_emit_op(result, ZEND_FETCH_GLOBALS, NULL, NULL); in zend_compile_simple_var() local
2956 opline->result_type = IS_TMP_VAR; in zend_compile_simple_var()
2959 return opline; in zend_compile_simple_var()
2975 zend_op *opline = zend_emit_op(NULL, ZEND_SEPARATE, node, NULL); in zend_separate_if_call_and_write() local
2976 opline->result_type = IS_VAR; in zend_separate_if_call_and_write()
2977 opline->result.var = opline->op1.var; in zend_separate_if_call_and_write()
3002 zend_op *opline; in zend_delayed_compile_dim() local
3016 opline = zend_delayed_emit_op(result, ZEND_FETCH_R, &dim_node, NULL); in zend_delayed_compile_dim()
3017 opline->extended_value = ZEND_FETCH_GLOBAL; in zend_delayed_compile_dim()
3018 zend_adjust_for_fetch_type(opline, result, type); in zend_delayed_compile_dim()
3019 return opline; in zend_delayed_compile_dim()
3022 opline = zend_delayed_compile_var(&var_node, var_ast, type, 0); in zend_delayed_compile_dim()
3023 if (opline) { in zend_delayed_compile_dim()
3024 …if (type == BP_VAR_W && (opline->opcode == ZEND_FETCH_STATIC_PROP_W || opline->opcode == ZEND_FETC… in zend_delayed_compile_dim()
3025 opline->extended_value |= ZEND_FETCH_DIM_WRITE; in zend_delayed_compile_dim()
3026 } else if (opline->opcode == ZEND_FETCH_DIM_W in zend_delayed_compile_dim()
3027 || opline->opcode == ZEND_FETCH_DIM_RW in zend_delayed_compile_dim()
3028 || opline->opcode == ZEND_FETCH_DIM_FUNC_ARG in zend_delayed_compile_dim()
3029 || opline->opcode == ZEND_FETCH_DIM_UNSET) { in zend_delayed_compile_dim()
3030 opline->extended_value = ZEND_FETCH_DIM_DIM; in zend_delayed_compile_dim()
3049 opline = zend_delayed_emit_op(result, ZEND_FETCH_DIM_R, &var_node, &dim_node); in zend_delayed_compile_dim()
3050 zend_adjust_for_fetch_type(opline, result, type); in zend_delayed_compile_dim()
3052 opline->extended_value = ZEND_FETCH_DIM_REF; in zend_delayed_compile_dim()
3056 zend_handle_numeric_dim(opline, &dim_node); in zend_delayed_compile_dim()
3058 return opline; in zend_delayed_compile_dim()
3075 zend_op *opline; in zend_delayed_compile_prop() local
3090 opline = zend_delayed_compile_var(&obj_node, obj_ast, type, 0); in zend_delayed_compile_prop()
3091 if (opline && (opline->opcode == ZEND_FETCH_DIM_W in zend_delayed_compile_prop()
3092 || opline->opcode == ZEND_FETCH_DIM_RW in zend_delayed_compile_prop()
3093 || opline->opcode == ZEND_FETCH_DIM_FUNC_ARG in zend_delayed_compile_prop()
3094 || opline->opcode == ZEND_FETCH_DIM_UNSET)) { in zend_delayed_compile_prop()
3095 opline->extended_value = ZEND_FETCH_DIM_OBJ; in zend_delayed_compile_prop()
3102 zend_op *opline = NULL, *oplines = zend_stack_base(&CG(delayed_oplines_stack)); in zend_delayed_compile_prop() local
3117 opline = get_next_op(); in zend_delayed_compile_prop()
3118 memcpy(opline, &oplines[i], sizeof(zend_op)); in zend_delayed_compile_prop()
3120 oplines[i].extended_value = opline - CG(active_op_array)->opcodes; in zend_delayed_compile_prop()
3130 opline = zend_delayed_emit_op(result, ZEND_FETCH_OBJ_R, &obj_node, &prop_node); in zend_delayed_compile_prop()
3131 if (opline->op2_type == IS_CONST) { in zend_delayed_compile_prop()
3132 convert_to_string(CT_CONSTANT(opline->op2)); in zend_delayed_compile_prop()
3133 zend_string_hash_val(Z_STR_P(CT_CONSTANT(opline->op2))); in zend_delayed_compile_prop()
3134 opline->extended_value = zend_alloc_cache_slots(3); in zend_delayed_compile_prop()
3137 zend_adjust_for_fetch_type(opline, result, type); in zend_delayed_compile_prop()
3139 return opline; in zend_delayed_compile_prop()
3146 zend_op *opline = zend_delayed_compile_prop(result, ast, type); in zend_compile_prop() local
3148 opline->extended_value |= ZEND_FETCH_REF; in zend_compile_prop()
3160 zend_op *opline; in zend_compile_static_prop() local
3168 opline = zend_delayed_emit_op(result, ZEND_FETCH_STATIC_PROP_R, &prop_node, NULL); in zend_compile_static_prop()
3170 opline = zend_emit_op(result, ZEND_FETCH_STATIC_PROP_R, &prop_node, NULL); in zend_compile_static_prop()
3172 if (opline->op1_type == IS_CONST) { in zend_compile_static_prop()
3173 convert_to_string(CT_CONSTANT(opline->op1)); in zend_compile_static_prop()
3174 opline->extended_value = zend_alloc_cache_slots(3); in zend_compile_static_prop()
3177 opline->op2_type = IS_CONST; in zend_compile_static_prop()
3178 opline->op2.constant = zend_add_class_name_literal( in zend_compile_static_prop()
3180 if (opline->op1_type != IS_CONST) { in zend_compile_static_prop()
3181 opline->extended_value = zend_alloc_cache_slot(); in zend_compile_static_prop()
3184 SET_NODE(opline->op2, &class_node); in zend_compile_static_prop()
3188 opline->extended_value |= ZEND_FETCH_REF; in zend_compile_static_prop()
3191 zend_adjust_for_fetch_type(opline, result, type); in zend_compile_static_prop()
3192 return opline; in zend_compile_static_prop()
3261 zend_op *opline; in zend_compile_list_assign() local
3304 opline = zend_emit_op(&fetch_result, in zend_compile_list_assign()
3308 zend_handle_numeric_dim(opline, &dim_node); in zend_compile_list_assign()
3405 zend_op *opline; in zend_compile_assign() local
3429 opline = zend_delayed_compile_end(offset); in zend_compile_assign()
3430 opline->opcode = ZEND_ASSIGN_STATIC_PROP; in zend_compile_assign()
3431 opline->result_type = IS_TMP_VAR; in zend_compile_assign()
3441 opline = zend_delayed_compile_end(offset); in zend_compile_assign()
3442 opline->opcode = ZEND_ASSIGN_DIM; in zend_compile_assign()
3443 opline->result_type = IS_TMP_VAR; in zend_compile_assign()
3446 opline = zend_emit_op_data(&expr_node); in zend_compile_assign()
3454 opline = zend_delayed_compile_end(offset); in zend_compile_assign()
3455 opline->opcode = ZEND_ASSIGN_OBJ; in zend_compile_assign()
3456 opline->result_type = IS_TMP_VAR; in zend_compile_assign()
3503 zend_op *opline; in zend_compile_assign_ref() local
3534 opline = zend_delayed_compile_end(offset); in zend_compile_assign_ref()
3542 if (opline && opline->opcode == ZEND_FETCH_OBJ_W) { in zend_compile_assign_ref()
3543 opline->opcode = ZEND_ASSIGN_OBJ_REF; in zend_compile_assign_ref()
3544 opline->extended_value &= ~ZEND_FETCH_REF; in zend_compile_assign_ref()
3545 opline->extended_value |= flags; in zend_compile_assign_ref()
3548 } else if (opline && opline->opcode == ZEND_FETCH_STATIC_PROP_W) { in zend_compile_assign_ref()
3549 opline->opcode = ZEND_ASSIGN_STATIC_PROP_REF; in zend_compile_assign_ref()
3550 opline->extended_value &= ~ZEND_FETCH_REF; in zend_compile_assign_ref()
3551 opline->extended_value |= flags; in zend_compile_assign_ref()
3555 opline = zend_emit_op(result, ZEND_ASSIGN_REF, &target_node, &source_node); in zend_compile_assign_ref()
3556 opline->extended_value = flags; in zend_compile_assign_ref()
3578 zend_op *opline; in zend_compile_compound_assign() local
3591 opline = zend_emit_op_tmp(result, ZEND_ASSIGN_OP, &var_node, &expr_node); in zend_compile_compound_assign()
3592 opline->extended_value = opcode; in zend_compile_compound_assign()
3599 opline = zend_delayed_compile_end(offset); in zend_compile_compound_assign()
3600 cache_slot = opline->extended_value; in zend_compile_compound_assign()
3601 opline->opcode = ZEND_ASSIGN_STATIC_PROP_OP; in zend_compile_compound_assign()
3602 opline->extended_value = opcode; in zend_compile_compound_assign()
3603 opline->result_type = IS_TMP_VAR; in zend_compile_compound_assign()
3606 opline = zend_emit_op_data(&expr_node); in zend_compile_compound_assign()
3607 opline->extended_value = cache_slot; in zend_compile_compound_assign()
3614 opline = zend_delayed_compile_end(offset); in zend_compile_compound_assign()
3615 opline->opcode = ZEND_ASSIGN_DIM_OP; in zend_compile_compound_assign()
3616 opline->extended_value = opcode; in zend_compile_compound_assign()
3617 opline->result_type = IS_TMP_VAR; in zend_compile_compound_assign()
3628 opline = zend_delayed_compile_end(offset); in zend_compile_compound_assign()
3629 cache_slot = opline->extended_value; in zend_compile_compound_assign()
3630 opline->opcode = ZEND_ASSIGN_OBJ_OP; in zend_compile_compound_assign()
3631 opline->extended_value = opcode; in zend_compile_compound_assign()
3632 opline->result_type = IS_TMP_VAR; in zend_compile_compound_assign()
3635 opline = zend_emit_op_data(&expr_node); in zend_compile_compound_assign()
3636 opline->extended_value = cache_slot; in zend_compile_compound_assign()
3688 zend_op *opline; in zend_compile_args() local
3701 opline = zend_emit_op(NULL, ZEND_SEND_UNPACK, &arg_node, NULL); in zend_compile_args()
3702 opline->op2.num = arg_count; in zend_compile_args()
3703 opline->result.var = EX_NUM_TO_VAR(arg_count - 1); in zend_compile_args()
3800 opline = zend_emit_op(NULL, ZEND_CHECK_FUNC_ARG, NULL, NULL); in zend_compile_args()
3802 opline->op2_type = IS_CONST; in zend_compile_args()
3804 opline->op2.constant = zend_add_literal_string(&arg_name); in zend_compile_args()
3805 opline->result.num = zend_alloc_cache_slots(2); in zend_compile_args()
3807 opline->op2.num = arg_num; in zend_compile_args()
3848 opline = zend_emit_op(NULL, opcode, &arg_node, NULL); in zend_compile_args()
3850 opline->op2_type = IS_CONST; in zend_compile_args()
3852 opline->op2.constant = zend_add_literal_string(&arg_name); in zend_compile_args()
3853 opline->result.num = zend_alloc_cache_slots(2); in zend_compile_args()
3855 opline->op2.opline_num = arg_num; in zend_compile_args()
3856 opline->result.var = EX_NUM_TO_VAR(arg_num - 1); in zend_compile_args()
3897 zend_op *opline; in zend_compile_call_common() local
3901 opline = &CG(active_op_array)->opcodes[opnum_init]; in zend_compile_call_common()
3902 opline->extended_value = 0; in zend_compile_call_common()
3904 if (opline->opcode == ZEND_NEW) { in zend_compile_call_common()
3908 if (opline->opcode == ZEND_INIT_FCALL) { in zend_compile_call_common()
3909 opline->op1.num = zend_vm_calc_used_stack(0, fbc); in zend_compile_call_common()
3921 opline = &CG(active_op_array)->opcodes[opnum_init]; in zend_compile_call_common()
3922 opline->extended_value = arg_count; in zend_compile_call_common()
3924 if (opline->opcode == ZEND_INIT_FCALL) { in zend_compile_call_common()
3925 opline->op1.num = zend_vm_calc_used_stack(arg_count, fbc); in zend_compile_call_common()
3928 opline = zend_emit_op(result, zend_get_call_op(opline, fbc), NULL, NULL); in zend_compile_call_common()
3930 opline->extended_value = ZEND_FCALL_MAY_HAVE_EXTRA_NAMED_PARAMS; in zend_compile_call_common()
3932 opline->lineno = lineno; in zend_compile_call_common()
3959 zend_op *opline = get_next_op(); in zend_compile_dynamic_call() local
3961 opline->opcode = ZEND_INIT_STATIC_METHOD_CALL; in zend_compile_dynamic_call()
3962 opline->op1_type = IS_CONST; in zend_compile_dynamic_call()
3963 opline->op1.constant = zend_add_class_name_literal(class); in zend_compile_dynamic_call()
3964 opline->op2_type = IS_CONST; in zend_compile_dynamic_call()
3965 opline->op2.constant = zend_add_func_name_literal(method); in zend_compile_dynamic_call()
3967 opline->result.num = zend_alloc_cache_slots(2); in zend_compile_dynamic_call()
3970 zend_op *opline = get_next_op(); in zend_compile_dynamic_call() local
3972 opline->opcode = ZEND_INIT_FCALL_BY_NAME; in zend_compile_dynamic_call()
3973 opline->op2_type = IS_CONST; in zend_compile_dynamic_call()
3974 opline->op2.constant = zend_add_func_name_literal(str); in zend_compile_dynamic_call()
3975 opline->result.num = zend_alloc_cache_slot(); in zend_compile_dynamic_call()
4021 zend_op *opline; in zend_compile_func_typecheck() local
4028 opline = zend_emit_op_tmp(result, ZEND_TYPE_CHECK, &arg_node, NULL); in zend_compile_func_typecheck()
4030 opline->extended_value = (1 << type); in zend_compile_func_typecheck()
4032 opline->extended_value = (1 << IS_FALSE) | (1 << IS_TRUE); in zend_compile_func_typecheck()
4041 zend_op *opline; in zend_compile_func_is_scalar() local
4048 opline = zend_emit_op_tmp(result, ZEND_TYPE_CHECK, &arg_node, NULL); in zend_compile_func_is_scalar()
4049opline->extended_value = (1 << IS_FALSE | 1 << IS_TRUE | 1 << IS_DOUBLE | 1 << IS_LONG | 1 << IS_S… in zend_compile_func_is_scalar()
4056 zend_op *opline; in zend_compile_func_cast() local
4064 opline = zend_emit_op_tmp(result, ZEND_BOOL, &arg_node, NULL); in zend_compile_func_cast()
4066 opline = zend_emit_op_tmp(result, ZEND_CAST, &arg_node, NULL); in zend_compile_func_cast()
4067 opline->extended_value = type; in zend_compile_func_cast()
4076 zend_op *opline; in zend_compile_func_defined() local
4096 opline = zend_emit_op_tmp(result, ZEND_DEFINED, NULL, NULL); in zend_compile_func_defined()
4097 opline->op1_type = IS_CONST; in zend_compile_func_defined()
4098 LITERAL_STR(opline->op1, name); in zend_compile_func_defined()
4099 opline->extended_value = zend_alloc_cache_slot(); in zend_compile_func_defined()
4170 zend_op *opline; in zend_try_compile_ct_bound_init_user_func() local
4187 opline = zend_emit_op(NULL, ZEND_INIT_FCALL, NULL, NULL); in zend_try_compile_ct_bound_init_user_func()
4188 opline->extended_value = num_args; in zend_try_compile_ct_bound_init_user_func()
4189 opline->op1.num = zend_vm_calc_used_stack(num_args, fbc); in zend_try_compile_ct_bound_init_user_func()
4190 opline->op2_type = IS_CONST; in zend_try_compile_ct_bound_init_user_func()
4191 LITERAL_STR(opline->op2, lcname); in zend_try_compile_ct_bound_init_user_func()
4192 opline->result.num = zend_alloc_cache_slot(); in zend_try_compile_ct_bound_init_user_func()
4200 zend_op *opline; in zend_compile_init_user_func() local
4209 opline = zend_emit_op(NULL, ZEND_INIT_USER_CALL, NULL, &name_node); in zend_compile_init_user_func()
4210 opline->op1_type = IS_CONST; in zend_compile_init_user_func()
4211 LITERAL_STR(opline->op1, zend_string_copy(orig_func_name)); in zend_compile_init_user_func()
4212 opline->extended_value = num_args; in zend_compile_init_user_func()
4220 zend_op *opline; in zend_compile_func_cufa() local
4245 zend_op *opline; in zend_compile_func_cufa() local
4250 opline = zend_emit_op(NULL, ZEND_SEND_ARRAY, &arg_node, &len_node); in zend_compile_func_cufa()
4251 opline->extended_value = Z_LVAL_P(zv); in zend_compile_func_cufa()
4262 opline = zend_emit_op(result, ZEND_DO_FCALL, NULL, NULL); in zend_compile_func_cufa()
4263 opline->extended_value = ZEND_FCALL_MAY_HAVE_EXTRA_NAMED_PARAMS; in zend_compile_func_cufa()
4282 zend_op *opline; in zend_compile_func_cuf() local
4286 opline = zend_emit_op(NULL, ZEND_SEND_USER, &arg_node, NULL); in zend_compile_func_cuf()
4287 opline->op2.num = i; in zend_compile_func_cuf()
4288 opline->result.var = EX_NUM_TO_VAR(i - 1); in zend_compile_func_cuf()
4300 zend_op *opline; in zend_compile_assert() local
4309 opline = zend_emit_op(NULL, ZEND_INIT_FCALL, NULL, &name_node); in zend_compile_assert()
4311 opline = zend_emit_op(NULL, ZEND_INIT_NS_FCALL_BY_NAME, NULL, NULL); in zend_compile_assert()
4312 opline->op2_type = IS_CONST; in zend_compile_assert()
4313 opline->op2.constant = zend_add_ns_func_name_literal(name); in zend_compile_assert()
4315 opline->result.num = zend_alloc_cache_slot(); in zend_compile_assert()
4333 opline = &CG(active_op_array)->opcodes[check_op_number]; in zend_compile_assert()
4334 opline->op2.opline_num = get_next_op_number(); in zend_compile_assert()
4335 SET_NODE(opline->result, result); in zend_compile_assert()
4350 zend_op *opline; in zend_compile_func_in_array() local
4424 opline = zend_emit_op_tmp(result, ZEND_IN_ARRAY, &needly, &array); in zend_compile_func_in_array()
4425 opline->extended_value = strict; in zend_compile_func_in_array()
4434 zend_op *opline; in zend_compile_func_count() local
4441 opline = zend_emit_op_tmp(result, ZEND_COUNT, &arg_node, NULL); in zend_compile_func_count()
4442 opline->extended_value = zend_string_equals_literal(lcname, "sizeof"); in zend_compile_func_count()
4635 zend_op *opline = zend_emit_op_tmp(result, opcode, NULL, NULL); in zend_compile_frameless_icall_ex() local
4636 opline->extended_value = offset; in zend_compile_frameless_icall_ex()
4638 SET_NODE(opline->op1, &arg_zvs[0]); in zend_compile_frameless_icall_ex()
4641 SET_NODE(opline->op2, &arg_zvs[1]); in zend_compile_frameless_icall_ex()
4689 zend_op *opline = get_next_op(); in zend_compile_ns_call() local
4690 opline->opcode = ZEND_INIT_NS_FCALL_BY_NAME; in zend_compile_ns_call()
4691 opline->op2_type = IS_CONST; in zend_compile_ns_call()
4692 opline->op2.constant = name_constants; in zend_compile_ns_call()
4693 opline->result.num = zend_alloc_cache_slot(); in zend_compile_ns_call()
4840 zend_op *opline; in zend_compile_call() local
4874 opline = zend_emit_op(NULL, ZEND_INIT_FCALL, NULL, &name_node); in zend_compile_call()
4875 opline->result.num = zend_alloc_cache_slot(); in zend_compile_call()
4880 Z_EXTRA_P(CT_CONSTANT(opline->op2)) = fbc_bucket - CG(function_table)->arData; in zend_compile_call()
4895 zend_op *opline; in zend_compile_method_call() local
4919 opline = zend_emit_op(NULL, ZEND_INIT_METHOD_CALL, &obj_node, NULL); in zend_compile_method_call()
4926 opline->op2_type = IS_CONST; in zend_compile_method_call()
4927 opline->op2.constant = zend_add_func_name_literal( in zend_compile_method_call()
4929 opline->result.num = zend_alloc_cache_slots(2); in zend_compile_method_call()
4931 SET_NODE(opline->op2, &method_node); in zend_compile_method_call()
4935 if (opline->op1_type == IS_UNUSED && opline->op2_type == IS_CONST && in zend_compile_method_call()
4937 zend_string *lcname = Z_STR_P(CT_CONSTANT(opline->op2) + 1); in zend_compile_method_call()
4987 zend_op *opline; in zend_compile_static_call() local
5006 opline = get_next_op(); in zend_compile_static_call()
5007 opline->opcode = ZEND_INIT_STATIC_METHOD_CALL; in zend_compile_static_call()
5009 zend_set_class_name_op1(opline, &class_node); in zend_compile_static_call()
5012 opline->op2_type = IS_CONST; in zend_compile_static_call()
5013 opline->op2.constant = zend_add_func_name_literal( in zend_compile_static_call()
5015 opline->result.num = zend_alloc_cache_slots(2); in zend_compile_static_call()
5017 if (opline->op1_type == IS_CONST) { in zend_compile_static_call()
5018 opline->result.num = zend_alloc_cache_slot(); in zend_compile_static_call()
5020 SET_NODE(opline->op2, &method_node); in zend_compile_static_call()
5024 if (opline->op2_type == IS_CONST) { in zend_compile_static_call()
5026 if (opline->op1_type == IS_CONST) { in zend_compile_static_call()
5027 zend_string *lcname = Z_STR_P(CT_CONSTANT(opline->op1) + 1); in zend_compile_static_call()
5037 } else if (opline->op1_type == IS_UNUSED in zend_compile_static_call()
5038 && (opline->op1.num & ZEND_FETCH_CLASS_MASK) == ZEND_FETCH_CLASS_SELF in zend_compile_static_call()
5043 zend_string *lcname = Z_STR_P(CT_CONSTANT(opline->op2) + 1); in zend_compile_static_call()
5060 zend_op *opline; in zend_compile_new() local
5069 opline = zend_emit_op(result, ZEND_NEW, NULL, NULL); in zend_compile_new()
5072 opline->op1_type = IS_CONST; in zend_compile_new()
5073 opline->op1.constant = zend_add_class_name_literal( in zend_compile_new()
5075 opline->op2.num = zend_alloc_cache_slot(); in zend_compile_new()
5077 SET_NODE(opline->op1, &class_node); in zend_compile_new()
5112 zend_op *opline = zend_emit_op(NULL, ZEND_BIND_GLOBAL, &result, &name_node); in zend_compile_global_var() local
5113 opline->extended_value = zend_alloc_cache_slot(); in zend_compile_global_var()
5118 zend_op *opline = zend_emit_op(&result, ZEND_FETCH_W, &name_node, NULL); in zend_compile_global_var() local
5119 opline->extended_value = ZEND_FETCH_GLOBAL_LOCK; in zend_compile_global_var()
5135 zend_op *opline; in zend_compile_static_var_common() local
5149 opline = zend_emit_op(NULL, ZEND_BIND_STATIC, NULL, NULL); in zend_compile_static_var_common()
5150 opline->op1_type = IS_CV; in zend_compile_static_var_common()
5151 opline->op1.var = lookup_cv(var_name); in zend_compile_static_var_common()
5152opline->extended_value = (uint32_t)((char*)value - (char*)CG(active_op_array)->static_variables->a… in zend_compile_static_var_common()
5186 zend_op *opline; in zend_compile_static_var() local
5193 opline = zend_emit_op(NULL, ZEND_BIND_INIT_STATIC_OR_JMP, NULL, NULL); in zend_compile_static_var()
5194 opline->op1_type = IS_CV; in zend_compile_static_var()
5195 opline->op1.var = lookup_cv(var_name); in zend_compile_static_var()
5196 opline->extended_value = placeholder_offset; in zend_compile_static_var()
5201 opline = zend_emit_op(NULL, ZEND_BIND_STATIC, NULL, &expr); in zend_compile_static_var()
5202 opline->op1_type = IS_CV; in zend_compile_static_var()
5203 opline->op1.var = lookup_cv(var_name); in zend_compile_static_var()
5204 opline->extended_value = placeholder_offset | ZEND_BIND_REF; in zend_compile_static_var()
5215 zend_op *opline; in zend_compile_unset() local
5229 opline = zend_emit_op(NULL, ZEND_UNSET_VAR, &var_node, NULL); in zend_compile_unset()
5230 opline->extended_value = ZEND_FETCH_GLOBAL; in zend_compile_unset()
5239 opline = zend_emit_op(NULL, ZEND_UNSET_CV, &var_node, NULL); in zend_compile_unset()
5241 opline = zend_compile_simple_var_no_cv(NULL, var_ast, BP_VAR_UNSET, 0); in zend_compile_unset()
5242 opline->opcode = ZEND_UNSET_VAR; in zend_compile_unset()
5246 opline = zend_compile_dim(NULL, var_ast, BP_VAR_UNSET, /* by_ref */ false); in zend_compile_unset()
5247 opline->opcode = ZEND_UNSET_DIM; in zend_compile_unset()
5251 opline = zend_compile_prop(NULL, var_ast, BP_VAR_UNSET, 0); in zend_compile_unset()
5252 opline->opcode = ZEND_UNSET_OBJ; in zend_compile_unset()
5255 opline = zend_compile_static_prop(NULL, var_ast, BP_VAR_UNSET, 0, 0); in zend_compile_unset()
5256 opline->opcode = ZEND_UNSET_STATIC_PROP; in zend_compile_unset()
5274 zend_op *opline = get_next_op(); in zend_handle_loops_and_finally_ex() local
5276 opline->opcode = ZEND_FAST_CALL; in zend_handle_loops_and_finally_ex()
5277 opline->result_type = IS_TMP_VAR; in zend_handle_loops_and_finally_ex()
5278 opline->result.var = loop_var->var_num; in zend_handle_loops_and_finally_ex()
5280 SET_NODE(opline->op2, return_value); in zend_handle_loops_and_finally_ex()
5282 opline->op1.num = loop_var->try_catch_offset; in zend_handle_loops_and_finally_ex()
5284 zend_op *opline = get_next_op(); in zend_handle_loops_and_finally_ex() local
5285 opline->opcode = ZEND_DISCARD_EXCEPTION; in zend_handle_loops_and_finally_ex()
5286 opline->op1_type = IS_TMP_VAR; in zend_handle_loops_and_finally_ex()
5287 opline->op1.var = loop_var->var_num; in zend_handle_loops_and_finally_ex()
5297 zend_op *opline; in zend_handle_loops_and_finally_ex() local
5300 opline = get_next_op(); in zend_handle_loops_and_finally_ex()
5301 opline->opcode = loop_var->opcode; in zend_handle_loops_and_finally_ex()
5302 opline->op1_type = loop_var->var_type; in zend_handle_loops_and_finally_ex()
5303 opline->op1.var = loop_var->var_num; in zend_handle_loops_and_finally_ex()
5304 opline->extended_value = ZEND_FREE_ON_RETURN; in zend_handle_loops_and_finally_ex()
5357 zend_op *opline; in zend_compile_return() local
5396 opline = zend_emit_op(NULL, by_ref ? ZEND_RETURN_BY_REF : ZEND_RETURN, in zend_compile_return()
5401 opline->extended_value = ZEND_RETURNS_FUNCTION; in zend_compile_return()
5403 opline->extended_value = ZEND_RETURNS_VALUE; in zend_compile_return()
5411 zend_op *opline; in zend_compile_echo() local
5417 opline = zend_emit_op(NULL, ZEND_ECHO, &expr_node, NULL); in zend_compile_echo()
5418 opline->extended_value = 0; in zend_compile_echo()
5429 zend_op *opline = zend_emit_op(NULL, ZEND_THROW, &expr_node, NULL); in zend_compile_throw() local
5432 opline->extended_value = ZEND_THROW_IS_EXPR; in zend_compile_throw()
5443 zend_op *opline; in zend_compile_break_continue() local
5510 opline = zend_emit_op(NULL, ast->kind == ZEND_AST_BREAK ? ZEND_BRK : ZEND_CONT, NULL, NULL); in zend_compile_break_continue()
5511 opline->op1.num = CG(context).current_brk_cont; in zend_compile_break_continue()
5512 opline->op2.num = depth; in zend_compile_break_continue()
5516 void zend_resolve_goto_label(zend_op_array *op_array, zend_op *opline) /* {{{ */ in zend_resolve_goto_label() argument
5519 int current, remove_oplines = opline->op1.num; in zend_resolve_goto_label()
5521 uint32_t opnum = opline - op_array->opcodes; in zend_resolve_goto_label()
5523 label = CT_CONSTANT_EX(op_array, opline->op2.constant); in zend_resolve_goto_label()
5529 CG(zend_lineno) = opline->lineno; in zend_resolve_goto_label()
5536 current = opline->extended_value; in zend_resolve_goto_label()
5541 CG(zend_lineno) = opline->lineno; in zend_resolve_goto_label()
5561 opline->opcode = ZEND_JMP; in zend_resolve_goto_label()
5562 SET_UNUSED(opline->op1); in zend_resolve_goto_label()
5563 SET_UNUSED(opline->op2); in zend_resolve_goto_label()
5564 SET_UNUSED(opline->result); in zend_resolve_goto_label()
5565 opline->op1.opline_num = dest->opline_num; in zend_resolve_goto_label()
5566 opline->extended_value = 0; in zend_resolve_goto_label()
5570 opline--; in zend_resolve_goto_label()
5571 MAKE_NOP(opline); in zend_resolve_goto_label()
5572 ZEND_VM_SET_OPCODE_HANDLER(opline); in zend_resolve_goto_label()
5581 zend_op *opline; in zend_compile_goto() local
5588 opline = zend_emit_op(NULL, ZEND_GOTO, NULL, &label_node); in zend_compile_goto()
5589 opline->op1.num = get_next_op_number() - opnum_start - 1; in zend_compile_goto()
5590 opline->extended_value = CG(context).current_brk_cont; in zend_compile_goto()
5725 zend_op *opline; in zend_compile_foreach() local
5756 opline = zend_emit_op(&reset_node, by_ref ? ZEND_FE_RESET_RW : ZEND_FE_RESET_R, &expr_node, NULL); in zend_compile_foreach()
5761 opline = zend_emit_op(NULL, by_ref ? ZEND_FE_FETCH_RW : ZEND_FE_FETCH_R, &reset_node, NULL); in zend_compile_foreach()
5767 SET_NODE(opline->op2, &value_node); in zend_compile_foreach()
5769 opline->op2_type = IS_VAR; in zend_compile_foreach()
5770 opline->op2.var = get_temporary_variable(); in zend_compile_foreach()
5771 GET_NODE(&value_node, opline->op2); in zend_compile_foreach()
5782 opline = &CG(active_op_array)->opcodes[opnum_fetch]; in zend_compile_foreach()
5783 zend_make_tmp_result(&key_node, opline); in zend_compile_foreach()
5795 opline = &CG(active_op_array)->opcodes[opnum_reset]; in zend_compile_foreach()
5796 opline->op2.opline_num = get_next_op_number(); in zend_compile_foreach()
5798 opline = &CG(active_op_array)->opcodes[opnum_fetch]; in zend_compile_foreach()
5799 opline->extended_value = get_next_op_number(); in zend_compile_foreach()
5803 opline = zend_emit_op(NULL, ZEND_FE_FREE, &reset_node, NULL); in zend_compile_foreach()
5924 zend_op *opline; in zend_compile_switch() local
5945 opline = zend_emit_op(NULL, in zend_compile_switch()
5948 if (opline->op1_type == IS_CONST) { in zend_compile_switch()
5949 Z_TRY_ADDREF_P(CT_CONSTANT(opline->op1)); in zend_compile_switch()
5951 opnum_switch = opline - CG(active_op_array)->opcodes; in zend_compile_switch()
5979 opline = zend_emit_op(NULL, in zend_compile_switch()
5982 SET_NODE(opline->result, &case_node); in zend_compile_switch()
5983 if (opline->op1_type == IS_CONST) { in zend_compile_switch()
5984 Z_TRY_ADDREF_P(CT_CONSTANT(opline->op1)); in zend_compile_switch()
6019 opline = &CG(active_op_array)->opcodes[opnum_switch]; in zend_compile_switch()
6020 opline->extended_value = get_next_op_number(); in zend_compile_switch()
6031 opline = &CG(active_op_array)->opcodes[opnum_switch]; in zend_compile_switch()
6032 opline->extended_value = get_next_op_number(); in zend_compile_switch()
6039 opline = zend_emit_op(NULL, ZEND_FREE, &expr_node, NULL); in zend_compile_switch()
6040 opline->extended_value = ZEND_FREE_SWITCH; in zend_compile_switch()
6134 zend_op *opline = zend_emit_op(NULL, ZEND_MATCH, &expr_node, &jumptable_op); in zend_compile_match() local
6135 if (opline->op1_type == IS_CONST) { in zend_compile_match()
6136 Z_TRY_ADDREF_P(CT_CONSTANT(opline->op1)); in zend_compile_match()
6138 opnum_match = opline - CG(active_op_array)->opcodes; in zend_compile_match()
6157 zend_op *opline = zend_emit_op(NULL, opcode, &expr_node, &cond_node); in zend_compile_match() local
6158 SET_NODE(opline->result, &case_node); in zend_compile_match()
6159 if (opline->op1_type == IS_CONST) { in zend_compile_match()
6160 Z_TRY_ADDREF_P(CT_CONSTANT(opline->op1)); in zend_compile_match()
6187 zend_op *opline = &CG(active_op_array)->opcodes[opnum_match]; in zend_compile_match() local
6188 opline->extended_value = get_next_op_number(); in zend_compile_match()
6191 zend_op *opline = zend_emit_op(NULL, ZEND_MATCH_ERROR, &expr_node, NULL); in zend_compile_match() local
6192 if (opline->op1_type == IS_CONST) { in zend_compile_match()
6193 Z_TRY_ADDREF_P(CT_CONSTANT(opline->op1)); in zend_compile_match()
6197 opline->extended_value = ZEND_THROW_IS_EXPR; in zend_compile_match()
6237 zend_op *opline = &CG(active_op_array)->opcodes[opnum_match]; in zend_compile_match() local
6238 opline->extended_value = get_next_op_number(); in zend_compile_match()
6267 zend_op *opline = zend_emit_op(NULL, ZEND_FREE, &expr_node, NULL); in zend_compile_match() local
6268 opline->extended_value = ZEND_FREE_SWITCH; in zend_compile_match()
6286 zend_op *opline; in zend_compile_try() local
6358 opline = get_next_op(); in zend_compile_try()
6359 opline->opcode = ZEND_CATCH; in zend_compile_try()
6360 opline->op1_type = IS_CONST; in zend_compile_try()
6361 opline->op1.constant = zend_add_class_name_literal( in zend_compile_try()
6363 opline->extended_value = zend_alloc_cache_slot(); in zend_compile_try()
6369 opline->result_type = var_name ? IS_CV : IS_UNUSED; in zend_compile_try()
6370 opline->result.var = var_name ? lookup_cv(var_name) : -1; in zend_compile_try()
6373 opline->extended_value |= ZEND_LAST_CATCH; in zend_compile_try()
6378 opline = &CG(active_op_array)->opcodes[opnum_catch]; in zend_compile_try()
6379 opline->op2.opline_num = get_next_op_number(); in zend_compile_try()
6396 opline = &CG(active_op_array)->opcodes[opnum_catch]; in zend_compile_try()
6398 opline->op2.opline_num = get_next_op_number(); in zend_compile_try()
6421 opline = zend_emit_op(NULL, ZEND_FAST_CALL, NULL, NULL); in zend_compile_try()
6422 opline->op1.num = try_catch_offset; in zend_compile_try()
6423 opline->result_type = IS_TMP_VAR; in zend_compile_try()
6424 opline->result.var = CG(context).fast_call_var; in zend_compile_try()
6434 opline = zend_emit_op(NULL, ZEND_FAST_RET, NULL, NULL); in zend_compile_try()
6435 opline->op1_type = IS_TMP_VAR; in zend_compile_try()
6436 opline->op1.var = CG(context).fast_call_var; in zend_compile_try()
6437 opline->op2.num = orig_try_catch_offset; in zend_compile_try()
7200 zend_op *opline; in zend_compile_params() local
7312 opline = zend_emit_op(NULL, opcode, NULL, &default_node); in zend_compile_params()
7313 SET_NODE(opline->result, &var_node); in zend_compile_params()
7314 opline->op1.num = i + 1; in zend_compile_params()
7318 opline->extended_value = in zend_compile_params()
7326 opline->op2.num = type_ast ? in zend_compile_params()
7421 zend_op *opline = zend_emit_op(NULL, in zend_compile_params() local
7423 opline->extended_value = zend_alloc_cache_slots(3); in zend_compile_params()
7446 zend_op *opline; in zend_compile_closure_binding() local
7465 opline = zend_emit_op(NULL, ZEND_BIND_LEXICAL, closure, NULL); in zend_compile_closure_binding()
7466 opline->op2_type = IS_CV; in zend_compile_closure_binding()
7467 opline->op2.var = lookup_cv(var_name); in zend_compile_closure_binding()
7468 opline->extended_value = in zend_compile_closure_binding()
7552 zend_op *opline; in compile_implicit_lexical_binds() local
7568 opline = zend_emit_op(NULL, ZEND_BIND_LEXICAL, closure, NULL); in compile_implicit_lexical_binds()
7569 opline->op2_type = IS_CV; in compile_implicit_lexical_binds()
7570 opline->op2.var = lookup_cv(var_name); in compile_implicit_lexical_binds()
7571 opline->extended_value = offset | ZEND_BIND_IMPLICIT; in compile_implicit_lexical_binds()
7719 zend_op *opline; in zend_begin_func_decl() local
7789 opline = zend_emit_op_tmp(result, ZEND_DECLARE_LAMBDA_FUNCTION, NULL, NULL); in zend_begin_func_decl()
7790 opline->op2.num = func_ref; in zend_begin_func_decl()
7792 opline = get_next_op(); in zend_begin_func_decl()
7793 opline->opcode = ZEND_DECLARE_FUNCTION; in zend_begin_func_decl()
7794 opline->op1_type = IS_CONST; in zend_begin_func_decl()
7795 LITERAL_STR(opline->op1, zend_string_copy(lcname)); in zend_begin_func_decl()
7796 opline->op2.num = func_ref; in zend_begin_func_decl()
8315 zend_op *opline; in zend_compile_class_decl() local
8453 opline = get_next_op(); in zend_compile_class_decl()
8458 opline->op2_type = IS_CONST; in zend_compile_class_decl()
8459 LITERAL_STR(opline->op2, lc_parent_name); in zend_compile_class_decl()
8462 opline->op1_type = IS_CONST; in zend_compile_class_decl()
8463 LITERAL_STR(opline->op1, lcname); in zend_compile_class_decl()
8466 opline->opcode = ZEND_DECLARE_ANON_CLASS; in zend_compile_class_decl()
8467 opline->extended_value = zend_alloc_cache_slot(); in zend_compile_class_decl()
8468 zend_make_var_result(result, opline); in zend_compile_class_decl()
8485 opline->opcode = ZEND_DECLARE_CLASS; in zend_compile_class_decl()
8494 opline->op2_type = IS_CONST; in zend_compile_class_decl()
8495 LITERAL_STR(opline->op2, ZSTR_EMPTY_ALLOC()); in zend_compile_class_decl()
8498 opline->opcode = ZEND_DECLARE_CLASS_DELAYED; in zend_compile_class_decl()
8499 opline->extended_value = zend_alloc_cache_slot(); in zend_compile_class_decl()
8500 opline->result_type = IS_UNUSED; in zend_compile_class_decl()
8501 opline->result.opline_num = -1; in zend_compile_class_decl()
9240 zend_op *opline = zend_emit_op_tmp(result, ZEND_TYPE_CHECK, &right_node, NULL); in zend_compile_binary_op() local
9241 opline->extended_value = in zend_compile_binary_op()
9249 zend_op *opline = zend_emit_op_tmp(result, ZEND_TYPE_CHECK, &left_node, NULL); in zend_compile_binary_op() local
9250 opline->extended_value = in zend_compile_binary_op()
9414 zend_op *opline = zend_compile_prop(NULL, var_ast, BP_VAR_RW, 0); in zend_compile_post_incdec() local
9415 opline->opcode = ast->kind == ZEND_AST_POST_INC ? ZEND_POST_INC_OBJ : ZEND_POST_DEC_OBJ; in zend_compile_post_incdec()
9416 zend_make_tmp_result(result, opline); in zend_compile_post_incdec()
9418 zend_op *opline = zend_compile_static_prop(NULL, var_ast, BP_VAR_RW, 0, 0); in zend_compile_post_incdec() local
9419opline->opcode = ast->kind == ZEND_AST_POST_INC ? ZEND_POST_INC_STATIC_PROP : ZEND_POST_DEC_STATIC… in zend_compile_post_incdec()
9420 zend_make_tmp_result(result, opline); in zend_compile_post_incdec()
9423 zend_op *opline = zend_compile_var(&var_node, var_ast, BP_VAR_RW, 0); in zend_compile_post_incdec() local
9424 if (opline && opline->opcode == ZEND_FETCH_DIM_RW) { in zend_compile_post_incdec()
9425 opline->extended_value = ZEND_FETCH_DIM_INCDEC; in zend_compile_post_incdec()
9441 zend_op *opline = zend_compile_prop(result, var_ast, BP_VAR_RW, 0); in zend_compile_pre_incdec() local
9442 opline->opcode = ast->kind == ZEND_AST_PRE_INC ? ZEND_PRE_INC_OBJ : ZEND_PRE_DEC_OBJ; in zend_compile_pre_incdec()
9443 opline->result_type = IS_TMP_VAR; in zend_compile_pre_incdec()
9446 zend_op *opline = zend_compile_static_prop(result, var_ast, BP_VAR_RW, 0, 0); in zend_compile_pre_incdec() local
9447opline->opcode = ast->kind == ZEND_AST_PRE_INC ? ZEND_PRE_INC_STATIC_PROP : ZEND_PRE_DEC_STATIC_PR… in zend_compile_pre_incdec()
9448 opline->result_type = IS_TMP_VAR; in zend_compile_pre_incdec()
9452 zend_op *opline = zend_compile_var(&var_node, var_ast, BP_VAR_RW, 0); in zend_compile_pre_incdec() local
9453 if (opline && opline->opcode == ZEND_FETCH_DIM_RW) { in zend_compile_pre_incdec()
9454 opline->extended_value = ZEND_FETCH_DIM_INCDEC; in zend_compile_pre_incdec()
9466 zend_op *opline; in zend_compile_cast() local
9471 opline = zend_emit_op_tmp(result, ZEND_BOOL, &expr_node, NULL); in zend_compile_cast()
9475 opline = zend_emit_op_tmp(result, ZEND_CAST, &expr_node, NULL); in zend_compile_cast()
9476 opline->extended_value = ast->attr; in zend_compile_cast()
9572 zend_op *opline; in zend_compile_coalesce() local
9582 opline = zend_emit_op_tmp(NULL, ZEND_QM_ASSIGN, &default_node, NULL); in zend_compile_coalesce()
9583 SET_NODE(opline->result, result); in zend_compile_coalesce()
9585 opline = &CG(active_op_array)->opcodes[opnum]; in zend_compile_coalesce()
9586 opline->op2.opline_num = get_next_op_number(); in zend_compile_coalesce()
9604 zend_op *opline; in zend_compile_assign_coalesce() local
9638 opline = &CG(active_op_array)->opcodes[CG(active_op_array)->last-1]; in zend_compile_assign_coalesce()
9646 opline->opcode = ZEND_ASSIGN_STATIC_PROP; in zend_compile_assign_coalesce()
9647 opline->result_type = IS_TMP_VAR; in zend_compile_assign_coalesce()
9653 opline->opcode = ZEND_ASSIGN_DIM; in zend_compile_assign_coalesce()
9654 opline->result_type = IS_TMP_VAR; in zend_compile_assign_coalesce()
9661 opline->opcode = ZEND_ASSIGN_OBJ; in zend_compile_assign_coalesce()
9662 opline->result_type = IS_TMP_VAR; in zend_compile_assign_coalesce()
9670 opline = zend_emit_op_tmp(NULL, ZEND_QM_ASSIGN, &assign_node, NULL); in zend_compile_assign_coalesce()
9671 SET_NODE(opline->result, result); in zend_compile_assign_coalesce()
9703 zend_op *opline; in zend_compile_print() local
9709 opline = zend_emit_op(NULL, ZEND_ECHO, &expr_node, NULL); in zend_compile_print()
9710 opline->extended_value = 1; in zend_compile_print()
9728 zend_op *opline = zend_emit_op(NULL, ZEND_EXIT, &expr_node, NULL); in zend_compile_exit() local
9731 opline->extended_value = ZEND_THROW_IS_EXPR; in zend_compile_exit()
9745 zend_op *opline; in zend_compile_yield() local
9764 opline = zend_emit_op(result, ZEND_YIELD, value_node_ptr, key_node_ptr); in zend_compile_yield()
9767 opline->extended_value = ZEND_RETURNS_FUNCTION; in zend_compile_yield()
9795 zend_op *opline; in zend_compile_instanceof() local
9808 opline = zend_emit_op_tmp(result, ZEND_INSTANCEOF, &obj_node, NULL); in zend_compile_instanceof()
9811 opline->op2_type = IS_CONST; in zend_compile_instanceof()
9812 opline->op2.constant = zend_add_class_name_literal( in zend_compile_instanceof()
9814 opline->extended_value = zend_alloc_cache_slot(); in zend_compile_instanceof()
9816 SET_NODE(opline->op2, &class_node); in zend_compile_instanceof()
9825 zend_op *opline; in zend_compile_include_or_eval() local
9830 opline = zend_emit_op(result, ZEND_INCLUDE_OR_EVAL, &expr_node, NULL); in zend_compile_include_or_eval()
9831 opline->extended_value = ast->attr; in zend_compile_include_or_eval()
9842 zend_op *opline = NULL; in zend_compile_isset_or_empty() local
9875 opline = zend_emit_op_tmp(result, ZEND_ISSET_ISEMPTY_VAR, &var_node, NULL); in zend_compile_isset_or_empty()
9876 opline->extended_value = in zend_compile_isset_or_empty()
9885 opline = zend_emit_op(result, ZEND_ISSET_ISEMPTY_THIS, NULL, NULL); in zend_compile_isset_or_empty()
9888 opline = zend_emit_op(result, ZEND_ISSET_ISEMPTY_CV, &var_node, NULL); in zend_compile_isset_or_empty()
9890 opline = zend_compile_simple_var_no_cv(result, var_ast, BP_VAR_IS, 0); in zend_compile_isset_or_empty()
9891 opline->opcode = ZEND_ISSET_ISEMPTY_VAR; in zend_compile_isset_or_empty()
9895 opline = zend_compile_dim(result, var_ast, BP_VAR_IS, /* by_ref */ false); in zend_compile_isset_or_empty()
9896 opline->opcode = ZEND_ISSET_ISEMPTY_DIM_OBJ; in zend_compile_isset_or_empty()
9900 opline = zend_compile_prop(result, var_ast, BP_VAR_IS, 0); in zend_compile_isset_or_empty()
9901 opline->opcode = ZEND_ISSET_ISEMPTY_PROP_OBJ; in zend_compile_isset_or_empty()
9904 opline = zend_compile_static_prop(result, var_ast, BP_VAR_IS, 0, 0); in zend_compile_isset_or_empty()
9905 opline->opcode = ZEND_ISSET_ISEMPTY_STATIC_PROP; in zend_compile_isset_or_empty()
9910 result->op_type = opline->result_type = IS_TMP_VAR; in zend_compile_isset_or_empty()
9912 opline->extended_value |= ZEND_ISEMPTY; in zend_compile_isset_or_empty()
9957 zend_op *opline; in zend_compile_array() local
9985 opline = zend_emit_op_tmp(result, ZEND_INIT_ARRAY, NULL, NULL); in zend_compile_array()
9987 opline = zend_emit_op(NULL, ZEND_ADD_ARRAY_UNPACK, &value_node, NULL); in zend_compile_array()
9988 SET_NODE(opline->result, result); in zend_compile_array()
10010 opline = zend_emit_op_tmp(result, ZEND_INIT_ARRAY, &value_node, key_node_ptr); in zend_compile_array()
10011 opline->extended_value = list->children << ZEND_ARRAY_SIZE_SHIFT; in zend_compile_array()
10013 opline = zend_emit_op(NULL, ZEND_ADD_ARRAY_ELEMENT, in zend_compile_array()
10015 SET_NODE(opline->result, result); in zend_compile_array()
10017 opline->extended_value |= by_ref; in zend_compile_array()
10027 opline = &CG(active_op_array)->opcodes[opnum_init]; in zend_compile_array()
10028 opline->extended_value |= ZEND_ARRAY_NOT_PACKED; in zend_compile_array()
10037 zend_op *opline; in zend_compile_const() local
10067 opline = zend_emit_op_tmp(result, ZEND_FETCH_CONSTANT, NULL, NULL); in zend_compile_const()
10068 opline->op2_type = IS_CONST; in zend_compile_const()
10071 opline->op1.num = 0; in zend_compile_const()
10072 opline->op2.constant = zend_add_const_name_literal( in zend_compile_const()
10075 opline->op1.num = IS_CONSTANT_UNQUALIFIED_IN_NAMESPACE; in zend_compile_const()
10076 opline->op2.constant = zend_add_const_name_literal( in zend_compile_const()
10079 opline->extended_value = zend_alloc_cache_slot(); in zend_compile_const()
10088 zend_op *opline; in zend_compile_class_const() local
10114 opline = zend_emit_op_tmp(result, ZEND_FETCH_CLASS_CONSTANT, NULL, &const_node); in zend_compile_class_const()
10116 zend_set_class_name_op1(opline, &class_node); in zend_compile_class_const()
10118 if (opline->op1_type == IS_CONST || opline->op2_type == IS_CONST) { in zend_compile_class_const()
10119 opline->extended_value = zend_alloc_cache_slots(2); in zend_compile_class_const()
10134 zend_op *opline = zend_emit_op_tmp(result, ZEND_FETCH_CLASS_NAME, NULL, NULL); in zend_compile_class_name() local
10135 opline->op1.num = zend_get_class_fetch_type(zend_ast_get_str(class_ast)); in zend_compile_class_name()
10151 static zend_op *zend_compile_rope_add_ex(zend_op *opline, znode *result, uint32_t num, znode *elem_… in zend_compile_rope_add_ex() argument
10156 opline->opcode = ZEND_ROPE_INIT; in zend_compile_rope_add_ex()
10158 opline->opcode = ZEND_ROPE_ADD; in zend_compile_rope_add_ex()
10159 SET_NODE(opline->op1, result); in zend_compile_rope_add_ex()
10161 SET_NODE(opline->op2, elem_node); in zend_compile_rope_add_ex()
10162 SET_NODE(opline->result, result); in zend_compile_rope_add_ex()
10163 opline->extended_value = num; in zend_compile_rope_add_ex()
10164 return opline; in zend_compile_rope_add_ex()
10170 zend_op *opline = get_next_op(); in zend_compile_rope_add() local
10175 opline->opcode = ZEND_ROPE_INIT; in zend_compile_rope_add()
10177 opline->opcode = ZEND_ROPE_ADD; in zend_compile_rope_add()
10178 SET_NODE(opline->op1, result); in zend_compile_rope_add()
10180 SET_NODE(opline->op2, elem_node); in zend_compile_rope_add()
10181 SET_NODE(opline->result, result); in zend_compile_rope_add()
10182 opline->extended_value = num; in zend_compile_rope_add()
10183 return opline; in zend_compile_rope_add()
10191 zend_op *opline = NULL, *init_opline; in zend_compile_encaps_list() local
10226 opline = get_next_op(); in zend_compile_encaps_list()
10227 opline->opcode = ZEND_NOP; in zend_compile_encaps_list()
10239 opline = &CG(active_op_array)->opcodes[reserved_op_number]; in zend_compile_encaps_list()
10240 zend_compile_rope_add_ex(opline, result, j++, &last_const_node); in zend_compile_encaps_list()
10243 opline = zend_compile_rope_add(result, j++, &elem_node); in zend_compile_encaps_list()
10258 opline = &CG(active_op_array)->opcodes[reserved_op_number]; in zend_compile_encaps_list()
10259 opline = zend_compile_rope_add_ex(opline, result, j++, &last_const_node); in zend_compile_encaps_list()
10263 if (opline->op2_type == IS_CONST) { in zend_compile_encaps_list()
10264 GET_NODE(result, opline->op2); in zend_compile_encaps_list()
10265 MAKE_NOP(opline); in zend_compile_encaps_list()
10267 opline->opcode = ZEND_CAST; in zend_compile_encaps_list()
10268 opline->extended_value = IS_STRING; in zend_compile_encaps_list()
10269 opline->op1_type = opline->op2_type; in zend_compile_encaps_list()
10270 opline->op1 = opline->op2; in zend_compile_encaps_list()
10271 SET_UNUSED(opline->op2); in zend_compile_encaps_list()
10272 zend_make_tmp_result(result, opline); in zend_compile_encaps_list()
10275 opline->opcode = ZEND_FAST_CONCAT; in zend_compile_encaps_list()
10276 opline->extended_value = 0; in zend_compile_encaps_list()
10277 opline->op1_type = init_opline->op2_type; in zend_compile_encaps_list()
10278 opline->op1 = init_opline->op2; in zend_compile_encaps_list()
10279 zend_make_tmp_result(result, opline); in zend_compile_encaps_list()
10285 opline->opcode = ZEND_ROPE_END; in zend_compile_encaps_list()
10286 zend_make_tmp_result(result, opline); in zend_compile_encaps_list()
10287 var = opline->op1.var = get_temporary_variable(); in zend_compile_encaps_list()
10297 while (opline != init_opline) { in zend_compile_encaps_list()
10298 opline--; in zend_compile_encaps_list()
10299 if (opline->opcode == ZEND_ROPE_ADD && in zend_compile_encaps_list()
10300 opline->result.var == (uint32_t)-1) { in zend_compile_encaps_list()
10301 opline->op1.var = var; in zend_compile_encaps_list()
10302 opline->result.var = var; in zend_compile_encaps_list()
10303 } else if (opline->opcode == ZEND_ROPE_INIT && in zend_compile_encaps_list()
10304 opline->result.var == (uint32_t)-1) { in zend_compile_encaps_list()
10305 opline->result.var = var; in zend_compile_encaps_list()
10314 zend_op *opline; in zend_compile_magic_const() local
10325 opline = zend_emit_op_tmp(result, ZEND_FETCH_CLASS_NAME, NULL, NULL); in zend_compile_magic_const()
10326 opline->op1.num = ZEND_FETCH_CLASS_SELF; in zend_compile_magic_const()
10937 zend_op *opline = zend_delayed_compile_prop(result, ast, type); in zend_delayed_compile_var() local
10939 opline->extended_value |= ZEND_FETCH_REF; in zend_delayed_compile_var()
10941 return opline; in zend_delayed_compile_var()