Lines Matching refs:CG

55 #define FC(member) (CG(file_context).member)
72 zend_op_array *op_array = CG(active_op_array); in zend_alloc_cache_slots()
104 op->lineno = CG(zend_lineno); in init_op()
109 return CG(active_op_array)->last; in get_next_op_number()
114 zend_op_array *op_array = CG(active_op_array); in get_next_op()
118 if (UNEXPECTED(next_op_num >= CG(context).opcodes_size)) { in get_next_op()
119 CG(context).opcodes_size *= 4; in get_next_op()
120 op_array->opcodes = erealloc(op_array->opcodes, CG(context).opcodes_size * sizeof(zend_op)); in get_next_op()
132 CG(context).last_brk_cont++; in get_next_brk_cont_element()
133CG(context).brk_cont_array = erealloc(CG(context).brk_cont_array, sizeof(zend_brk_cont_element) * in get_next_brk_cont_element()
134 return &CG(context).brk_cont_array[CG(context).last_brk_cont-1]; in get_next_brk_cont_element()
139 zend_string *filename = CG(active_op_array)->filename; in zend_build_runtime_definition_key()
141 '\0', ZSTR_VAL(name), ZSTR_VAL(filename), start_lineno, CG(rtd_key_counter)++); in zend_build_runtime_definition_key()
288 *prev_context = CG(context); in zend_oparray_context_begin()
289 CG(context).opcodes_size = INITIAL_OP_ARRAY_SIZE; in zend_oparray_context_begin()
290 CG(context).vars_size = 0; in zend_oparray_context_begin()
291 CG(context).literals_size = 0; in zend_oparray_context_begin()
292 CG(context).fast_call_var = -1; in zend_oparray_context_begin()
293 CG(context).try_catch_offset = -1; in zend_oparray_context_begin()
294 CG(context).current_brk_cont = -1; in zend_oparray_context_begin()
295 CG(context).last_brk_cont = 0; in zend_oparray_context_begin()
296 CG(context).brk_cont_array = NULL; in zend_oparray_context_begin()
297 CG(context).labels = NULL; in zend_oparray_context_begin()
303 if (CG(context).brk_cont_array) { in zend_oparray_context_end()
304 efree(CG(context).brk_cont_array); in zend_oparray_context_end()
305 CG(context).brk_cont_array = NULL; in zend_oparray_context_end()
307 if (CG(context).labels) { in zend_oparray_context_end()
308 zend_hash_destroy(CG(context).labels); in zend_oparray_context_end()
309 FREE_HASHTABLE(CG(context).labels); in zend_oparray_context_end()
310 CG(context).labels = NULL; in zend_oparray_context_end()
312 CG(context) = *prev_context; in zend_oparray_context_end()
350 *prev_context = CG(file_context); in zend_file_context_begin()
366 CG(file_context) = *prev_context; in zend_file_context_end()
372 zend_stack_init(&CG(loop_var_stack), sizeof(zend_loop_var)); in zend_init_compiler_data_structures()
373 zend_stack_init(&CG(delayed_oplines_stack), sizeof(zend_op)); in zend_init_compiler_data_structures()
374 zend_stack_init(&CG(short_circuiting_opnums), sizeof(uint32_t)); in zend_init_compiler_data_structures()
375 CG(active_class_entry) = NULL; in zend_init_compiler_data_structures()
376 CG(in_compilation) = 0; in zend_init_compiler_data_structures()
377 CG(skip_shebang) = 0; in zend_init_compiler_data_structures()
379 CG(encoding_declared) = 0; in zend_init_compiler_data_structures()
380 CG(memoized_exprs) = NULL; in zend_init_compiler_data_structures()
381 CG(memoize_mode) = 0; in zend_init_compiler_data_structures()
403 CG(arena) = zend_arena_create(64 * 1024); in init_compiler()
404 CG(active_op_array) = NULL; in init_compiler()
405 memset(&CG(context), 0, sizeof(CG(context))); in init_compiler()
409 CG(unclean_shutdown) = 0; in init_compiler()
411 CG(delayed_variance_obligations) = NULL; in init_compiler()
412 CG(delayed_autoloads) = NULL; in init_compiler()
413 CG(unlinked_uses) = NULL; in init_compiler()
414 CG(current_linking_class) = NULL; in init_compiler()
423 zend_stack_destroy(&CG(loop_var_stack)); in shutdown_compiler()
424 zend_stack_destroy(&CG(delayed_oplines_stack)); in shutdown_compiler()
425 zend_stack_destroy(&CG(short_circuiting_opnums)); in shutdown_compiler()
427 if (CG(delayed_variance_obligations)) { in shutdown_compiler()
428 zend_hash_destroy(CG(delayed_variance_obligations)); in shutdown_compiler()
429 FREE_HASHTABLE(CG(delayed_variance_obligations)); in shutdown_compiler()
430 CG(delayed_variance_obligations) = NULL; in shutdown_compiler()
432 if (CG(delayed_autoloads)) { in shutdown_compiler()
433 zend_hash_destroy(CG(delayed_autoloads)); in shutdown_compiler()
434 FREE_HASHTABLE(CG(delayed_autoloads)); in shutdown_compiler()
435 CG(delayed_autoloads) = NULL; in shutdown_compiler()
437 if (CG(unlinked_uses)) { in shutdown_compiler()
438 zend_hash_destroy(CG(unlinked_uses)); in shutdown_compiler()
439 FREE_HASHTABLE(CG(unlinked_uses)); in shutdown_compiler()
440 CG(unlinked_uses) = NULL; in shutdown_compiler()
442 CG(current_linking_class) = NULL; in shutdown_compiler()
448 CG(compiled_filename) = zend_string_copy(new_compiled_filename); in zend_set_compiled_filename()
455 if (CG(compiled_filename)) { in zend_restore_compiled_filename()
456 zend_string_release(CG(compiled_filename)); in zend_restore_compiled_filename()
457 CG(compiled_filename) = NULL; in zend_restore_compiled_filename()
459 CG(compiled_filename) = original_compiled_filename; in zend_restore_compiled_filename()
465 return CG(compiled_filename); in zend_get_compiled_filename()
471 return CG(zend_lineno); in zend_get_compiled_lineno()
477 return CG(in_compilation); in zend_is_compiling()
483 return (uint32_t)CG(active_op_array)->T++; in get_temporary_variable()
488 zend_op_array *op_array = CG(active_op_array); in lookup_cv()
501 if (op_array->last_var > CG(context).vars_size) { in lookup_cv()
502 CG(context).vars_size += 16; /* FIXME */ in lookup_cv()
503 op_array->vars = erealloc(op_array->vars, CG(context).vars_size * sizeof(zend_string*)); in lookup_cv()
538 zend_op_array *op_array = CG(active_op_array); in zend_add_literal()
541 if (i >= CG(context).literals_size) { in zend_add_literal()
542 while (i >= CG(context).literals_size) { in zend_add_literal()
543 CG(context).literals_size += 16; /* FIXME */ in zend_add_literal()
545 …op_array->literals = (zval*)erealloc(op_array->literals, CG(context).literals_size * sizeof(zval)); in zend_add_literal()
664 int parent = CG(context).current_brk_cont; in zend_begin_loop()
667 CG(context).current_brk_cont = CG(context).last_brk_cont; in zend_begin_loop()
686 zend_stack_push(&CG(loop_var_stack), &info); in zend_begin_loop()
694 = &CG(context).brk_cont_array[CG(context).current_brk_cont]; in zend_end_loop()
697 CG(context).current_brk_cont = brk_cont_element->parent; in zend_end_loop()
699 zend_stack_del_top(&CG(loop_var_stack)); in zend_end_loop()
706 zend_op *opline = &CG(active_op_array)->opcodes[CG(active_op_array)->last-1]; in zend_do_free()
750 zend_op *opline = &CG(active_op_array)->opcodes[CG(active_op_array)->last-1]; in zend_do_free()
765 while (opline >= CG(active_op_array)->opcodes) { in zend_do_free()
1025 zend_op_array *op_array = CG(active_op_array); in zend_add_try_element()
1046 zend_arena_alloc(&CG(arena), sizeof(HashTable *))); in zend_init_static_variables_map_ptr()
1059 ZEND_MAP_PTR_INIT(op_array->run_time_cache, zend_arena_alloc(&CG(arena), sizeof(void *))); in function_add_ref()
1073 …zval *zv = zend_hash_find_known_hash(compile_time ? CG(function_table) : EG(function_table), lcnam… in do_bind_function_error()
1114 (ce->ce_flags & ZEND_ACC_PRELOADED) && !(CG(compiler_options) & ZEND_COMPILE_PRELOAD); in zend_bind_class_in_slot()
1297 if (!CG(active_op_array)->function_name) { in zend_mark_function_as_generator()
1302 if (CG(active_op_array)->fn_flags & ZEND_ACC_HAS_RETURN_TYPE) { in zend_mark_function_as_generator()
1303 zend_type return_type = CG(active_op_array)->arg_info[-1].type; in zend_mark_function_as_generator()
1324 CG(active_op_array)->fn_flags |= ZEND_ACC_GENERATOR; in zend_mark_function_as_generator()
1353 bool orig_in_compilation = CG(in_compilation); in zend_do_delayed_early_binding()
1369 CG(in_compilation) = 1; in zend_do_delayed_early_binding()
1390 CG(in_compilation) = orig_in_compilation; in zend_do_delayed_early_binding()
1495 && !(CG(compiler_options) & ZEND_COMPILE_NO_PERSISTENT_CONSTANT_SUBSTITUTION) in can_ct_eval_const()
1497 && (CG(compiler_options) & ZEND_COMPILE_WITH_FILE_CACHE))) { in can_ct_eval_const()
1501 && !(CG(compiler_options) & ZEND_COMPILE_NO_CONSTANT_SUBSTITUTION)) { in can_ct_eval_const()
1504 && !(CG(compiler_options) & ZEND_COMPILE_NO_CONSTANT_SUBSTITUTION) in can_ct_eval_const()
1538 if (!CG(active_op_array)) { in zend_is_scope_known()
1543 if (CG(active_op_array)->fn_flags & ZEND_ACC_CLOSURE) { in zend_is_scope_known()
1548 if (!CG(active_class_entry)) { in zend_is_scope_known()
1551 return CG(active_op_array)->function_name != NULL; in zend_is_scope_known()
1555 return (CG(active_class_entry)->ce_flags & ZEND_ACC_TRAIT) == 0; in zend_is_scope_known()
1561 if (!CG(active_class_entry)) { in class_name_refers_to_active_ce()
1568 && zend_string_equals_ci(class_name, CG(active_class_entry)->name); in class_name_refers_to_active_ce()
1611 zend_class_entry *ce = CG(active_class_entry); in zend_ensure_valid_class_fetch_type()
1644 if (CG(active_class_entry) && zend_is_scope_known()) { in zend_try_compile_const_expr_resolve_class_name()
1645 ZVAL_STR_COPY(zv, CG(active_class_entry)->name); in zend_try_compile_const_expr_resolve_class_name()
1650 if (CG(active_class_entry) && CG(active_class_entry)->parent_name in zend_try_compile_const_expr_resolve_class_name()
1652 ZVAL_STR_COPY(zv, CG(active_class_entry)->parent_name); in zend_try_compile_const_expr_resolve_class_name()
1685 ce = zend_hash_find_ptr_lc(CG(class_table), ce->parent_name); in zend_verify_ct_const_access()
1703 cc = zend_hash_find_ptr(&CG(active_class_entry)->constants_table, name); in zend_try_ct_eval_class_const()
1704 …} else if (fetch_type == ZEND_FETCH_CLASS_DEFAULT && !(CG(compiler_options) & ZEND_COMPILE_NO_CONS… in zend_try_ct_eval_class_const()
1705 zend_class_entry *ce = zend_hash_find_ptr_lc(CG(class_table), class_name); in zend_try_ct_eval_class_const()
1715 if (CG(compiler_options) & ZEND_COMPILE_NO_PERSISTENT_CONSTANT_SUBSTITUTION) { in zend_try_ct_eval_class_const()
1719 if (!cc || !zend_verify_ct_const_access(cc, CG(active_class_entry))) { in zend_try_ct_eval_class_const()
1762 if (!(CG(compiler_options) & ZEND_COMPILE_EXTENDED_STMT)) { in zend_do_extended_stmt()
1776 if (!(CG(compiler_options) & ZEND_COMPILE_EXTENDED_FCALL)) { in zend_do_extended_fcall_begin()
1790 if (!(CG(compiler_options) & ZEND_COMPILE_EXTENDED_FCALL)) { in zend_do_extended_fcall_end()
1803 if ((auto_global = zend_hash_str_find_ptr(CG(auto_globals), name, len)) != NULL) { in zend_is_auto_global_str()
1817 if ((auto_global = zend_hash_find_ptr(CG(auto_globals), name)) != NULL) { in zend_is_auto_global()
1836 …retval = zend_hash_add_mem(CG(auto_globals), auto_global.name, &auto_global, sizeof(zend_auto_glob… in zend_register_auto_global()
1846 ZEND_HASH_FOREACH_PTR(CG(auto_globals), auto_global) { in zend_activate_auto_globals()
1863 if (CG(increment_lineno)) { in zendlex()
1864 CG(zend_lineno)++; in zendlex()
1865 CG(increment_lineno) = 0; in zendlex()
1882 if (CG(compiler_options) & ZEND_COMPILE_GUARDS) { in zend_initialize_class_data()
2158 …if (CG(active_op_array)->last && CG(active_op_array)->opcodes[CG(active_op_array)->last - 1].opcod… in zend_emit_tick()
2218 opline = CG(active_op_array)->opcodes + opnum - 1; in zend_emit_cond_jump()
2238 zend_op *opline = &CG(active_op_array)->opcodes[opnum_jump]; in zend_update_jump_target()
2280 zend_stack_push(&CG(delayed_oplines_stack), &tmp_opline); in zend_delayed_emit_op()
2281 return zend_stack_top(&CG(delayed_oplines_stack)); in zend_delayed_emit_op()
2287 return zend_stack_count(&CG(delayed_oplines_stack)); in zend_delayed_compile_begin()
2293 zend_op *opline = NULL, *oplines = zend_stack_base(&CG(delayed_oplines_stack)); in zend_delayed_compile_end()
2294 uint32_t i, count = zend_stack_count(&CG(delayed_oplines_stack)); in zend_delayed_compile_end()
2302 opline = CG(active_op_array)->opcodes + oplines[i].extended_value; in zend_delayed_compile_end()
2306 CG(delayed_oplines_stack).top = offset; in zend_delayed_compile_end()
2358 return zend_stack_count(&CG(short_circuiting_opnums)); in zend_short_circuiting_checkpoint()
2366 ZEND_ASSERT(zend_stack_count(&CG(short_circuiting_opnums)) == checkpoint in zend_short_circuiting_commit()
2376 while (zend_stack_count(&CG(short_circuiting_opnums)) != checkpoint) { in zend_short_circuiting_commit()
2377 uint32_t opnum = *(uint32_t *) zend_stack_top(&CG(short_circuiting_opnums)); in zend_short_circuiting_commit()
2378 zend_op *opline = &CG(active_op_array)->opcodes[opnum]; in zend_short_circuiting_commit()
2385 zend_stack_del_top(&CG(short_circuiting_opnums)); in zend_short_circuiting_commit()
2396 zend_stack_push(&CG(short_circuiting_opnums), &jmp_null_opnum); in zend_emit_jmp_null()
2405 int memoize_mode = CG(memoize_mode); in zend_compile_memoized_expr()
2410 CG(memoize_mode) = ZEND_MEMOIZE_NONE; in zend_compile_memoized_expr()
2412 CG(memoize_mode) = ZEND_MEMOIZE_COMPILE; in zend_compile_memoized_expr()
2426 CG(memoized_exprs), (uintptr_t) expr, &memoized_result, sizeof(znode)); in zend_compile_memoized_expr()
2428 znode *memoized_result = zend_hash_index_find_ptr(CG(memoized_exprs), (uintptr_t) expr); in zend_compile_memoized_expr()
2515 bool returns_reference = (CG(active_op_array)->fn_flags & ZEND_ACC_RETURN_REFERENCE) != 0; in zend_emit_final_return()
2517 if ((CG(active_op_array)->fn_flags & ZEND_ACC_HAS_RETURN_TYPE) in zend_emit_final_return()
2518 && !(CG(active_op_array)->fn_flags & ZEND_ACC_GENERATOR)) { in zend_emit_final_return()
2519 zend_arg_info *return_info = CG(active_op_array)->arg_info - 1; in zend_emit_final_return()
2785 zend_op_array *op_array = CG(active_op_array); in this_guaranteed_exists()
2801 CG(active_op_array)->fn_flags |= ZEND_ACC_USES_THIS; in zend_compile_simple_var()
2925 CG(active_op_array)->fn_flags |= ZEND_ACC_USES_THIS; in zend_delayed_compile_prop()
2936 zend_op *opline = NULL, *oplines = zend_stack_base(&CG(delayed_oplines_stack)); in zend_delayed_compile_prop()
2938 uint32_t count = zend_stack_count(&CG(delayed_oplines_stack)); in zend_delayed_compile_prop()
2954 oplines[i].extended_value = opline - CG(active_op_array)->opcodes; in zend_delayed_compile_prop()
3255 CG(zend_lineno) = zend_ast_get_lineno(var_ast); in zend_compile_assign()
3620 CG(zend_lineno) = zend_ast_get_lineno(ast); in zend_compile_args()
3624 CG(active_op_array)->fn_flags |= ZEND_ACC_USES_THIS; in zend_compile_args()
3702 …if (fbc->type == ZEND_INTERNAL_FUNCTION && !(CG(compiler_options) & ZEND_COMPILE_IGNORE_INTERNAL_F… in zend_get_call_op()
3710 } else if (!(CG(compiler_options) & ZEND_COMPILE_IGNORE_USER_FUNCTIONS)){ in zend_get_call_op()
3731 opline = &CG(active_op_array)->opcodes[opnum_init]; in zend_compile_call_common()
3751 opline = &CG(active_op_array)->opcodes[opnum_init]; in zend_compile_call_common()
4000 fbc = zend_hash_find_ptr(CG(function_table), lcname); in zend_try_compile_ct_bound_init_user_func()
4002 …|| (fbc->type == ZEND_INTERNAL_FUNCTION && (CG(compiler_options) & ZEND_COMPILE_IGNORE_INTERNAL_FU… in zend_try_compile_ct_bound_init_user_func()
4003 …|| (fbc->type == ZEND_USER_FUNCTION && (CG(compiler_options) & ZEND_COMPILE_IGNORE_USER_FUNCTIONS)) in zend_try_compile_ct_bound_init_user_func()
4004 …->type == ZEND_USER_FUNCTION && (CG(compiler_options) & ZEND_COMPILE_IGNORE_OTHER_FILES) && fbc->o… in zend_try_compile_ct_bound_init_user_func()
4156 opline = &CG(active_op_array)->opcodes[check_op_number]; in zend_compile_assert()
4316 if (CG(active_op_array)->function_name && args->children == 0) { in zend_compile_func_num_args()
4327 if (CG(active_op_array)->function_name && args->children == 0) { in zend_compile_func_get_args()
4354 if (CG(active_op_array)->function_name in zend_compile_func_array_slice()
4387 if (CG(compiler_options) & ZEND_COMPILE_NO_BUILTINS) { in zend_try_compile_special_func()
4490 if (CG(memoize_mode) == ZEND_MEMOIZE_NONE) { in zend_compile_call()
4512 fbc = zend_hash_find_ptr(CG(function_table), lcname); in zend_compile_call()
4516 if (CG(memoize_mode) == ZEND_MEMOIZE_NONE) { in zend_compile_call()
4530 …|| (fbc->type == ZEND_INTERNAL_FUNCTION && (CG(compiler_options) & ZEND_COMPILE_IGNORE_INTERNAL_FU… in zend_compile_call()
4531 …|| (fbc->type == ZEND_USER_FUNCTION && (CG(compiler_options) & ZEND_COMPILE_IGNORE_USER_FUNCTIONS)) in zend_compile_call()
4532 …->type == ZEND_USER_FUNCTION && (CG(compiler_options) & ZEND_COMPILE_IGNORE_OTHER_FILES) && fbc->o… in zend_compile_call()
4577 CG(active_op_array)->fn_flags |= ZEND_ACC_USES_THIS; in zend_compile_method_call()
4607 CG(active_class_entry) && zend_is_scope_known()) { in zend_compile_method_call()
4609 fbc = zend_hash_find_ptr(&CG(active_class_entry)->function_table, lcname); in zend_compile_method_call()
4636 if (!fbc || (fbc->common.fn_flags & ZEND_ACC_PUBLIC) || ce == CG(active_class_entry)) { in zend_get_compatible_func_or_null()
4642 && (!CG(active_class_entry) || (CG(active_class_entry)->ce_flags & ZEND_ACC_LINKED)) in zend_get_compatible_func_or_null()
4643 && zend_check_protected(zend_get_function_root_class(fbc), CG(active_class_entry))) { in zend_get_compatible_func_or_null()
4699 ce = zend_hash_find_ptr(CG(class_table), lcname); in zend_compile_static_call()
4700 if (!ce && CG(active_class_entry) in zend_compile_static_call()
4701 && zend_string_equals_ci(CG(active_class_entry)->name, lcname)) { in zend_compile_static_call()
4702 ce = CG(active_class_entry); in zend_compile_static_call()
4707 ce = CG(active_class_entry); in zend_compile_static_call()
4803 if (!CG(active_op_array)->static_variables) { in zend_compile_static_var_common()
4804 if (CG(active_op_array)->scope) { in zend_compile_static_var_common()
4805 CG(active_op_array)->scope->ce_flags |= ZEND_HAS_STATIC_IN_METHODS; in zend_compile_static_var_common()
4807 CG(active_op_array)->static_variables = zend_new_array(8); in zend_compile_static_var_common()
4810 value = zend_hash_update(CG(active_op_array)->static_variables, var_name, value); in zend_compile_static_var_common()
4819 …opline->extended_value = (uint32_t)((char*)value - (char*)CG(active_op_array)->static_variables->a… in zend_compile_static_var_common()
4894 zend_loop_var *loop_var = zend_stack_top(&CG(loop_var_stack)); in zend_handle_loops_and_finally_ex()
4899 base = zend_stack_base(&CG(loop_var_stack)); in zend_handle_loops_and_finally_ex()
4942 return zend_handle_loops_and_finally_ex(zend_stack_count(&CG(loop_var_stack)) + 1, return_value); in zend_handle_loops_and_finally()
4949 zend_loop_var *loop_var = zend_stack_top(&CG(loop_var_stack)); in zend_has_finally_ex()
4954 base = zend_stack_base(&CG(loop_var_stack)); in zend_has_finally_ex()
4974 return zend_has_finally_ex(zend_stack_count(&CG(loop_var_stack)) + 1); in zend_has_finally()
4981 bool is_generator = (CG(active_op_array)->fn_flags & ZEND_ACC_GENERATOR) != 0; in zend_compile_return()
4982 bool by_ref = (CG(active_op_array)->fn_flags & ZEND_ACC_RETURN_REFERENCE) != 0; in zend_compile_return()
5005 if ((CG(active_op_array)->fn_flags & ZEND_ACC_HAS_FINALLY_BLOCK) in zend_compile_return()
5017 if (!is_generator && (CG(active_op_array)->fn_flags & ZEND_ACC_HAS_RETURN_TYPE)) { in zend_compile_return()
5019 expr_ast ? &expr_node : NULL, CG(active_op_array)->arg_info - 1, 0); in zend_compile_return()
5094 if (CG(context).current_brk_cont == -1) { in zend_compile_break_continue()
5106 int d, cur = CG(context).current_brk_cont; in zend_compile_break_continue()
5108 cur = CG(context).brk_cont_array[cur].parent; in zend_compile_break_continue()
5112 if (CG(context).brk_cont_array[cur].is_switch) { in zend_compile_break_continue()
5114 if (CG(context).brk_cont_array[cur].parent == -1) { in zend_compile_break_continue()
5124 if (CG(context).brk_cont_array[cur].parent == -1) { in zend_compile_break_continue()
5139 opline->op1.num = CG(context).current_brk_cont; in zend_compile_break_continue()
5152 if (CG(context).labels == NULL || in zend_resolve_goto_label()
5153 (dest = zend_hash_find_ptr(CG(context).labels, Z_STR_P(label))) == NULL in zend_resolve_goto_label()
5155 CG(in_compilation) = 1; in zend_resolve_goto_label()
5156 CG(active_op_array) = op_array; in zend_resolve_goto_label()
5157 CG(zend_lineno) = opline->lineno; in zend_resolve_goto_label()
5165 for (; current != dest->brk_cont; current = CG(context).brk_cont_array[current].parent) { in zend_resolve_goto_label()
5167 CG(in_compilation) = 1; in zend_resolve_goto_label()
5168 CG(active_op_array) = op_array; in zend_resolve_goto_label()
5169 CG(zend_lineno) = opline->lineno; in zend_resolve_goto_label()
5172 if (CG(context).brk_cont_array[current].start >= 0) { in zend_resolve_goto_label()
5218 opline->extended_value = CG(context).current_brk_cont; in zend_compile_goto()
5227 if (!CG(context).labels) { in zend_compile_label()
5228 ALLOC_HASHTABLE(CG(context).labels); in zend_compile_label()
5229 zend_hash_init(CG(context).labels, 8, NULL, label_ptr_dtor, 0); in zend_compile_label()
5232 dest.brk_cont = CG(context).current_brk_cont; in zend_compile_label()
5235 if (!zend_hash_add_mem(CG(context).labels, label, &dest, sizeof(zend_label))) { in zend_compile_label()
5410 opline = &CG(active_op_array)->opcodes[opnum_fetch]; in zend_compile_foreach()
5420 CG(zend_lineno) = ast->lineno; in zend_compile_foreach()
5423 opline = &CG(active_op_array)->opcodes[opnum_reset]; in zend_compile_foreach()
5426 opline = &CG(active_op_array)->opcodes[opnum_fetch]; in zend_compile_foreach()
5455 CG(zend_lineno) = cond_ast->lineno; in zend_compile_if()
5526 if (CG(compiler_options) & ZEND_COMPILE_NO_JUMPTABLES) { in should_use_jumptable()
5576 opnum_switch = opline - CG(active_op_array)->opcodes; in zend_compile_switch()
5587 CG(zend_lineno) = case_ast->lineno; in zend_compile_switch()
5644 opline = &CG(active_op_array)->opcodes[opnum_switch]; in zend_compile_switch()
5656 opline = &CG(active_op_array)->opcodes[opnum_switch]; in zend_compile_switch()
5743 CG(zend_lineno) = arm_ast->lineno; in zend_compile_match()
5763 opnum_match = opline - CG(active_op_array)->opcodes; in zend_compile_match()
5812 zend_op *opline = &CG(active_op_array)->opcodes[opnum_match]; in zend_compile_match()
5858 zend_op *opline = &CG(active_op_array)->opcodes[opnum_match]; in zend_compile_match()
5910 uint32_t orig_fast_call_var = CG(context).fast_call_var; in zend_compile_try()
5911 uint32_t orig_try_catch_offset = CG(context).try_catch_offset; in zend_compile_try()
5918 if (CG(context).labels) { in zend_compile_try()
5920 ZEND_HASH_REVERSE_FOREACH_PTR(CG(context).labels, label) { in zend_compile_try()
5932 if (!(CG(active_op_array)->fn_flags & ZEND_ACC_HAS_FINALLY_BLOCK)) { in zend_compile_try()
5933 CG(active_op_array)->fn_flags |= ZEND_ACC_HAS_FINALLY_BLOCK; in zend_compile_try()
5935 CG(context).fast_call_var = get_temporary_variable(); in zend_compile_try()
5940 fast_call.var_num = CG(context).fast_call_var; in zend_compile_try()
5942 zend_stack_push(&CG(loop_var_stack), &fast_call); in zend_compile_try()
5945 CG(context).try_catch_offset = try_catch_offset; in zend_compile_try()
5964 CG(zend_lineno) = catch_ast->lineno; in zend_compile_try()
5976 CG(active_op_array)->try_catch_array[try_catch_offset].catch_op = opnum_catch; in zend_compile_try()
5999 opline = &CG(active_op_array)->opcodes[opnum_catch]; in zend_compile_try()
6017 opline = &CG(active_op_array)->opcodes[opnum_catch]; in zend_compile_try()
6032 zend_stack_del_top(&CG(loop_var_stack)); in zend_compile_try()
6037 discard_exception.var_num = CG(context).fast_call_var; in zend_compile_try()
6038 zend_stack_push(&CG(loop_var_stack), &discard_exception); in zend_compile_try()
6040 CG(zend_lineno) = finally_ast->lineno; in zend_compile_try()
6045 opline->result.var = CG(context).fast_call_var; in zend_compile_try()
6051 CG(active_op_array)->try_catch_array[try_catch_offset].finally_op = opnum_jmp + 1; in zend_compile_try()
6052 CG(active_op_array)->try_catch_array[try_catch_offset].finally_end in zend_compile_try()
6057 opline->op1.var = CG(context).fast_call_var; in zend_compile_try()
6062 CG(context).fast_call_var = orig_fast_call_var; in zend_compile_try()
6065 zend_stack_del_top(&CG(loop_var_stack)); in zend_compile_try()
6068 CG(context).try_catch_offset = orig_try_catch_offset; in zend_compile_try()
6091 if (CG(multibyte)) { in zend_handle_encoding_declaration()
6097 CG(encoding_declared) = 1; in zend_handle_encoding_declaration()
6130 zend_ast_list *file_ast = zend_ast_get_list(CG(ast)); in zend_is_first_statement()
6196 CG(active_op_array)->fn_flags |= ZEND_ACC_STRICT_TYPES; in zend_compile_declare()
6251 if (ast->attr == IS_STATIC && !CG(active_class_entry) && zend_is_scope_known()) { in zend_compile_single_typename()
6387 &CG(arena), ZEND_TYPE_LIST_SIZE(type_list->num_types)); in zend_compile_typename()
6402 type_list = zend_arena_alloc(&CG(arena), ZEND_TYPE_LIST_SIZE(list->children)); in zend_compile_typename()
6547 uint32_t flags = (CG(active_op_array)->fn_flags & ZEND_ACC_STRICT_TYPES) in zend_compile_attributes()
6613 config->validator(attr, target, CG(active_class_entry)); in zend_compile_attributes()
6623 zend_op_array *op_array = CG(active_op_array); in zend_compile_params()
6710 uint32_t cops = CG(compiler_options); in zend_compile_params()
6711CG(compiler_options) |= ZEND_COMPILE_NO_CONSTANT_SUBSTITUTION | ZEND_COMPILE_NO_PERSISTENT_CONSTAN… in zend_compile_params()
6716 CG(compiler_options) = cops; in zend_compile_params()
6806 zend_op_array *op_array = CG(active_op_array); in zend_compile_params()
6933 CG(zend_lineno) = zend_ast_get_lineno(var_name_ast); in zend_compile_closure_binding()
7047 zend_op_array *op_array = CG(active_op_array); in zend_compile_closure_uses()
7068 CG(zend_lineno) = zend_ast_get_lineno(var_ast); in zend_compile_closure_uses()
7109 zend_class_entry *ce = CG(active_class_entry); in zend_begin_method_decl()
7178 zend_op_array *op_array = CG(active_op_array); in zend_add_dynamic_func_def()
7246 zend_class_entry *orig_class_entry = CG(active_class_entry); in zend_compile_func_decl()
7247 zend_op_array *orig_op_array = CG(active_op_array); in zend_compile_func_decl()
7248 zend_op_array *op_array = zend_arena_alloc(&CG(arena), sizeof(zend_op_array)); in zend_compile_func_decl()
7255 if (CG(compiler_options) & ZEND_COMPILE_PRELOAD) { in zend_compile_func_decl()
7259 ZEND_MAP_PTR_INIT(op_array->run_time_cache, zend_arena_alloc(&CG(arena), sizeof(void *))); in zend_compile_func_decl()
7287 CG(active_op_array) = op_array; in zend_compile_func_decl()
7303 CG(active_class_entry) = NULL; in zend_compile_func_decl()
7317 zend_stack_push(&CG(loop_var_stack), (void *) &dummy_var); in zend_compile_func_decl()
7322 if (CG(active_op_array)->fn_flags & ZEND_ACC_GENERATOR) { in zend_compile_func_decl()
7335 CG(zend_lineno) = decl->start_lineno; in zend_compile_func_decl()
7337 CG(active_class_entry), (zend_function *) op_array, lcname, E_COMPILE_ERROR); in zend_compile_func_decl()
7340 if (UNEXPECTED(zend_hash_add_ptr(CG(function_table), lcname, op_array) == NULL)) { in zend_compile_func_decl()
7347 CG(zend_lineno) = decl->end_lineno; in zend_compile_func_decl()
7353 pass_two(CG(active_op_array)); in zend_compile_func_decl()
7357 zend_stack_del_top(&CG(loop_var_stack)); in zend_compile_func_decl()
7359 CG(active_op_array) = orig_op_array; in zend_compile_func_decl()
7360 CG(active_class_entry) = orig_class_entry; in zend_compile_func_decl()
7367 zend_class_entry *ce = CG(active_class_entry); in zend_compile_prop_decl()
7500 zend_class_entry *ce = CG(active_class_entry); in zend_compile_class_const_decl()
7580 zend_add_to_list(&CG(active_class_entry)->trait_precedences, precedence); in zend_compile_trait_precedence()
7604 zend_add_to_list(&CG(active_class_entry)->trait_aliases, alias); in zend_compile_trait_alias()
7612 zend_class_entry *ce = CG(active_class_entry); in zend_compile_use_trait()
7654 zend_class_entry *ce = CG(active_class_entry); in zend_compile_implements()
7674 zend_string *filename = CG(active_op_array)->filename; in zend_generate_anon_class_name()
7687 ZSTR_VAL(prefix), '\0', ZSTR_VAL(filename), start_lineno, CG(rtd_key_counter)++); in zend_generate_anon_class_name()
7723 zend_class_entry *ce = zend_arena_alloc(&CG(arena), sizeof(zend_class_entry)); in zend_compile_class_decl()
7726 zend_class_entry *original_ce = CG(active_class_entry); in zend_compile_class_decl()
7731 if (CG(active_class_entry)) { in zend_compile_class_decl()
7759 } while (zend_hash_exists(CG(class_table), lcname)); in zend_compile_class_decl()
7770 if (CG(compiler_options) & ZEND_COMPILE_PRELOAD) { in zend_compile_class_decl()
7795 CG(active_class_entry) = ce; in zend_compile_class_decl()
7816 CG(zend_lineno) = ast->lineno; in zend_compile_class_decl()
7822 CG(active_class_entry) = original_ce; in zend_compile_class_decl()
7830 && !(CG(compiler_options) & ZEND_COMPILE_WITHOUT_EXECUTION)) { in zend_compile_class_decl()
7837 …&& ((parent_ce->type != ZEND_INTERNAL_CLASS) || !(CG(compiler_options) & ZEND_COMPILE_IGNORE_INTER… in zend_compile_class_decl()
7838 …&& ((parent_ce->type != ZEND_USER_CLASS) || !(CG(compiler_options) & ZEND_COMPILE_IGNORE_OTHER_FIL… in zend_compile_class_decl()
7845 } else if (EXPECTED(zend_hash_add_ptr(CG(class_table), lcname, ce) != NULL)) { in zend_compile_class_decl()
7874 if (!zend_hash_add_ptr(CG(class_table), lcname, ce)) { in zend_compile_class_decl()
7885 } while (!zend_hash_add_ptr(CG(class_table), key, ce)); in zend_compile_class_decl()
7892 && (CG(compiler_options) & ZEND_COMPILE_DELAYED_BINDING) in zend_compile_class_decl()
7896 CG(active_op_array)->fn_flags |= ZEND_ACC_EARLY_BINDING; in zend_compile_class_decl()
7908 zend_class_entry *enum_class = CG(active_class_entry); in zend_compile_enum_case()
8286 zend_op_array *op_array = CG(active_op_array); in zend_try_ct_eval_magic_const()
8287 zend_class_entry *ce = CG(active_class_entry); in zend_try_ct_eval_magic_const()
8294 ZVAL_STR_COPY(zv, CG(compiled_filename)); in zend_try_ct_eval_magic_const()
8298 zend_string *filename = CG(compiled_filename); in zend_try_ct_eval_magic_const()
8529 CG(zend_lineno) = zend_ast_get_lineno(last_elem_ast); in zend_try_ct_eval_array()
9027 opline = &CG(active_op_array)->opcodes[opnum]; in zend_compile_coalesce()
9052 HashTable *orig_memoized_exprs = CG(memoized_exprs); in zend_compile_assign_coalesce()
9053 int orig_memoize_mode = CG(memoize_mode); in zend_compile_assign_coalesce()
9060 ALLOC_HASHTABLE(CG(memoized_exprs)); in zend_compile_assign_coalesce()
9061 zend_hash_init(CG(memoized_exprs), 0, NULL, znode_dtor, 0); in zend_compile_assign_coalesce()
9063 CG(memoize_mode) = ZEND_MEMOIZE_COMPILE; in zend_compile_assign_coalesce()
9069 CG(memoize_mode) = ZEND_MEMOIZE_NONE; in zend_compile_assign_coalesce()
9076 CG(memoize_mode) = ZEND_MEMOIZE_FETCH; in zend_compile_assign_coalesce()
9080 opline = &CG(active_op_array)->opcodes[CG(active_op_array)->last-1]; in zend_compile_assign_coalesce()
9115 ZEND_HASH_FOREACH_PTR(CG(memoized_exprs), node) { in zend_compile_assign_coalesce()
9126 ZEND_HASH_FOREACH_PTR(CG(memoized_exprs), node) { in zend_compile_assign_coalesce()
9136 zend_hash_destroy(CG(memoized_exprs)); in zend_compile_assign_coalesce()
9137 FREE_HASHTABLE(CG(memoized_exprs)); in zend_compile_assign_coalesce()
9138 CG(memoized_exprs) = orig_memoized_exprs; in zend_compile_assign_coalesce()
9139 CG(memoize_mode) = orig_memoize_mode; in zend_compile_assign_coalesce()
9188 bool returns_by_ref = (CG(active_op_array)->fn_flags & ZEND_ACC_RETURN_REFERENCE) != 0; in zend_compile_yield()
9221 if (CG(active_op_array)->fn_flags & ZEND_ACC_RETURN_REFERENCE) { in zend_compile_yield_from()
9328 CG(active_op_array)->fn_flags |= ZEND_ACC_USES_THIS; in zend_compile_isset_or_empty()
9469 opline = &CG(active_op_array)->opcodes[opnum_init]; in zend_compile_array()
9486 zend_ast *last = CG(ast); in zend_compile_const()
9666 opline = &CG(active_op_array)->opcodes[reserved_op_number]; in zend_compile_encaps_list()
9682 CG(active_op_array)->last = reserved_op_number - 1; in zend_compile_encaps_list()
9685 opline = &CG(active_op_array)->opcodes[reserved_op_number]; in zend_compile_encaps_list()
9688 init_opline = CG(active_op_array)->opcodes + rope_init_lineno; in zend_compile_encaps_list()
9749 CG(active_class_entry) && in zend_compile_magic_const()
9750 (CG(active_class_entry)->ce_flags & ZEND_ACC_TRAIT) != 0); in zend_compile_magic_const()
10004 CG(zend_lineno) = ast->lineno; in zend_compile_top_stmt()
10006 CG(zend_lineno) = ((zend_ast_decl *) ast)->end_lineno; in zend_compile_top_stmt()
10008 CG(zend_lineno) = ast->lineno; in zend_compile_top_stmt()
10010 CG(zend_lineno) = ((zend_ast_decl *) ast)->end_lineno; in zend_compile_top_stmt()
10026 CG(zend_lineno) = ast->lineno; in zend_compile_stmt()
10028 if ((CG(compiler_options) & ZEND_COMPILE_EXTENDED_STMT) && !zend_is_unticked_stmt(ast)) { in zend_compile_stmt()
10140 CG(zend_lineno) = zend_ast_get_lineno(ast); in zend_compile_expr_inner()
10142 if (CG(memoize_mode) != ZEND_MEMOIZE_NONE) { in zend_compile_expr_inner()
10290 CG(zend_lineno) = zend_ast_get_lineno(ast); in zend_compile_var_inner()