Lines Matching refs:CG

57 #define FC(member) (CG(file_context).member)
74 zend_op_array *op_array = CG(active_op_array); in zend_alloc_cache_slots()
126 op->lineno = CG(zend_lineno); in init_op()
131 return CG(active_op_array)->last; in get_next_op_number()
136 zend_op_array *op_array = CG(active_op_array); in get_next_op()
140 if (UNEXPECTED(next_op_num >= CG(context).opcodes_size)) { in get_next_op()
141 CG(context).opcodes_size *= 4; in get_next_op()
142 op_array->opcodes = erealloc(op_array->opcodes, CG(context).opcodes_size * sizeof(zend_op)); in get_next_op()
154 CG(context).last_brk_cont++; in get_next_brk_cont_element()
155CG(context).brk_cont_array = erealloc(CG(context).brk_cont_array, sizeof(zend_brk_cont_element) * in get_next_brk_cont_element()
156 return &CG(context).brk_cont_array[CG(context).last_brk_cont-1]; in get_next_brk_cont_element()
161 zend_string *filename = CG(active_op_array)->filename; in zend_build_runtime_definition_key()
163 '\0', ZSTR_VAL(name), ZSTR_VAL(filename), start_lineno, CG(rtd_key_counter)++); in zend_build_runtime_definition_key()
309 *prev_context = CG(context); in zend_oparray_context_begin()
310 CG(context).opcodes_size = INITIAL_OP_ARRAY_SIZE; in zend_oparray_context_begin()
311 CG(context).vars_size = 0; in zend_oparray_context_begin()
312 CG(context).literals_size = 0; in zend_oparray_context_begin()
313 CG(context).fast_call_var = -1; in zend_oparray_context_begin()
314 CG(context).try_catch_offset = -1; in zend_oparray_context_begin()
315 CG(context).current_brk_cont = -1; in zend_oparray_context_begin()
316 CG(context).last_brk_cont = 0; in zend_oparray_context_begin()
317 CG(context).brk_cont_array = NULL; in zend_oparray_context_begin()
318 CG(context).labels = NULL; in zend_oparray_context_begin()
324 if (CG(context).brk_cont_array) { in zend_oparray_context_end()
325 efree(CG(context).brk_cont_array); in zend_oparray_context_end()
326 CG(context).brk_cont_array = NULL; in zend_oparray_context_end()
328 if (CG(context).labels) { in zend_oparray_context_end()
329 zend_hash_destroy(CG(context).labels); in zend_oparray_context_end()
330 FREE_HASHTABLE(CG(context).labels); in zend_oparray_context_end()
331 CG(context).labels = NULL; in zend_oparray_context_end()
333 CG(context) = *prev_context; in zend_oparray_context_end()
371 *prev_context = CG(file_context); in zend_file_context_begin()
387 CG(file_context) = *prev_context; in zend_file_context_end()
393 zend_stack_init(&CG(loop_var_stack), sizeof(zend_loop_var)); in zend_init_compiler_data_structures()
394 zend_stack_init(&CG(delayed_oplines_stack), sizeof(zend_op)); in zend_init_compiler_data_structures()
395 zend_stack_init(&CG(short_circuiting_opnums), sizeof(uint32_t)); in zend_init_compiler_data_structures()
396 CG(active_class_entry) = NULL; in zend_init_compiler_data_structures()
397 CG(in_compilation) = 0; in zend_init_compiler_data_structures()
398 CG(skip_shebang) = 0; in zend_init_compiler_data_structures()
400 CG(encoding_declared) = 0; in zend_init_compiler_data_structures()
401 CG(memoized_exprs) = NULL; in zend_init_compiler_data_structures()
402 CG(memoize_mode) = ZEND_MEMOIZE_NONE; in zend_init_compiler_data_structures()
424 CG(arena) = zend_arena_create(64 * 1024); in init_compiler()
425 CG(active_op_array) = NULL; in init_compiler()
426 memset(&CG(context), 0, sizeof(CG(context))); in init_compiler()
430 CG(unclean_shutdown) = 0; in init_compiler()
432 CG(delayed_variance_obligations) = NULL; in init_compiler()
433 CG(delayed_autoloads) = NULL; in init_compiler()
434 CG(unlinked_uses) = NULL; in init_compiler()
435 CG(current_linking_class) = NULL; in init_compiler()
444 zend_stack_destroy(&CG(loop_var_stack)); in shutdown_compiler()
445 zend_stack_destroy(&CG(delayed_oplines_stack)); in shutdown_compiler()
446 zend_stack_destroy(&CG(short_circuiting_opnums)); in shutdown_compiler()
448 if (CG(delayed_variance_obligations)) { in shutdown_compiler()
449 zend_hash_destroy(CG(delayed_variance_obligations)); in shutdown_compiler()
450 FREE_HASHTABLE(CG(delayed_variance_obligations)); in shutdown_compiler()
451 CG(delayed_variance_obligations) = NULL; in shutdown_compiler()
453 if (CG(delayed_autoloads)) { in shutdown_compiler()
454 zend_hash_destroy(CG(delayed_autoloads)); in shutdown_compiler()
455 FREE_HASHTABLE(CG(delayed_autoloads)); in shutdown_compiler()
456 CG(delayed_autoloads) = NULL; in shutdown_compiler()
458 if (CG(unlinked_uses)) { in shutdown_compiler()
459 zend_hash_destroy(CG(unlinked_uses)); in shutdown_compiler()
460 FREE_HASHTABLE(CG(unlinked_uses)); in shutdown_compiler()
461 CG(unlinked_uses) = NULL; in shutdown_compiler()
463 CG(current_linking_class) = NULL; in shutdown_compiler()
469 CG(compiled_filename) = zend_string_copy(new_compiled_filename); in zend_set_compiled_filename()
476 if (CG(compiled_filename)) { in zend_restore_compiled_filename()
477 zend_string_release(CG(compiled_filename)); in zend_restore_compiled_filename()
478 CG(compiled_filename) = NULL; in zend_restore_compiled_filename()
480 CG(compiled_filename) = original_compiled_filename; in zend_restore_compiled_filename()
486 return CG(compiled_filename); in zend_get_compiled_filename()
492 return CG(zend_lineno); in zend_get_compiled_lineno()
498 return CG(in_compilation); in zend_is_compiling()
504 return (uint32_t)CG(active_op_array)->T++; in get_temporary_variable()
509 zend_op_array *op_array = CG(active_op_array); in lookup_cv()
522 if (op_array->last_var > CG(context).vars_size) { in lookup_cv()
523 CG(context).vars_size += 16; /* FIXME */ in lookup_cv()
524 op_array->vars = erealloc(op_array->vars, CG(context).vars_size * sizeof(zend_string*)); in lookup_cv()
559 zend_op_array *op_array = CG(active_op_array); in zend_add_literal()
562 if (i >= CG(context).literals_size) { in zend_add_literal()
563 while (i >= CG(context).literals_size) { in zend_add_literal()
564 CG(context).literals_size += 16; /* FIXME */ in zend_add_literal()
566 …op_array->literals = (zval*)erealloc(op_array->literals, CG(context).literals_size * sizeof(zval)); in zend_add_literal()
685 int parent = CG(context).current_brk_cont; in zend_begin_loop()
688 CG(context).current_brk_cont = CG(context).last_brk_cont; in zend_begin_loop()
707 zend_stack_push(&CG(loop_var_stack), &info); in zend_begin_loop()
715 = &CG(context).brk_cont_array[CG(context).current_brk_cont]; in zend_end_loop()
718 CG(context).current_brk_cont = brk_cont_element->parent; in zend_end_loop()
720 zend_stack_del_top(&CG(loop_var_stack)); in zend_end_loop()
727 zend_op *opline = &CG(active_op_array)->opcodes[CG(active_op_array)->last-1]; in zend_do_free()
771 zend_op *opline = &CG(active_op_array)->opcodes[CG(active_op_array)->last-1]; in zend_do_free()
784 while (opline >= CG(active_op_array)->opcodes) { in zend_do_free()
1157 zend_op_array *op_array = CG(active_op_array); in zend_add_try_element()
1194 …zval *zv = zend_hash_find_known_hash(compile_time ? CG(function_table) : EG(function_table), lcnam… in do_bind_function_error()
1236 (ce->ce_flags & ZEND_ACC_PRELOADED) && !(CG(compiler_options) & ZEND_COMPILE_PRELOAD); in zend_bind_class_in_slot()
1459 if (!CG(active_op_array)->function_name) { in zend_mark_function_as_generator()
1464 if (CG(active_op_array)->fn_flags & ZEND_ACC_HAS_RETURN_TYPE) { in zend_mark_function_as_generator()
1465 zend_type return_type = CG(active_op_array)->arg_info[-1].type; in zend_mark_function_as_generator()
1486 CG(active_op_array)->fn_flags |= ZEND_ACC_GENERATOR; in zend_mark_function_as_generator()
1582 && !(CG(compiler_options) & ZEND_COMPILE_NO_PERSISTENT_CONSTANT_SUBSTITUTION) in can_ct_eval_const()
1584 && (CG(compiler_options) & ZEND_COMPILE_WITH_FILE_CACHE))) { in can_ct_eval_const()
1588 && !(CG(compiler_options) & ZEND_COMPILE_NO_CONSTANT_SUBSTITUTION)) { in can_ct_eval_const()
1591 && !(CG(compiler_options) & ZEND_COMPILE_NO_CONSTANT_SUBSTITUTION) in can_ct_eval_const()
1625 if (!CG(active_op_array)) { in zend_is_scope_known()
1630 if (CG(active_op_array)->fn_flags & ZEND_ACC_CLOSURE) { in zend_is_scope_known()
1635 if (!CG(active_class_entry)) { in zend_is_scope_known()
1638 return CG(active_op_array)->function_name != NULL; in zend_is_scope_known()
1642 return (CG(active_class_entry)->ce_flags & ZEND_ACC_TRAIT) == 0; in zend_is_scope_known()
1648 if (!CG(active_class_entry)) { in class_name_refers_to_active_ce()
1655 && zend_string_equals_ci(class_name, CG(active_class_entry)->name); in class_name_refers_to_active_ce()
1698 zend_class_entry *ce = CG(active_class_entry); in zend_ensure_valid_class_fetch_type()
1731 if (CG(active_class_entry) && zend_is_scope_known()) { in zend_try_compile_const_expr_resolve_class_name()
1732 ZVAL_STR_COPY(zv, CG(active_class_entry)->name); in zend_try_compile_const_expr_resolve_class_name()
1737 if (CG(active_class_entry) && CG(active_class_entry)->parent_name in zend_try_compile_const_expr_resolve_class_name()
1739 ZVAL_STR_COPY(zv, CG(active_class_entry)->parent_name); in zend_try_compile_const_expr_resolve_class_name()
1779 ce = zend_hash_find_ptr_lc(CG(class_table), ce->parent_name); in zend_verify_ct_const_access()
1797 cc = zend_hash_find_ptr(&CG(active_class_entry)->constants_table, name); in zend_try_ct_eval_class_const()
1798 …} else if (fetch_type == ZEND_FETCH_CLASS_DEFAULT && !(CG(compiler_options) & ZEND_COMPILE_NO_CONS… in zend_try_ct_eval_class_const()
1799 zend_class_entry *ce = zend_hash_find_ptr_lc(CG(class_table), class_name); in zend_try_ct_eval_class_const()
1809 if (CG(compiler_options) & ZEND_COMPILE_NO_PERSISTENT_CONSTANT_SUBSTITUTION) { in zend_try_ct_eval_class_const()
1813 if (!cc || !zend_verify_ct_const_access(cc, CG(active_class_entry))) { in zend_try_ct_eval_class_const()
1856 if (!(CG(compiler_options) & ZEND_COMPILE_EXTENDED_STMT)) { in zend_do_extended_stmt()
1870 if (!(CG(compiler_options) & ZEND_COMPILE_EXTENDED_FCALL)) { in zend_do_extended_fcall_begin()
1884 if (!(CG(compiler_options) & ZEND_COMPILE_EXTENDED_FCALL)) { in zend_do_extended_fcall_end()
1897 if ((auto_global = zend_hash_str_find_ptr(CG(auto_globals), name, len)) != NULL) { in zend_is_auto_global_str()
1911 if ((auto_global = zend_hash_find_ptr(CG(auto_globals), name)) != NULL) { in zend_is_auto_global()
1930 …retval = zend_hash_add_mem(CG(auto_globals), auto_global.name, &auto_global, sizeof(zend_auto_glob… in zend_register_auto_global()
1940 ZEND_HASH_MAP_FOREACH_PTR(CG(auto_globals), auto_global) { in zend_activate_auto_globals()
1957 if (CG(increment_lineno)) { in zendlex()
1958 CG(zend_lineno)++; in zendlex()
1959 CG(increment_lineno) = 0; in zendlex()
1976 if (CG(compiler_options) & ZEND_COMPILE_GUARDS) { in zend_initialize_class_data()
2254 …if (CG(active_op_array)->last && CG(active_op_array)->opcodes[CG(active_op_array)->last - 1].opcod… in zend_emit_tick()
2314 opline = CG(active_op_array)->opcodes + opnum - 1; in zend_emit_cond_jump()
2334 zend_op *opline = &CG(active_op_array)->opcodes[opnum_jump]; in zend_update_jump_target()
2377 zend_stack_push(&CG(delayed_oplines_stack), &tmp_opline); in zend_delayed_emit_op()
2378 return zend_stack_top(&CG(delayed_oplines_stack)); in zend_delayed_emit_op()
2384 return zend_stack_count(&CG(delayed_oplines_stack)); in zend_delayed_compile_begin()
2390 zend_op *opline = NULL, *oplines = zend_stack_base(&CG(delayed_oplines_stack)); in zend_delayed_compile_end()
2391 uint32_t i, count = zend_stack_count(&CG(delayed_oplines_stack)); in zend_delayed_compile_end()
2399 opline = CG(active_op_array)->opcodes + oplines[i].extended_value; in zend_delayed_compile_end()
2403 CG(delayed_oplines_stack).top = offset; in zend_delayed_compile_end()
2462 return zend_stack_count(&CG(short_circuiting_opnums)); in zend_short_circuiting_checkpoint()
2470 ZEND_ASSERT(zend_stack_count(&CG(short_circuiting_opnums)) == checkpoint in zend_short_circuiting_commit()
2480 while (zend_stack_count(&CG(short_circuiting_opnums)) != checkpoint) { in zend_short_circuiting_commit()
2481 uint32_t opnum = *(uint32_t *) zend_stack_top(&CG(short_circuiting_opnums)); in zend_short_circuiting_commit()
2482 zend_op *opline = &CG(active_op_array)->opcodes[opnum]; in zend_short_circuiting_commit()
2489 zend_stack_del_top(&CG(short_circuiting_opnums)); in zend_short_circuiting_commit()
2503 zend_stack_push(&CG(short_circuiting_opnums), &jmp_null_opnum); in zend_emit_jmp_null()
2508 const zend_memoize_mode memoize_mode = CG(memoize_mode); in zend_compile_memoized_expr()
2513 CG(memoize_mode) = ZEND_MEMOIZE_NONE; in zend_compile_memoized_expr()
2515 CG(memoize_mode) = ZEND_MEMOIZE_COMPILE; in zend_compile_memoized_expr()
2529 CG(memoized_exprs), (uintptr_t) expr, &memoized_result, sizeof(znode)); in zend_compile_memoized_expr()
2531 znode *memoized_result = zend_hash_index_find_ptr(CG(memoized_exprs), (uintptr_t) expr); in zend_compile_memoized_expr()
2635 bool returns_reference = (CG(active_op_array)->fn_flags & ZEND_ACC_RETURN_REFERENCE) != 0; in zend_emit_final_return()
2637 if ((CG(active_op_array)->fn_flags & ZEND_ACC_HAS_RETURN_TYPE) in zend_emit_final_return()
2638 && !(CG(active_op_array)->fn_flags & ZEND_ACC_GENERATOR)) { in zend_emit_final_return()
2639 zend_arg_info *return_info = CG(active_op_array)->arg_info - 1; in zend_emit_final_return()
2905 zend_op_array *op_array = CG(active_op_array); in this_guaranteed_exists()
2921 CG(active_op_array)->fn_flags |= ZEND_ACC_USES_THIS; in zend_compile_simple_var()
3054 CG(active_op_array)->fn_flags |= ZEND_ACC_USES_THIS; in zend_delayed_compile_prop()
3072 zend_op *opline = NULL, *oplines = zend_stack_base(&CG(delayed_oplines_stack)); in zend_delayed_compile_prop()
3074 uint32_t count = zend_stack_count(&CG(delayed_oplines_stack)); in zend_delayed_compile_prop()
3090 oplines[i].extended_value = opline - CG(active_op_array)->opcodes; in zend_delayed_compile_prop()
3391 CG(zend_lineno) = zend_ast_get_lineno(var_ast); in zend_compile_assign()
3756 CG(zend_lineno) = zend_ast_get_lineno(ast); in zend_compile_args()
3760 CG(active_op_array)->fn_flags |= ZEND_ACC_USES_THIS; in zend_compile_args()
3839 …if (fbc->type == ZEND_INTERNAL_FUNCTION && !(CG(compiler_options) & ZEND_COMPILE_IGNORE_INTERNAL_F… in zend_get_call_op()
3847 } else if (!(CG(compiler_options) & ZEND_COMPILE_IGNORE_USER_FUNCTIONS)){ in zend_get_call_op()
3868 opline = &CG(active_op_array)->opcodes[opnum_init]; in zend_compile_call_common()
3888 opline = &CG(active_op_array)->opcodes[opnum_init]; in zend_compile_call_common()
4128 return CG(compiler_options) & ZEND_COMPILE_IGNORE_INTERNAL_CLASSES; in zend_compile_ignore_class()
4130 return (CG(compiler_options) & ZEND_COMPILE_IGNORE_OTHER_FILES) in zend_compile_ignore_class()
4138 return CG(compiler_options) & ZEND_COMPILE_IGNORE_INTERNAL_FUNCTIONS; in zend_compile_ignore_function()
4140 return (CG(compiler_options) & ZEND_COMPILE_IGNORE_USER_FUNCTIONS) in zend_compile_ignore_function()
4141 || ((CG(compiler_options) & ZEND_COMPILE_IGNORE_OTHER_FILES) in zend_compile_ignore_function()
4159 fbc = zend_hash_find_ptr(CG(function_table), lcname); in zend_try_compile_ct_bound_init_user_func()
4162 || zend_compile_ignore_function(fbc, CG(active_op_array)->filename)) { in zend_try_compile_ct_bound_init_user_func()
4313 opline = &CG(active_op_array)->opcodes[check_op_number]; in zend_compile_assert()
4473 if (CG(active_op_array)->function_name && args->children == 0) { in zend_compile_func_num_args()
4484 if (CG(active_op_array)->function_name && args->children == 0) { in zend_compile_func_get_args()
4511 if (CG(active_op_array)->function_name in zend_compile_func_array_slice()
4544 if (CG(compiler_options) & ZEND_COMPILE_NO_BUILTINS) { in zend_try_compile_special_func()
4662 fbc = zend_hash_find_ptr(CG(function_table), lcname); in zend_compile_call()
4674 || zend_compile_ignore_function(fbc, CG(active_op_array)->filename)) { in zend_compile_call()
4718 CG(active_op_array)->fn_flags |= ZEND_ACC_USES_THIS; in zend_compile_method_call()
4748 CG(active_class_entry) && zend_is_scope_known()) { in zend_compile_method_call()
4750 fbc = zend_hash_find_ptr(&CG(active_class_entry)->function_table, lcname); in zend_compile_method_call()
4777 if (!fbc || (fbc->common.fn_flags & ZEND_ACC_PUBLIC) || ce == CG(active_class_entry)) { in zend_get_compatible_func_or_null()
4783 && (!CG(active_class_entry) || (CG(active_class_entry)->ce_flags & ZEND_ACC_LINKED)) in zend_get_compatible_func_or_null()
4784 && zend_check_protected(zend_get_function_root_class(fbc), CG(active_class_entry))) { in zend_get_compatible_func_or_null()
4840 ce = zend_hash_find_ptr(CG(class_table), lcname); in zend_compile_static_call()
4842 if (zend_compile_ignore_class(ce, CG(active_op_array)->filename)) { in zend_compile_static_call()
4845 } else if (CG(active_class_entry) in zend_compile_static_call()
4846 && zend_string_equals_ci(CG(active_class_entry)->name, lcname)) { in zend_compile_static_call()
4847 ce = CG(active_class_entry); in zend_compile_static_call()
4852 ce = CG(active_class_entry); in zend_compile_static_call()
4948 if (!CG(active_op_array)->static_variables) { in zend_compile_static_var_common()
4949 if (CG(active_op_array)->scope) { in zend_compile_static_var_common()
4950 CG(active_op_array)->scope->ce_flags |= ZEND_HAS_STATIC_IN_METHODS; in zend_compile_static_var_common()
4952 CG(active_op_array)->static_variables = zend_new_array(8); in zend_compile_static_var_common()
4955 value = zend_hash_update(CG(active_op_array)->static_variables, var_name, value); in zend_compile_static_var_common()
4964 …opline->extended_value = (uint32_t)((char*)value - (char*)CG(active_op_array)->static_variables->a… in zend_compile_static_var_common()
4977 if (!CG(active_op_array)->static_variables) { in zend_compile_static_var()
4978 if (CG(active_op_array)->scope) { in zend_compile_static_var()
4979 CG(active_op_array)->scope->ce_flags |= ZEND_HAS_STATIC_IN_METHODS; in zend_compile_static_var()
4981 CG(active_op_array)->static_variables = zend_new_array(8); in zend_compile_static_var()
4984 if (zend_hash_exists(CG(active_op_array)->static_variables, var_name)) { in zend_compile_static_var()
5000 …zval *placeholder_ptr = zend_hash_update(CG(active_op_array)->static_variables, var_name, &EG(unin… in zend_compile_static_var()
5002 …uint32_t placeholder_offset = (uint32_t)((char*)placeholder_ptr - (char*)CG(active_op_array)->stat… in zend_compile_static_var()
5078 zend_loop_var *loop_var = zend_stack_top(&CG(loop_var_stack)); in zend_handle_loops_and_finally_ex()
5083 base = zend_stack_base(&CG(loop_var_stack)); in zend_handle_loops_and_finally_ex()
5126 return zend_handle_loops_and_finally_ex(zend_stack_count(&CG(loop_var_stack)) + 1, return_value); in zend_handle_loops_and_finally()
5133 zend_loop_var *loop_var = zend_stack_top(&CG(loop_var_stack)); in zend_has_finally_ex()
5138 base = zend_stack_base(&CG(loop_var_stack)); in zend_has_finally_ex()
5158 return zend_has_finally_ex(zend_stack_count(&CG(loop_var_stack)) + 1); in zend_has_finally()
5165 bool is_generator = (CG(active_op_array)->fn_flags & ZEND_ACC_GENERATOR) != 0; in zend_compile_return()
5166 bool by_ref = (CG(active_op_array)->fn_flags & ZEND_ACC_RETURN_REFERENCE) != 0; in zend_compile_return()
5186 if ((CG(active_op_array)->fn_flags & ZEND_ACC_HAS_FINALLY_BLOCK) in zend_compile_return()
5198 if (!is_generator && (CG(active_op_array)->fn_flags & ZEND_ACC_HAS_RETURN_TYPE)) { in zend_compile_return()
5200 expr_ast ? &expr_node : NULL, CG(active_op_array)->arg_info - 1, 0); in zend_compile_return()
5275 if (CG(context).current_brk_cont == -1) { in zend_compile_break_continue()
5287 int d, cur = CG(context).current_brk_cont; in zend_compile_break_continue()
5289 cur = CG(context).brk_cont_array[cur].parent; in zend_compile_break_continue()
5293 if (CG(context).brk_cont_array[cur].is_switch) { in zend_compile_break_continue()
5295 if (CG(context).brk_cont_array[cur].parent == -1) { in zend_compile_break_continue()
5305 if (CG(context).brk_cont_array[cur].parent == -1) { in zend_compile_break_continue()
5320 opline->op1.num = CG(context).current_brk_cont; in zend_compile_break_continue()
5333 if (CG(context).labels == NULL || in zend_resolve_goto_label()
5334 (dest = zend_hash_find_ptr(CG(context).labels, Z_STR_P(label))) == NULL in zend_resolve_goto_label()
5336 CG(in_compilation) = 1; in zend_resolve_goto_label()
5337 CG(active_op_array) = op_array; in zend_resolve_goto_label()
5338 CG(zend_lineno) = opline->lineno; in zend_resolve_goto_label()
5346 for (; current != dest->brk_cont; current = CG(context).brk_cont_array[current].parent) { in zend_resolve_goto_label()
5348 CG(in_compilation) = 1; in zend_resolve_goto_label()
5349 CG(active_op_array) = op_array; in zend_resolve_goto_label()
5350 CG(zend_lineno) = opline->lineno; in zend_resolve_goto_label()
5353 if (CG(context).brk_cont_array[current].start >= 0) { in zend_resolve_goto_label()
5399 opline->extended_value = CG(context).current_brk_cont; in zend_compile_goto()
5408 if (!CG(context).labels) { in zend_compile_label()
5409 ALLOC_HASHTABLE(CG(context).labels); in zend_compile_label()
5410 zend_hash_init(CG(context).labels, 8, NULL, label_ptr_dtor, 0); in zend_compile_label()
5413 dest.brk_cont = CG(context).current_brk_cont; in zend_compile_label()
5416 if (!zend_hash_add_mem(CG(context).labels, label, &dest, sizeof(zend_label))) { in zend_compile_label()
5591 opline = &CG(active_op_array)->opcodes[opnum_fetch]; in zend_compile_foreach()
5601 CG(zend_lineno) = ast->lineno; in zend_compile_foreach()
5604 opline = &CG(active_op_array)->opcodes[opnum_reset]; in zend_compile_foreach()
5607 opline = &CG(active_op_array)->opcodes[opnum_fetch]; in zend_compile_foreach()
5636 CG(zend_lineno) = cond_ast->lineno; in zend_compile_if()
5648 CG(zend_lineno) = elem_ast->lineno; in zend_compile_if()
5710 if (CG(compiler_options) & ZEND_COMPILE_NO_JUMPTABLES) { in should_use_jumptable()
5760 opnum_switch = opline - CG(active_op_array)->opcodes; in zend_compile_switch()
5771 CG(zend_lineno) = case_ast->lineno; in zend_compile_switch()
5828 opline = &CG(active_op_array)->opcodes[opnum_switch]; in zend_compile_switch()
5840 opline = &CG(active_op_array)->opcodes[opnum_switch]; in zend_compile_switch()
5927 CG(zend_lineno) = arm_ast->lineno; in zend_compile_match()
5947 opnum_match = opline - CG(active_op_array)->opcodes; in zend_compile_match()
5996 zend_op *opline = &CG(active_op_array)->opcodes[opnum_match]; in zend_compile_match()
6046 zend_op *opline = &CG(active_op_array)->opcodes[opnum_match]; in zend_compile_match()
6098 uint32_t orig_fast_call_var = CG(context).fast_call_var; in zend_compile_try()
6099 uint32_t orig_try_catch_offset = CG(context).try_catch_offset; in zend_compile_try()
6106 if (CG(context).labels) { in zend_compile_try()
6108 ZEND_HASH_MAP_REVERSE_FOREACH_PTR(CG(context).labels, label) { in zend_compile_try()
6120 if (!(CG(active_op_array)->fn_flags & ZEND_ACC_HAS_FINALLY_BLOCK)) { in zend_compile_try()
6121 CG(active_op_array)->fn_flags |= ZEND_ACC_HAS_FINALLY_BLOCK; in zend_compile_try()
6123 CG(context).fast_call_var = get_temporary_variable(); in zend_compile_try()
6128 fast_call.var_num = CG(context).fast_call_var; in zend_compile_try()
6130 zend_stack_push(&CG(loop_var_stack), &fast_call); in zend_compile_try()
6133 CG(context).try_catch_offset = try_catch_offset; in zend_compile_try()
6152 CG(zend_lineno) = catch_ast->lineno; in zend_compile_try()
6164 CG(active_op_array)->try_catch_array[try_catch_offset].catch_op = opnum_catch; in zend_compile_try()
6187 opline = &CG(active_op_array)->opcodes[opnum_catch]; in zend_compile_try()
6205 opline = &CG(active_op_array)->opcodes[opnum_catch]; in zend_compile_try()
6220 zend_stack_del_top(&CG(loop_var_stack)); in zend_compile_try()
6225 discard_exception.var_num = CG(context).fast_call_var; in zend_compile_try()
6226 zend_stack_push(&CG(loop_var_stack), &discard_exception); in zend_compile_try()
6228 CG(zend_lineno) = finally_ast->lineno; in zend_compile_try()
6233 opline->result.var = CG(context).fast_call_var; in zend_compile_try()
6239 CG(active_op_array)->try_catch_array[try_catch_offset].finally_op = opnum_jmp + 1; in zend_compile_try()
6240 CG(active_op_array)->try_catch_array[try_catch_offset].finally_end in zend_compile_try()
6245 opline->op1.var = CG(context).fast_call_var; in zend_compile_try()
6250 CG(context).fast_call_var = orig_fast_call_var; in zend_compile_try()
6253 zend_stack_del_top(&CG(loop_var_stack)); in zend_compile_try()
6256 CG(context).try_catch_offset = orig_try_catch_offset; in zend_compile_try()
6279 if (CG(multibyte)) { in zend_handle_encoding_declaration()
6285 CG(encoding_declared) = 1; in zend_handle_encoding_declaration()
6318 zend_ast_list *file_ast = zend_ast_get_list(CG(ast)); in zend_is_first_statement()
6384 CG(active_op_array)->fn_flags |= ZEND_ACC_STRICT_TYPES; in zend_compile_declare()
6439 if (ast->attr == IS_STATIC && !CG(active_class_entry) && zend_is_scope_known()) { in zend_compile_single_typename()
6693 &CG(arena), ZEND_TYPE_LIST_SIZE(type_list->num_types)); in zend_compile_typename_ex()
6717 type_list = zend_arena_alloc(&CG(arena), ZEND_TYPE_LIST_SIZE(list->children)); in zend_compile_typename_ex()
6764 zend_type_list *dnf_type_list = zend_arena_alloc(&CG(arena), ZEND_TYPE_LIST_SIZE(1)); in zend_compile_typename_ex()
6876 uint32_t flags = (CG(active_op_array)->fn_flags & ZEND_ACC_STRICT_TYPES) in zend_compile_attributes()
6943 config->validator(attr, target, CG(active_class_entry)); in zend_compile_attributes()
6954 zend_op_array *op_array = CG(active_op_array); in zend_compile_params()
7041 uint32_t cops = CG(compiler_options); in zend_compile_params()
7042CG(compiler_options) |= ZEND_COMPILE_NO_CONSTANT_SUBSTITUTION | ZEND_COMPILE_NO_PERSISTENT_CONSTAN… in zend_compile_params()
7047 CG(compiler_options) = cops; in zend_compile_params()
7130 zend_op_array *op_array = CG(active_op_array); in zend_compile_params()
7262 CG(zend_lineno) = zend_ast_get_lineno(var_name_ast); in zend_compile_closure_binding()
7376 zend_op_array *op_array = CG(active_op_array); in zend_compile_closure_uses()
7397 CG(zend_lineno) = zend_ast_get_lineno(var_ast); in zend_compile_closure_uses()
7438 zend_class_entry *ce = CG(active_class_entry); in zend_begin_method_decl()
7507 zend_op_array *op_array = CG(active_op_array); in zend_add_dynamic_func_def()
7572 zend_class_entry *orig_class_entry = CG(active_class_entry); in zend_compile_func_decl()
7573 zend_op_array *orig_op_array = CG(active_op_array); in zend_compile_func_decl()
7574 zend_op_array *op_array = zend_arena_alloc(&CG(arena), sizeof(zend_op_array)); in zend_compile_func_decl()
7581 if (CG(compiler_options) & ZEND_COMPILE_PRELOAD) { in zend_compile_func_decl()
7610 CG(active_op_array) = op_array; in zend_compile_func_decl()
7636 CG(active_class_entry) = NULL; in zend_compile_func_decl()
7650 zend_stack_push(&CG(loop_var_stack), (void *) &dummy_var); in zend_compile_func_decl()
7655 if (CG(active_op_array)->fn_flags & ZEND_ACC_GENERATOR) { in zend_compile_func_decl()
7669 zend_arg_info *return_info = CG(active_op_array)->arg_info - 1; in zend_compile_func_decl()
7681 CG(zend_lineno) = decl->start_lineno; in zend_compile_func_decl()
7683 CG(active_class_entry), (zend_function *) op_array, lcname, E_COMPILE_ERROR); in zend_compile_func_decl()
7686 if (UNEXPECTED(zend_hash_add_ptr(CG(function_table), lcname, op_array) == NULL)) { in zend_compile_func_decl()
7692 CG(zend_lineno) = decl->end_lineno; in zend_compile_func_decl()
7697 pass_two(CG(active_op_array)); in zend_compile_func_decl()
7701 zend_stack_del_top(&CG(loop_var_stack)); in zend_compile_func_decl()
7709 CG(active_op_array) = orig_op_array; in zend_compile_func_decl()
7710 CG(active_class_entry) = orig_class_entry; in zend_compile_func_decl()
7717 zend_class_entry *ce = CG(active_class_entry); in zend_compile_prop_decl()
7840 zend_class_entry *ce = CG(active_class_entry); in zend_compile_class_const_decl()
7933 zend_add_to_list(&CG(active_class_entry)->trait_precedences, precedence); in zend_compile_trait_precedence()
7957 zend_add_to_list(&CG(active_class_entry)->trait_aliases, alias); in zend_compile_trait_alias()
7965 zend_class_entry *ce = CG(active_class_entry); in zend_compile_use_trait()
8007 zend_class_entry *ce = CG(active_class_entry); in zend_compile_implements()
8027 zend_string *filename = CG(active_op_array)->filename; in zend_generate_anon_class_name()
8040 ZSTR_VAL(prefix), '\0', ZSTR_VAL(filename), start_lineno, CG(rtd_key_counter)++); in zend_generate_anon_class_name()
8073 zend_class_entry *ce = zend_arena_alloc(&CG(arena), sizeof(zend_class_entry)); in zend_compile_class_decl()
8076 zend_class_entry *original_ce = CG(active_class_entry); in zend_compile_class_decl()
8081 if (CG(active_class_entry)) { in zend_compile_class_decl()
8109 } while (zend_hash_exists(CG(class_table), lcname)); in zend_compile_class_decl()
8120 if (CG(compiler_options) & ZEND_COMPILE_PRELOAD) { in zend_compile_class_decl()
8145 CG(active_class_entry) = ce; in zend_compile_class_decl()
8166 CG(zend_lineno) = ast->lineno; in zend_compile_class_decl()
8172 CG(active_class_entry) = original_ce; in zend_compile_class_decl()
8180 && !(CG(compiler_options) & ZEND_COMPILE_WITHOUT_EXECUTION)) { in zend_compile_class_decl()
8193 } else if (EXPECTED(zend_hash_add_ptr(CG(class_table), lcname, ce) != NULL)) { in zend_compile_class_decl()
8228 if (!zend_hash_add_ptr(CG(class_table), lcname, ce)) { in zend_compile_class_decl()
8239 } while (!zend_hash_add_ptr(CG(class_table), key, ce)); in zend_compile_class_decl()
8246 && (CG(compiler_options) & ZEND_COMPILE_DELAYED_BINDING) in zend_compile_class_decl()
8256 CG(active_op_array)->fn_flags |= ZEND_ACC_EARLY_BINDING; in zend_compile_class_decl()
8268 zend_class_entry *enum_class = CG(active_class_entry); in zend_compile_enum_case()
8597 zend_op_array *op_array = CG(active_op_array); in zend_try_ct_eval_magic_const()
8598 zend_class_entry *ce = CG(active_class_entry); in zend_try_ct_eval_magic_const()
8605 ZVAL_STR_COPY(zv, CG(compiled_filename)); in zend_try_ct_eval_magic_const()
8609 zend_string *filename = CG(compiled_filename); in zend_try_ct_eval_magic_const()
8840 CG(zend_lineno) = zend_ast_get_lineno(last_elem_ast); in zend_try_ct_eval_array()
9344 opline = &CG(active_op_array)->opcodes[opnum]; in zend_compile_coalesce()
9369 HashTable *orig_memoized_exprs = CG(memoized_exprs); in zend_compile_assign_coalesce()
9370 const zend_memoize_mode orig_memoize_mode = CG(memoize_mode); in zend_compile_assign_coalesce()
9377 ALLOC_HASHTABLE(CG(memoized_exprs)); in zend_compile_assign_coalesce()
9378 zend_hash_init(CG(memoized_exprs), 0, NULL, znode_dtor, 0); in zend_compile_assign_coalesce()
9380 CG(memoize_mode) = ZEND_MEMOIZE_COMPILE; in zend_compile_assign_coalesce()
9386 CG(memoize_mode) = ZEND_MEMOIZE_NONE; in zend_compile_assign_coalesce()
9393 CG(memoize_mode) = ZEND_MEMOIZE_FETCH; in zend_compile_assign_coalesce()
9397 opline = &CG(active_op_array)->opcodes[CG(active_op_array)->last-1]; in zend_compile_assign_coalesce()
9432 ZEND_HASH_FOREACH_PTR(CG(memoized_exprs), node) { in zend_compile_assign_coalesce()
9443 ZEND_HASH_FOREACH_PTR(CG(memoized_exprs), node) { in zend_compile_assign_coalesce()
9453 zend_hash_destroy(CG(memoized_exprs)); in zend_compile_assign_coalesce()
9454 FREE_HASHTABLE(CG(memoized_exprs)); in zend_compile_assign_coalesce()
9455 CG(memoized_exprs) = orig_memoized_exprs; in zend_compile_assign_coalesce()
9456 CG(memoize_mode) = orig_memoize_mode; in zend_compile_assign_coalesce()
9505 bool returns_by_ref = (CG(active_op_array)->fn_flags & ZEND_ACC_RETURN_REFERENCE) != 0; in zend_compile_yield()
9539 if (CG(active_op_array)->fn_flags & ZEND_ACC_RETURN_REFERENCE) { in zend_compile_yield_from()
9646 CG(active_op_array)->fn_flags |= ZEND_ACC_USES_THIS; in zend_compile_isset_or_empty()
9787 opline = &CG(active_op_array)->opcodes[opnum_init]; in zend_compile_array()
9804 zend_ast *last = CG(ast); in zend_compile_const()
9999 opline = &CG(active_op_array)->opcodes[reserved_op_number]; in zend_compile_encaps_list()
10015 CG(active_op_array)->last = reserved_op_number - 1; in zend_compile_encaps_list()
10018 opline = &CG(active_op_array)->opcodes[reserved_op_number]; in zend_compile_encaps_list()
10021 init_opline = CG(active_op_array)->opcodes + rope_init_lineno; in zend_compile_encaps_list()
10082 CG(active_class_entry) && in zend_compile_magic_const()
10083 (CG(active_class_entry)->ce_flags & ZEND_ACC_TRAIT) != 0); in zend_compile_magic_const()
10185 CG(zend_lineno) = zend_ast_get_lineno(ast); in zend_compile_const_expr_const()
10343 CG(zend_lineno) = ast->lineno; in zend_compile_top_stmt()
10345 CG(zend_lineno) = ((zend_ast_decl *) ast)->end_lineno; in zend_compile_top_stmt()
10347 CG(zend_lineno) = ast->lineno; in zend_compile_top_stmt()
10349 CG(zend_lineno) = ((zend_ast_decl *) ast)->end_lineno; in zend_compile_top_stmt()
10365 CG(zend_lineno) = ast->lineno; in zend_compile_stmt()
10367 if ((CG(compiler_options) & ZEND_COMPILE_EXTENDED_STMT) && !zend_is_unticked_stmt(ast)) { in zend_compile_stmt()
10479 CG(zend_lineno) = zend_ast_get_lineno(ast); in zend_compile_expr_inner()
10481 if (CG(memoize_mode) != ZEND_MEMOIZE_NONE) { in zend_compile_expr_inner()
10631 CG(zend_lineno) = zend_ast_get_lineno(ast); in zend_compile_var_inner()
10633 if (CG(memoize_mode) != ZEND_MEMOIZE_NONE) { in zend_compile_var_inner()