Lines Matching refs:CG

40 			target.constant = zend_add_literal(CG(active_op_array), &(src)->u.constant); \
55 #define FC(member) (CG(file_context).member)
68 zend_op_array *op_array = CG(active_op_array); in zend_alloc_cache_slot()
76 zend_op_array *op_array = CG(active_op_array); in zend_alloc_polymorphic_cache_slot()
126 zend_string *filename = CG(active_op_array)->filename; in zend_build_runtime_definition_key()
235 *prev_context = CG(context); in zend_oparray_context_begin()
236 CG(context).opcodes_size = INITIAL_OP_ARRAY_SIZE; in zend_oparray_context_begin()
237 CG(context).vars_size = 0; in zend_oparray_context_begin()
238 CG(context).literals_size = 0; in zend_oparray_context_begin()
239 CG(context).backpatch_count = 0; in zend_oparray_context_begin()
240 CG(context).fast_call_var = -1; in zend_oparray_context_begin()
241 CG(context).try_catch_offset = -1; in zend_oparray_context_begin()
242 CG(context).current_brk_cont = -1; in zend_oparray_context_begin()
243 CG(context).last_brk_cont = 0; in zend_oparray_context_begin()
244 CG(context).brk_cont_array = NULL; in zend_oparray_context_begin()
245 CG(context).labels = NULL; in zend_oparray_context_begin()
251 if (CG(context).brk_cont_array) { in zend_oparray_context_end()
252 efree(CG(context).brk_cont_array); in zend_oparray_context_end()
253 CG(context).brk_cont_array = NULL; in zend_oparray_context_end()
255 if (CG(context).labels) { in zend_oparray_context_end()
256 zend_hash_destroy(CG(context).labels); in zend_oparray_context_end()
257 FREE_HASHTABLE(CG(context).labels); in zend_oparray_context_end()
258 CG(context).labels = NULL; in zend_oparray_context_end()
260 CG(context) = *prev_context; in zend_oparray_context_end()
298 *prev_context = CG(file_context); in zend_file_context_begin()
314 CG(file_context) = *prev_context; in zend_file_context_end()
320 zend_stack_init(&CG(loop_var_stack), sizeof(zend_loop_var)); in zend_init_compiler_data_structures()
321 zend_stack_init(&CG(delayed_oplines_stack), sizeof(zend_op)); in zend_init_compiler_data_structures()
322 CG(active_class_entry) = NULL; in zend_init_compiler_data_structures()
323 CG(in_compilation) = 0; in zend_init_compiler_data_structures()
324 CG(start_lineno) = 0; in zend_init_compiler_data_structures()
326 CG(encoding_declared) = 0; in zend_init_compiler_data_structures()
355 CG(arena) = zend_arena_create(64 * 1024); in init_compiler()
356 CG(active_op_array) = NULL; in init_compiler()
357 memset(&CG(context), 0, sizeof(CG(context))); in init_compiler()
360 zend_hash_init(&CG(filenames_table), 8, NULL, ZVAL_PTR_DTOR, 0); in init_compiler()
361 zend_llist_init(&CG(open_files), sizeof(zend_file_handle), (void (*)(void *)) file_handle_dtor, 0); in init_compiler()
362 CG(unclean_shutdown) = 0; in init_compiler()
368 zend_stack_destroy(&CG(loop_var_stack)); in shutdown_compiler()
369 zend_stack_destroy(&CG(delayed_oplines_stack)); in shutdown_compiler()
370 zend_hash_destroy(&CG(filenames_table)); in shutdown_compiler()
371 zend_arena_destroy(CG(arena)); in shutdown_compiler()
379 if ((p = zend_hash_find(&CG(filenames_table), new_compiled_filename))) { in zend_set_compiled_filename()
381 CG(compiled_filename) = Z_STR_P(p); in zend_set_compiled_filename()
386 zend_hash_update(&CG(filenames_table), new_compiled_filename, &rv); in zend_set_compiled_filename()
388 CG(compiled_filename) = new_compiled_filename; in zend_set_compiled_filename()
395 CG(compiled_filename) = original_compiled_filename; in zend_restore_compiled_filename()
401 return CG(compiled_filename); in zend_get_compiled_filename()
407 return CG(zend_lineno); in zend_get_compiled_lineno()
413 return CG(in_compilation); in zend_is_compiling()
439 if (op_array->last_var > CG(context).vars_size) { in lookup_cv()
440 CG(context).vars_size += 16; /* FIXME */ in lookup_cv()
441 op_array->vars = erealloc(op_array->vars, CG(context).vars_size * sizeof(zend_string*)); in lookup_cv()
482 if (i >= CG(context).literals_size) { in zend_add_literal()
483 while (i >= CG(context).literals_size) { in zend_add_literal()
484 CG(context).literals_size += 16; /* FIXME */ in zend_add_literal()
486 …op_array->literals = (zval*)erealloc(op_array->literals, CG(context).literals_size * sizeof(zval)); in zend_add_literal()
600 op.constant = zend_add_literal(CG(active_op_array), &_c); \
645 if (!zend_stack_is_empty(&CG(loop_var_stack))) { in zend_start_live_range_ex()
646 zend_loop_var *loop_var = zend_stack_top(&CG(loop_var_stack)); in zend_start_live_range_ex()
647 zend_loop_var *base = zend_stack_base(&CG(loop_var_stack)); in zend_start_live_range_ex()
702 int parent = CG(context).current_brk_cont; in zend_begin_loop()
705 CG(context).current_brk_cont = CG(context).last_brk_cont; in zend_begin_loop()
710 uint32_t start = get_next_op_number(CG(active_op_array)); in zend_begin_loop()
715 info.u.live_range_offset = zend_start_live_range(CG(active_op_array), start); in zend_begin_loop()
724 zend_stack_push(&CG(loop_var_stack), &info); in zend_begin_loop()
730 uint32_t end = get_next_op_number(CG(active_op_array)); in zend_end_loop()
732 = &CG(context).brk_cont_array[CG(context).current_brk_cont]; in zend_end_loop()
735 CG(context).current_brk_cont = brk_cont_element->parent; in zend_end_loop()
738 zend_loop_var *loop_var = zend_stack_top(&CG(loop_var_stack)); in zend_end_loop()
739 zend_end_live_range(CG(active_op_array), loop_var->u.live_range_offset, end, in zend_end_loop()
744 zend_stack_del_top(&CG(loop_var_stack)); in zend_end_loop()
751 zend_op *opline = &CG(active_op_array)->opcodes[CG(active_op_array)->last-1]; in zend_do_free()
765 zend_op *opline = &CG(active_op_array)->opcodes[CG(active_op_array)->last-1]; in zend_do_free()
788 while (opline >= CG(active_op_array)->opcodes) { in zend_do_free()
1037 zend_op_array *op_array = CG(active_op_array); in zend_add_try_element()
1090 new_function = zend_arena_alloc(&CG(arena), sizeof(zend_op_array)); in do_bind_function()
1197 zend_op *opline = &CG(active_op_array)->opcodes[CG(active_op_array)->last-1]; in zend_do_early_binding()
1200 while (opline->opcode == ZEND_TICKS && opline > CG(active_op_array)->opcodes) { in zend_do_early_binding()
1206 if (do_bind_function(CG(active_op_array), opline, CG(function_table), 1) == FAILURE) { in zend_do_early_binding()
1209 table = CG(function_table); in zend_do_early_binding()
1212 if (do_bind_class(CG(active_op_array), opline, CG(class_table), 1) == NULL) { in zend_do_early_binding()
1215 table = CG(class_table); in zend_do_early_binding()
1225 ((CG(compiler_options) & ZEND_COMPILE_IGNORE_INTERNAL_CLASSES) && in zend_do_early_binding()
1227 if (CG(compiler_options) & ZEND_COMPILE_DELAYED_BINDING) { in zend_do_early_binding()
1228 uint32_t *opline_num = &CG(active_op_array)->early_binding; in zend_do_early_binding()
1231 opline_num = &CG(active_op_array)->opcodes[*opline_num].result.opline_num; in zend_do_early_binding()
1233 *opline_num = opline - CG(active_op_array)->opcodes; in zend_do_early_binding()
1240 if (do_bind_inherited_class(CG(active_op_array), opline, CG(class_table), ce, 1) == NULL) { in zend_do_early_binding()
1244 zend_del_literal(CG(active_op_array), fetch_class_opline->op2.constant); in zend_do_early_binding()
1247 table = CG(class_table); in zend_do_early_binding()
1263 zend_del_literal(CG(active_op_array), opline->op1.constant+1); in zend_do_early_binding()
1264 zend_del_literal(CG(active_op_array), opline->op1.constant); in zend_do_early_binding()
1271 if (!CG(active_op_array)->function_name) { in zend_mark_function_as_generator()
1276 if (CG(active_op_array)->fn_flags & ZEND_ACC_HAS_RETURN_TYPE) { in zend_mark_function_as_generator()
1277 zend_arg_info return_info = CG(active_op_array)->arg_info[-1]; in zend_mark_function_as_generator()
1294 CG(active_op_array)->fn_flags |= ZEND_ACC_GENERATOR; in zend_mark_function_as_generator()
1301 zend_bool orig_in_compilation = CG(in_compilation); in zend_do_delayed_early_binding()
1305 CG(in_compilation) = 1; in zend_do_delayed_early_binding()
1313 CG(in_compilation) = orig_in_compilation; in zend_do_delayed_early_binding()
1401 …((c->flags & CONST_PERSISTENT) && !(CG(compiler_options) & ZEND_COMPILE_NO_PERSISTENT_CONSTANT_SUB… in zend_try_ct_eval_const()
1402 …|| (Z_TYPE(c->value) < IS_OBJECT && !(CG(compiler_options) & ZEND_COMPILE_NO_CONSTANT_SUBSTITUTION… in zend_try_ct_eval_const()
1430 if (CG(active_op_array)->fn_flags & ZEND_ACC_CLOSURE) { in zend_is_scope_known()
1435 if (!CG(active_class_entry)) { in zend_is_scope_known()
1438 return CG(active_op_array)->function_name != NULL; in zend_is_scope_known()
1442 return (CG(active_class_entry)->ce_flags & ZEND_ACC_TRAIT) == 0; in zend_is_scope_known()
1448 if (!CG(active_class_entry)) { in class_name_refers_to_active_ce()
1455 && zend_string_equals_ci(class_name, CG(active_class_entry)->name); in class_name_refers_to_active_ce()
1486 if (fetch_type != ZEND_FETCH_CLASS_DEFAULT && !CG(active_class_entry) && zend_is_scope_known()) { in zend_ensure_valid_class_fetch_type()
1523 if (CG(active_class_entry) && zend_is_scope_known()) { in zend_try_compile_const_expr_resolve_class_name()
1524 ZVAL_STR_COPY(zv, CG(active_class_entry)->name); in zend_try_compile_const_expr_resolve_class_name()
1555 cc = zend_hash_find_ptr(&CG(active_class_entry)->constants_table, name); in zend_try_ct_eval_class_const()
1556 …} else if (fetch_type == ZEND_FETCH_CLASS_DEFAULT && !(CG(compiler_options) & ZEND_COMPILE_NO_CONS… in zend_try_ct_eval_class_const()
1557 …zend_class_entry *ce = zend_hash_find_ptr_lc(CG(class_table), ZSTR_VAL(class_name), ZSTR_LEN(class… in zend_try_ct_eval_class_const()
1567 if (CG(compiler_options) & ZEND_COMPILE_NO_PERSISTENT_CONSTANT_SUBSTITUTION) { in zend_try_ct_eval_class_const()
1571 if (!cc || !zend_verify_const_access(cc, CG(active_class_entry))) { in zend_try_ct_eval_class_const()
1611 if (!(CG(compiler_options) & ZEND_COMPILE_EXTENDED_INFO)) { in zend_do_extended_info()
1615 opline = get_next_op(CG(active_op_array)); in zend_do_extended_info()
1627 if (!(CG(compiler_options) & ZEND_COMPILE_EXTENDED_INFO)) { in zend_do_extended_fcall_begin()
1631 opline = get_next_op(CG(active_op_array)); in zend_do_extended_fcall_begin()
1643 if (!(CG(compiler_options) & ZEND_COMPILE_EXTENDED_INFO)) { in zend_do_extended_fcall_end()
1647 opline = get_next_op(CG(active_op_array)); in zend_do_extended_fcall_end()
1658 if ((auto_global = zend_hash_str_find_ptr(CG(auto_globals), name, len)) != NULL) { in zend_is_auto_global_str()
1672 if ((auto_global = zend_hash_find_ptr(CG(auto_globals), name)) != NULL) { in zend_is_auto_global()
1691 …retval = zend_hash_add_mem(CG(auto_globals), auto_global.name, &auto_global, sizeof(zend_auto_glob… in zend_register_auto_global()
1702 ZEND_HASH_FOREACH_PTR(CG(auto_globals), auto_global) { in zend_activate_auto_globals()
1720 if (CG(increment_lineno)) { in zendlex()
1721 CG(zend_lineno)++; in zendlex()
1722 CG(increment_lineno) = 0; in zendlex()
1727 start_lineno = CG(zend_lineno); in zendlex()
1762 if (CG(compiler_options) & ZEND_COMPILE_GUARDS) { in zend_initialize_class_data()
1774 int n = zend_hash_num_elements(CG(class_table)); in zend_initialize_class_data()
1776 if (CG(static_members_table) && n >= CG(last_static_member)) { in zend_initialize_class_data()
1778 CG(last_static_member) = n+1; in zend_initialize_class_data()
1779 CG(static_members_table) = realloc(CG(static_members_table), (n+1)*sizeof(zval*)); in zend_initialize_class_data()
1780 CG(static_members_table)[n] = NULL; in zend_initialize_class_data()
1989 opline->result.var = get_temporary_variable(CG(active_op_array)); in zend_make_var_result()
1997 opline->result.var = get_temporary_variable(CG(active_op_array)); in zend_make_tmp_result()
2006 while (def != CG(active_op_array)->opcodes) { in zend_find_live_range()
2032 def = CG(active_op_array)->opcodes + def->op2.opline_num - 1; in zend_find_live_range()
2038 zend_end_live_range(CG(active_op_array), in zend_find_live_range()
2039 zend_start_live_range_ex(CG(active_op_array), in zend_find_live_range()
2040 def + 1 - CG(active_op_array)->opcodes), in zend_find_live_range()
2041 opline - CG(active_op_array)->opcodes, in zend_find_live_range()
2136 zend_op *opline = get_next_op(CG(active_op_array)); in zend_emit_op()
2162 zend_op *opline = get_next_op(CG(active_op_array)); in zend_emit_op_tmp()
2192 …if (CG(active_op_array)->last && CG(active_op_array)->opcodes[CG(active_op_array)->last - 1].opcod… in zend_emit_tick()
2196 opline = get_next_op(CG(active_op_array)); in zend_emit_tick()
2213 uint32_t opnum = get_next_op_number(CG(active_op_array)); in zend_emit_jump()
2248 uint32_t opnum = get_next_op_number(CG(active_op_array)); in zend_emit_cond_jump()
2253 && zend_is_smart_branch(CG(active_op_array)->opcodes + opnum - 1)) { in zend_emit_cond_jump()
2256 opnum = get_next_op_number(CG(active_op_array)); in zend_emit_cond_jump()
2266 zend_op *opline = &CG(active_op_array)->opcodes[opnum_jump]; in zend_update_jump_target()
2285 zend_update_jump_target(opnum_jump, get_next_op_number(CG(active_op_array))); in zend_update_jump_target_to_next()
2308 zend_stack_push(&CG(delayed_oplines_stack), &tmp_opline); in zend_delayed_emit_op()
2309 return zend_stack_top(&CG(delayed_oplines_stack)); in zend_delayed_emit_op()
2315 return zend_stack_count(&CG(delayed_oplines_stack)); in zend_delayed_compile_begin()
2321 zend_op *opline = NULL, *oplines = zend_stack_base(&CG(delayed_oplines_stack)); in zend_delayed_compile_end()
2322 uint32_t i, count = zend_stack_count(&CG(delayed_oplines_stack)); in zend_delayed_compile_end()
2326 opline = get_next_op(CG(active_op_array)); in zend_delayed_compile_end()
2330 CG(delayed_oplines_stack).top = offset; in zend_delayed_compile_end()
2382 opline->result.var = expr->u.op.var = get_temporary_variable(CG(active_op_array)); in zend_emit_return_type_check()
2385 opline->op2.num = CG(active_op_array)->cache_size; in zend_emit_return_type_check()
2386 CG(active_op_array)->cache_size += sizeof(void*); in zend_emit_return_type_check()
2398 zend_bool returns_reference = (CG(active_op_array)->fn_flags & ZEND_ACC_RETURN_REFERENCE) != 0; in zend_emit_final_return()
2400 if (CG(active_op_array)->fn_flags & ZEND_ACC_HAS_RETURN_TYPE in zend_emit_final_return()
2401 && !(CG(active_op_array)->fn_flags & ZEND_ACC_GENERATOR)) { in zend_emit_final_return()
2402 zend_emit_return_type_check(NULL, CG(active_op_array)->arg_info - 1, 1); in zend_emit_final_return()
2480 CG(active_op_array), Z_STR(class_node->u.constant)); in zend_set_class_name_op1()
2510 opline->op2.constant = zend_add_class_name_literal(CG(active_op_array), in zend_compile_class_ref()
2593 result->u.op.var = lookup_cv(CG(active_op_array), name); in zend_try_compile_cv()
2596 name = CG(active_op_array)->vars[EX_VAR_TO_NUM(result->u.op.var)]; in zend_try_compile_cv()
2798 CG(active_op_array), Z_STR(class_node.u.constant)); in zend_compile_static_prop_common()
3283 uint32_t opnum_init = get_next_op_number(CG(active_op_array)) - 1; in zend_compile_call_common()
3291 opline = &CG(active_op_array)->opcodes[opnum_init]; in zend_compile_call_common()
3321 zend_op *opline = get_next_op(CG(active_op_array)); in zend_compile_ns_call()
3326 CG(active_op_array), Z_STR(name_node->u.constant)); in zend_compile_ns_call()
3341 zend_op *opline = get_next_op(CG(active_op_array)); in zend_compile_dynamic_call()
3345 opline->op1.constant = zend_add_class_name_literal(CG(active_op_array), class); in zend_compile_dynamic_call()
3347 opline->op2.constant = zend_add_func_name_literal(CG(active_op_array), method); in zend_compile_dynamic_call()
3351 zend_op *opline = get_next_op(CG(active_op_array)); in zend_compile_dynamic_call()
3356 opline->op2.constant = zend_add_func_name_literal(CG(active_op_array), str); in zend_compile_dynamic_call()
3383 if ((CG(compiler_options) & ZEND_COMPILE_NO_BUILTIN_STRLEN) in zend_compile_func_strlen()
3466 zend_add_literal(CG(active_op_array), &c); in zend_compile_func_defined()
3519 fbc = zend_hash_find_ptr(CG(function_table), lcname); in zend_try_compile_ct_bound_init_user_func()
3521 …|| (fbc->type == ZEND_INTERNAL_FUNCTION && (CG(compiler_options) & ZEND_COMPILE_IGNORE_INTERNAL_FU… in zend_try_compile_ct_bound_init_user_func()
3522 …|| (fbc->type == ZEND_USER_FUNCTION && (CG(compiler_options) & ZEND_COMPILE_IGNORE_USER_FUNCTIONS)) in zend_try_compile_ct_bound_init_user_func()
3638 uint32_t check_op_number = get_next_op_number(CG(active_op_array)); in zend_compile_assert()
3651 CG(active_op_array), name); in zend_compile_assert()
3666 opline = &CG(active_op_array)->opcodes[check_op_number]; in zend_compile_assert()
3667 opline->op2.opline_num = get_next_op_number(CG(active_op_array)); in zend_compile_assert()
3824 if (CG(active_op_array)->function_name && args->children == 0) { in zend_compile_func_num_args()
3835 if (CG(active_op_array)->function_name && args->children == 0) { in zend_compile_func_get_args()
3846 if (CG(active_op_array)->function_name in zend_compile_func_array_slice()
3883 if (CG(compiler_options) & ZEND_COMPILE_NO_BUILTINS) { in zend_try_compile_special_func()
3985 fbc = zend_hash_find_ptr(CG(function_table), lcname); in zend_compile_call()
3996 …|| (fbc->type == ZEND_INTERNAL_FUNCTION && (CG(compiler_options) & ZEND_COMPILE_IGNORE_INTERNAL_FU… in zend_compile_call()
3997 …|| (fbc->type == ZEND_USER_FUNCTION && (CG(compiler_options) & ZEND_COMPILE_IGNORE_USER_FUNCTIONS)) in zend_compile_call()
4048 opline->op2.constant = zend_add_func_name_literal(CG(active_op_array), in zend_compile_method_call()
4057 CG(active_class_entry) && zend_is_scope_known()) { in zend_compile_method_call()
4059 fbc = zend_hash_find_ptr(&CG(active_class_entry)->function_table, lcname); in zend_compile_method_call()
4102 opline = get_next_op(CG(active_op_array)); in zend_compile_static_call()
4109 opline->op2.constant = zend_add_func_name_literal(CG(active_op_array), in zend_compile_static_call()
4126 ce = zend_hash_find_ptr(CG(class_table), lcname); in zend_compile_static_call()
4127 if (!ce && CG(active_class_entry) in zend_compile_static_call()
4128 && zend_string_equals_ci(CG(active_class_entry)->name, lcname)) { in zend_compile_static_call()
4129 ce = CG(active_class_entry); in zend_compile_static_call()
4134 ce = CG(active_class_entry); in zend_compile_static_call()
4140 if (ce != CG(active_class_entry) in zend_compile_static_call()
4142 || !zend_check_protected(zend_get_function_root_class(fbc), CG(active_class_entry)))) { in zend_compile_static_call()
4166 uint32_t dcl_opnum = get_next_op_number(CG(active_op_array)); in zend_compile_new()
4169 opline = &CG(active_op_array)->opcodes[dcl_opnum]; in zend_compile_new()
4175 opline->extended_value = get_next_op_number(CG(active_op_array)); in zend_compile_new()
4180 opnum = get_next_op_number(CG(active_op_array)); in zend_compile_new()
4186 CG(active_op_array), Z_STR(class_node.u.constant)); in zend_compile_new()
4196 opline = &CG(active_op_array)->opcodes[opnum]; in zend_compile_new()
4197 opline->op2.opline_num = get_next_op_number(CG(active_op_array)); in zend_compile_new()
4255 if (!CG(active_op_array)->static_variables) { in zend_compile_static_var_common()
4256 if (CG(active_op_array)->scope) { in zend_compile_static_var_common()
4257 CG(active_op_array)->scope->ce_flags |= ZEND_HAS_STATIC_IN_METHODS; in zend_compile_static_var_common()
4259 ALLOC_HASHTABLE(CG(active_op_array)->static_variables); in zend_compile_static_var_common()
4260 zend_hash_init(CG(active_op_array)->static_variables, 8, NULL, ZVAL_PTR_DTOR, 0); in zend_compile_static_var_common()
4263 if (GC_REFCOUNT(CG(active_op_array)->static_variables) > 1) { in zend_compile_static_var_common()
4264 if (!(GC_FLAGS(CG(active_op_array)->static_variables) & IS_ARRAY_IMMUTABLE)) { in zend_compile_static_var_common()
4265 GC_REFCOUNT(CG(active_op_array)->static_variables)--; in zend_compile_static_var_common()
4267 CG(active_op_array)->static_variables = zend_array_dup(CG(active_op_array)->static_variables); in zend_compile_static_var_common()
4269 zend_hash_update(CG(active_op_array)->static_variables, Z_STR(var_node.u.constant), value); in zend_compile_static_var_common()
4277 opline->op1.var = lookup_cv(CG(active_op_array), zend_string_copy(Z_STR(var_node.u.constant))); in zend_compile_static_var_common()
4337 zend_loop_var *loop_var = zend_stack_top(&CG(loop_var_stack)); in zend_handle_loops_and_finally_ex()
4342 base = zend_stack_base(&CG(loop_var_stack)); in zend_handle_loops_and_finally_ex()
4345 zend_op *opline = get_next_op(CG(active_op_array)); in zend_handle_loops_and_finally_ex()
4358 zend_op *opline = get_next_op(CG(active_op_array)); in zend_handle_loops_and_finally_ex()
4375 opline = get_next_op(CG(active_op_array)); in zend_handle_loops_and_finally_ex()
4391 return zend_handle_loops_and_finally_ex(zend_stack_count(&CG(loop_var_stack)) + 1, return_value); in zend_handle_loops_and_finally()
4398 zend_loop_var *loop_var = zend_stack_top(&CG(loop_var_stack)); in zend_has_finally_ex()
4403 base = zend_stack_base(&CG(loop_var_stack)); in zend_has_finally_ex()
4423 return zend_has_finally_ex(zend_stack_count(&CG(loop_var_stack)) + 1); in zend_has_finally()
4430 zend_bool is_generator = (CG(active_op_array)->fn_flags & ZEND_ACC_GENERATOR) != 0; in zend_compile_return()
4431 zend_bool by_ref = (CG(active_op_array)->fn_flags & ZEND_ACC_RETURN_REFERENCE) != 0; in zend_compile_return()
4450 if ((CG(active_op_array)->fn_flags & ZEND_ACC_HAS_FINALLY_BLOCK) in zend_compile_return()
4462 if (!is_generator && CG(active_op_array)->fn_flags & ZEND_ACC_HAS_RETURN_TYPE) { in zend_compile_return()
4464 expr_ast ? &expr_node : NULL, CG(active_op_array)->arg_info - 1, 0); in zend_compile_return()
4533 if (CG(context).current_brk_cont == -1) { in zend_compile_break_continue()
4544 opline->op1.num = CG(context).current_brk_cont; in zend_compile_break_continue()
4557 if (CG(context).labels == NULL || in zend_resolve_goto_label()
4558 (dest = zend_hash_find_ptr(CG(context).labels, Z_STR_P(label))) == NULL in zend_resolve_goto_label()
4560 CG(in_compilation) = 1; in zend_resolve_goto_label()
4561 CG(active_op_array) = op_array; in zend_resolve_goto_label()
4562 CG(zend_lineno) = opline->lineno; in zend_resolve_goto_label()
4570 for (; current != dest->brk_cont; current = CG(context).brk_cont_array[current].parent) { in zend_resolve_goto_label()
4572 CG(in_compilation) = 1; in zend_resolve_goto_label()
4573 CG(active_op_array) = op_array; in zend_resolve_goto_label()
4574 CG(zend_lineno) = opline->lineno; in zend_resolve_goto_label()
4577 if (CG(context).brk_cont_array[current].start >= 0) { in zend_resolve_goto_label()
4615 uint32_t opnum_start = get_next_op_number(CG(active_op_array)); in zend_compile_goto()
4622 opline->op1.num = get_next_op_number(CG(active_op_array)) - opnum_start - 1; in zend_compile_goto()
4623 opline->extended_value = CG(context).current_brk_cont; in zend_compile_goto()
4632 if (!CG(context).labels) { in zend_compile_label()
4633 ALLOC_HASHTABLE(CG(context).labels); in zend_compile_label()
4634 zend_hash_init(CG(context).labels, 8, NULL, label_ptr_dtor, 0); in zend_compile_label()
4637 dest.brk_cont = CG(context).current_brk_cont; in zend_compile_label()
4638 dest.opline_num = get_next_op_number(CG(active_op_array)); in zend_compile_label()
4640 if (!zend_hash_add_mem(CG(context).labels, label, &dest, sizeof(zend_label))) { in zend_compile_label()
4657 opnum_start = get_next_op_number(CG(active_op_array)); in zend_compile_while()
4660 opnum_cond = get_next_op_number(CG(active_op_array)); in zend_compile_while()
4680 opnum_start = get_next_op_number(CG(active_op_array)); in zend_compile_do_while()
4683 opnum_cond = get_next_op_number(CG(active_op_array)); in zend_compile_do_while()
4731 opnum_start = get_next_op_number(CG(active_op_array)); in zend_compile_for()
4734 opnum_loop = get_next_op_number(CG(active_op_array)); in zend_compile_for()
4785 opnum_reset = get_next_op_number(CG(active_op_array)); in zend_compile_foreach()
4790 opnum_fetch = get_next_op_number(CG(active_op_array)); in zend_compile_foreach()
4800 opline->op2.var = get_temporary_variable(CG(active_op_array)); in zend_compile_foreach()
4810 opline = &CG(active_op_array)->opcodes[opnum_fetch]; in zend_compile_foreach()
4820 CG(zend_lineno) = ast->lineno; in zend_compile_foreach()
4823 opline = &CG(active_op_array)->opcodes[opnum_reset]; in zend_compile_foreach()
4824 opline->op2.opline_num = get_next_op_number(CG(active_op_array)); in zend_compile_foreach()
4826 opline = &CG(active_op_array)->opcodes[opnum_fetch]; in zend_compile_foreach()
4827 opline->extended_value = get_next_op_number(CG(active_op_array)); in zend_compile_foreach()
4919 if (CG(compiler_options) & ZEND_COMPILE_NO_JUMPTABLES) { in should_use_jumptable()
4952 case_node.u.op.var = get_temporary_variable(CG(active_op_array)); in zend_compile_switch()
4969 opnum_switch = opline - CG(active_op_array)->opcodes; in zend_compile_switch()
4980 CG(zend_lineno) = case_ast->lineno; in zend_compile_switch()
5020 ZVAL_LONG(&jmp_target, get_next_op_number(CG(active_op_array))); in zend_compile_switch()
5034 opline = &CG(active_op_array)->opcodes[opnum_switch]; in zend_compile_switch()
5035 opline->extended_value = get_next_op_number(CG(active_op_array)); in zend_compile_switch()
5046 opline = &CG(active_op_array)->opcodes[opnum_switch]; in zend_compile_switch()
5047 opline->extended_value = get_next_op_number(CG(active_op_array)); in zend_compile_switch()
5051 zend_end_loop(get_next_op_number(CG(active_op_array)), &expr_node); in zend_compile_switch()
5055 opline = get_next_op(CG(active_op_array)); in zend_compile_switch()
5077 uint32_t orig_fast_call_var = CG(context).fast_call_var; in zend_compile_try()
5078 uint32_t orig_try_catch_offset = CG(context).try_catch_offset; in zend_compile_try()
5085 if (CG(context).labels) { in zend_compile_try()
5087 ZEND_HASH_REVERSE_FOREACH_PTR(CG(context).labels, label) { in zend_compile_try()
5088 if (label->opline_num == get_next_op_number(CG(active_op_array))) { in zend_compile_try()
5095 try_catch_offset = zend_add_try_element(get_next_op_number(CG(active_op_array))); in zend_compile_try()
5099 if (!(CG(active_op_array)->fn_flags & ZEND_ACC_HAS_FINALLY_BLOCK)) { in zend_compile_try()
5100 CG(active_op_array)->fn_flags |= ZEND_ACC_HAS_FINALLY_BLOCK; in zend_compile_try()
5102 CG(context).fast_call_var = get_temporary_variable(CG(active_op_array)); in zend_compile_try()
5107 fast_call.var_num = CG(context).fast_call_var; in zend_compile_try()
5109 zend_stack_push(&CG(loop_var_stack), &fast_call); in zend_compile_try()
5112 CG(context).try_catch_offset = try_catch_offset; in zend_compile_try()
5131 CG(zend_lineno) = catch_ast->lineno; in zend_compile_try()
5142 opnum_catch = get_next_op_number(CG(active_op_array)); in zend_compile_try()
5144 CG(active_op_array)->try_catch_array[try_catch_offset].catch_op = opnum_catch; in zend_compile_try()
5147 opline = get_next_op(CG(active_op_array)); in zend_compile_try()
5150 opline->op1.constant = zend_add_class_name_literal(CG(active_op_array), in zend_compile_try()
5158 opline->op2.var = lookup_cv(CG(active_op_array), zend_string_copy(Z_STR_P(var_name))); in zend_compile_try()
5164 opline = &CG(active_op_array)->opcodes[opnum_catch]; in zend_compile_try()
5165 opline->extended_value = get_next_op_number(CG(active_op_array)); in zend_compile_try()
5181 opline = &CG(active_op_array)->opcodes[opnum_catch]; in zend_compile_try()
5183 opline->extended_value = get_next_op_number(CG(active_op_array)); in zend_compile_try()
5193 uint32_t opnum_jmp = get_next_op_number(CG(active_op_array)) + 1; in zend_compile_try()
5196 zend_stack_del_top(&CG(loop_var_stack)); in zend_compile_try()
5201 discard_exception.var_num = CG(context).fast_call_var; in zend_compile_try()
5202 zend_stack_push(&CG(loop_var_stack), &discard_exception); in zend_compile_try()
5204 CG(zend_lineno) = finally_ast->lineno; in zend_compile_try()
5209 opline->result.var = CG(context).fast_call_var; in zend_compile_try()
5215 CG(active_op_array)->try_catch_array[try_catch_offset].finally_op = opnum_jmp + 1; in zend_compile_try()
5216 CG(active_op_array)->try_catch_array[try_catch_offset].finally_end in zend_compile_try()
5217 = get_next_op_number(CG(active_op_array)); in zend_compile_try()
5221 opline->op1.var = CG(context).fast_call_var; in zend_compile_try()
5226 CG(context).fast_call_var = orig_fast_call_var; in zend_compile_try()
5229 zend_stack_del_top(&CG(loop_var_stack)); in zend_compile_try()
5232 CG(context).try_catch_offset = orig_try_catch_offset; in zend_compile_try()
5254 if (CG(multibyte)) { in zend_handle_encoding_declaration()
5260 CG(encoding_declared) = 1; in zend_handle_encoding_declaration()
5290 zend_ast_list *file_ast = zend_ast_get_list(CG(ast)); in zend_declare_is_first_statement()
5357 CG(active_op_array)->fn_flags |= ZEND_ACC_STRICT_TYPES; in zend_compile_declare()
5443 zend_op_array *op_array = CG(active_op_array); in zend_compile_params()
5496 var_node.u.op.var = lookup_cv(CG(active_op_array), zend_string_copy(name)); in zend_compile_params()
5520 uint32_t cops = CG(compiler_options); in zend_compile_params()
5521CG(compiler_options) |= ZEND_COMPILE_NO_CONSTANT_SUBSTITUTION | ZEND_COMPILE_NO_PERSISTENT_CONSTAN… in zend_compile_params()
5525 CG(compiler_options) = cops; in zend_compile_params()
5669 opline->op2.var = lookup_cv(CG(active_op_array), zend_string_copy(var_name)); in zend_compile_closure_binding()
5677 zend_op_array *op_array = CG(active_op_array); in zend_compile_closure_uses()
5711 zend_class_entry *ce = CG(active_class_entry); in zend_begin_method_decl()
5908 zend_hash_update_ptr(CG(function_table), key, op_array); in zend_begin_func_decl()
5916 opline = get_next_op(CG(active_op_array)); in zend_begin_func_decl()
5921 zend_add_literal_string(CG(active_op_array), &key); in zend_begin_func_decl()
5938 zend_op_array *orig_op_array = CG(active_op_array); in zend_compile_func_decl()
5939 zend_op_array *op_array = zend_arena_alloc(&CG(arena), sizeof(zend_op_array)); in zend_compile_func_decl()
5965 CG(active_op_array) = op_array; in zend_compile_func_decl()
5969 if (CG(compiler_options) & ZEND_COMPILE_EXTENDED_INFO) { in zend_compile_func_decl()
5979 zend_stack_push(&CG(loop_var_stack), (void *) &dummy_var); in zend_compile_func_decl()
5983 if (CG(active_op_array)->fn_flags & ZEND_ACC_GENERATOR) { in zend_compile_func_decl()
5994 CG(active_class_entry), (zend_function *) op_array, E_COMPILE_ERROR); in zend_compile_func_decl()
5998 CG(zend_lineno) = decl->end_lineno; in zend_compile_func_decl()
6003 pass_two(CG(active_op_array)); in zend_compile_func_decl()
6007 zend_stack_del_top(&CG(loop_var_stack)); in zend_compile_func_decl()
6009 CG(active_op_array) = orig_op_array; in zend_compile_func_decl()
6017 zend_class_entry *ce = CG(active_class_entry); in zend_compile_prop_decl()
6068 zend_class_entry *ce = CG(active_class_entry); in zend_compile_class_const_decl()
6149 zend_add_to_list(&CG(active_class_entry)->trait_precedences, precedence); in zend_compile_trait_precedence()
6179 zend_add_to_list(&CG(active_class_entry)->trait_aliases, alias); in zend_compile_trait_alias()
6187 zend_class_entry *ce = CG(active_class_entry); in zend_compile_use_trait()
6209 opline = get_next_op(CG(active_op_array)); in zend_compile_use_trait()
6213 opline->op2.constant = zend_add_class_name_literal(CG(active_op_array), in zend_compile_use_trait()
6255 opline->op2.constant = zend_add_class_name_literal(CG(active_op_array), in zend_compile_implements()
6258 CG(active_class_entry)->num_interfaces++; in zend_compile_implements()
6268 zend_string *filename = CG(active_op_array)->filename; in zend_generate_anon_class_name()
6284 zend_class_entry *ce = zend_arena_alloc(&CG(arena), sizeof(zend_class_entry)); in zend_compile_class_decl()
6288 zend_class_entry *original_ce = CG(active_class_entry); in zend_compile_class_decl()
6294 if (CG(active_class_entry)) { in zend_compile_class_decl()
6349 opline = get_next_op(CG(active_op_array)); in zend_compile_class_decl()
6365 if (!zend_hash_exists(CG(class_table), lcname)) { in zend_compile_class_decl()
6366 zend_hash_add_ptr(CG(class_table), lcname, ce); in zend_compile_class_decl()
6375 ce = zend_hash_find_ptr(CG(class_table), lcname); in zend_compile_class_decl()
6389 opline->op2.constant = zend_add_class_name_literal(CG(active_op_array), in zend_compile_class_decl()
6409 zend_add_literal_string(CG(active_op_array), &key); in zend_compile_class_decl()
6411 zend_hash_update_ptr(CG(class_table), key, ce); in zend_compile_class_decl()
6414 CG(active_class_entry) = ce; in zend_compile_class_decl()
6419 CG(zend_lineno) = ast->lineno; in zend_compile_class_decl()
6495 CG(active_class_entry) = original_ce; in zend_compile_class_decl()
6724 || (with_bracket && !FC(has_bracketed_namespaces))) && CG(active_op_array)->last > 0 in zend_compile_namespace()
6727 uint32_t num = CG(active_op_array)->last; in zend_compile_namespace()
6729 (CG(active_op_array)->opcodes[num-1].opcode == ZEND_EXT_STMT || in zend_compile_namespace()
6730 CG(active_op_array)->opcodes[num-1].opcode == ZEND_TICKS)) { in zend_compile_namespace()
6793 zend_op_array *op_array = CG(active_op_array); in zend_try_ct_eval_magic_const()
6794 zend_class_entry *ce = CG(active_class_entry); in zend_try_ct_eval_magic_const()
6801 ZVAL_STR_COPY(zv, CG(compiled_filename)); in zend_try_ct_eval_magic_const()
6805 zend_string *filename = CG(compiled_filename); in zend_try_ct_eval_magic_const()
6974 CG(zend_lineno) = zend_ast_get_lineno(last_elem_ast); in zend_try_ct_eval_array()
7209 opnum_jmpz = get_next_op_number(CG(active_op_array)); in zend_compile_short_circuiting()
7216 opline_jmpz->result.var = get_temporary_variable(CG(active_op_array)); in zend_compile_short_circuiting()
7299 opnum_jmp_set = get_next_op_number(CG(active_op_array)); in zend_compile_shorthand_conditional()
7358 opnum = get_next_op_number(CG(active_op_array)); in zend_compile_coalesce()
7366 opline = &CG(active_op_array)->opcodes[opnum]; in zend_compile_coalesce()
7367 opline->op2.opline_num = get_next_op_number(CG(active_op_array)); in zend_compile_coalesce()
7412 zend_bool returns_by_ref = (CG(active_op_array)->fn_flags & ZEND_ACC_RETURN_REFERENCE) != 0; in zend_compile_yield()
7445 if (CG(active_op_array)->fn_flags & ZEND_ACC_RETURN_REFERENCE) { in zend_compile_yield_from()
7477 CG(active_op_array), Z_STR(class_node.u.constant)); in zend_compile_instanceof()
7559 range = zend_start_live_range(CG(active_op_array), get_next_op_number(CG(active_op_array))); in zend_compile_silence()
7572 zend_end_live_range(CG(active_op_array), range, get_next_op_number(CG(active_op_array)), in zend_compile_silence()
7640 opnum_init = get_next_op_number(CG(active_op_array)); in zend_compile_array()
7658 opline = &CG(active_op_array)->opcodes[opnum_init]; in zend_compile_array()
7675 zend_ast *last = CG(ast); in zend_compile_const()
7703 CG(active_op_array), resolved_name, 0); in zend_compile_const()
7709 CG(active_op_array), resolved_name, 1); in zend_compile_const()
7712 CG(active_op_array), resolved_name, 0); in zend_compile_const()
7783 if (CG(active_class_entry) && zend_is_scope_known()) { in zend_compile_resolve_class_name()
7785 ZVAL_STR_COPY(&result->u.constant, CG(active_class_entry)->name); in zend_compile_resolve_class_name()
7809 zend_op *opline = get_next_op(CG(active_op_array)); in zend_compile_rope_add()
7857 rope_init_lineno = get_next_op_number(CG(active_op_array)); in zend_compile_encaps_list()
7879 init_opline = CG(active_op_array)->opcodes + rope_init_lineno; in zend_compile_encaps_list()
7890 opline->result.var = get_temporary_variable(CG(active_op_array)); in zend_compile_encaps_list()
7900 opline->result.var = get_temporary_variable(CG(active_op_array)); in zend_compile_encaps_list()
7905 uint32_t range = zend_start_live_range_ex(CG(active_op_array), rope_init_lineno); in zend_compile_encaps_list()
7909 opline->result.var = get_temporary_variable(CG(active_op_array)); in zend_compile_encaps_list()
7910 var = opline->op1.var = get_temporary_variable(CG(active_op_array)); in zend_compile_encaps_list()
7916 get_temporary_variable(CG(active_op_array)); in zend_compile_encaps_list()
7920 zend_end_live_range(CG(active_op_array), range, opline - CG(active_op_array)->opcodes, in zend_compile_encaps_list()
7949 CG(active_class_entry) && in zend_compile_magic_const()
7950 (CG(active_class_entry)->ce_flags & ZEND_ACC_TRAIT) != 0); in zend_compile_magic_const()
8134 CG(zend_lineno) = ((zend_ast_decl *) ast)->end_lineno; in zend_compile_top_stmt()
8146 CG(zend_lineno) = ast->lineno; in zend_compile_stmt()
8148 if ((CG(compiler_options) & ZEND_COMPILE_EXTENDED_INFO) && !zend_is_unticked_stmt(ast)) { in zend_compile_stmt()
8256 CG(zend_lineno) = zend_ast_get_lineno(ast); in zend_compile_expr()
8379 CG(zend_lineno) = zend_ast_get_lineno(ast); in zend_compile_var()