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()
125 zend_string *filename = CG(active_op_array)->filename; in zend_build_runtime_definition_key()
232 *prev_context = CG(context); in zend_oparray_context_begin()
233 CG(context).opcodes_size = INITIAL_OP_ARRAY_SIZE; in zend_oparray_context_begin()
234 CG(context).vars_size = 0; in zend_oparray_context_begin()
235 CG(context).literals_size = 0; in zend_oparray_context_begin()
236 CG(context).backpatch_count = 0; in zend_oparray_context_begin()
237 CG(context).in_finally = 0; in zend_oparray_context_begin()
238 CG(context).fast_call_var = -1; in zend_oparray_context_begin()
239 CG(context).try_catch_offset = -1; in zend_oparray_context_begin()
240 CG(context).current_brk_cont = -1; in zend_oparray_context_begin()
241 CG(context).last_brk_cont = 0; in zend_oparray_context_begin()
242 CG(context).brk_cont_array = NULL; in zend_oparray_context_begin()
243 CG(context).labels = NULL; in zend_oparray_context_begin()
249 if (CG(context).brk_cont_array) { in zend_oparray_context_end()
250 efree(CG(context).brk_cont_array); in zend_oparray_context_end()
251 CG(context).brk_cont_array = NULL; in zend_oparray_context_end()
253 if (CG(context).labels) { in zend_oparray_context_end()
254 zend_hash_destroy(CG(context).labels); in zend_oparray_context_end()
255 FREE_HASHTABLE(CG(context).labels); in zend_oparray_context_end()
256 CG(context).labels = NULL; in zend_oparray_context_end()
258 CG(context) = *prev_context; in zend_oparray_context_end()
296 *prev_context = CG(file_context); in zend_file_context_begin()
310 CG(file_context) = *prev_context; in zend_file_context_end()
316 zend_stack_init(&CG(loop_var_stack), sizeof(zend_loop_var)); in zend_init_compiler_data_structures()
317 zend_stack_init(&CG(delayed_oplines_stack), sizeof(zend_op)); in zend_init_compiler_data_structures()
318 CG(active_class_entry) = NULL; in zend_init_compiler_data_structures()
319 CG(in_compilation) = 0; in zend_init_compiler_data_structures()
320 CG(start_lineno) = 0; in zend_init_compiler_data_structures()
321 zend_hash_init(&CG(const_filenames), 8, NULL, NULL, 0); in zend_init_compiler_data_structures()
323 CG(encoding_declared) = 0; in zend_init_compiler_data_structures()
336 CG(arena) = zend_arena_create(64 * 1024); in init_compiler()
337 CG(active_op_array) = NULL; in init_compiler()
338 memset(&CG(context), 0, sizeof(CG(context))); in init_compiler()
341 zend_hash_init(&CG(filenames_table), 8, NULL, ZVAL_PTR_DTOR, 0); in init_compiler()
342 zend_llist_init(&CG(open_files), sizeof(zend_file_handle), (void (*)(void *)) file_handle_dtor, 0); in init_compiler()
343 CG(unclean_shutdown) = 0; in init_compiler()
349 zend_stack_destroy(&CG(loop_var_stack)); in shutdown_compiler()
350 zend_stack_destroy(&CG(delayed_oplines_stack)); in shutdown_compiler()
351 zend_hash_destroy(&CG(filenames_table)); in shutdown_compiler()
352 zend_hash_destroy(&CG(const_filenames)); in shutdown_compiler()
353 zend_arena_destroy(CG(arena)); in shutdown_compiler()
361 if ((p = zend_hash_find(&CG(filenames_table), new_compiled_filename))) { in zend_set_compiled_filename()
363 CG(compiled_filename) = Z_STR_P(p); in zend_set_compiled_filename()
368 zend_hash_update(&CG(filenames_table), new_compiled_filename, &rv); in zend_set_compiled_filename()
370 CG(compiled_filename) = new_compiled_filename; in zend_set_compiled_filename()
377 CG(compiled_filename) = original_compiled_filename; in zend_restore_compiled_filename()
383 return CG(compiled_filename); in zend_get_compiled_filename()
389 return CG(zend_lineno); in zend_get_compiled_lineno()
395 return CG(in_compilation); in zend_is_compiling()
421 if (op_array->last_var > CG(context).vars_size) { in lookup_cv()
422 CG(context).vars_size += 16; /* FIXME */ in lookup_cv()
423 op_array->vars = erealloc(op_array->vars, CG(context).vars_size * sizeof(zend_string*)); in lookup_cv()
464 if (i >= CG(context).literals_size) { in zend_add_literal()
465 while (i >= CG(context).literals_size) { in zend_add_literal()
466 CG(context).literals_size += 16; /* FIXME */ in zend_add_literal()
468 …op_array->literals = (zval*)erealloc(op_array->literals, CG(context).literals_size * sizeof(zval)); in zend_add_literal()
582 op.constant = zend_add_literal(CG(active_op_array), &_c); \
627 if (!zend_stack_is_empty(&CG(loop_var_stack))) { in zend_start_live_range_ex()
628 zend_loop_var *loop_var = zend_stack_top(&CG(loop_var_stack)); in zend_start_live_range_ex()
629 zend_loop_var *base = zend_stack_base(&CG(loop_var_stack)); in zend_start_live_range_ex()
684 int parent = CG(context).current_brk_cont; in zend_begin_loop()
687 CG(context).current_brk_cont = CG(context).last_brk_cont; in zend_begin_loop()
692 uint32_t start = get_next_op_number(CG(active_op_array)); in zend_begin_loop()
697 info.u.live_range_offset = zend_start_live_range(CG(active_op_array), start); in zend_begin_loop()
706 zend_stack_push(&CG(loop_var_stack), &info); in zend_begin_loop()
712 uint32_t end = get_next_op_number(CG(active_op_array)); in zend_end_loop()
714 = &CG(context).brk_cont_array[CG(context).current_brk_cont]; in zend_end_loop()
717 CG(context).current_brk_cont = brk_cont_element->parent; in zend_end_loop()
720 zend_loop_var *loop_var = zend_stack_top(&CG(loop_var_stack)); in zend_end_loop()
721 zend_end_live_range(CG(active_op_array), loop_var->u.live_range_offset, end, in zend_end_loop()
726 zend_stack_del_top(&CG(loop_var_stack)); in zend_end_loop()
733 zend_op *opline = &CG(active_op_array)->opcodes[CG(active_op_array)->last-1]; in zend_do_free()
747 zend_op *opline = &CG(active_op_array)->opcodes[CG(active_op_array)->last-1]; in zend_do_free()
770 while (opline >= CG(active_op_array)->opcodes) { in zend_do_free()
1019 zend_op_array *op_array = CG(active_op_array); in zend_add_try_element()
1072 new_function = zend_arena_alloc(&CG(arena), sizeof(zend_op_array)); in do_bind_function()
1179 zend_op *opline = &CG(active_op_array)->opcodes[CG(active_op_array)->last-1]; in zend_do_early_binding()
1182 while (opline->opcode == ZEND_TICKS && opline > CG(active_op_array)->opcodes) { in zend_do_early_binding()
1188 if (do_bind_function(CG(active_op_array), opline, CG(function_table), 1) == FAILURE) { in zend_do_early_binding()
1191 table = CG(function_table); in zend_do_early_binding()
1194 if (do_bind_class(CG(active_op_array), opline, CG(class_table), 1) == NULL) { in zend_do_early_binding()
1197 table = CG(class_table); in zend_do_early_binding()
1207 ((CG(compiler_options) & ZEND_COMPILE_IGNORE_INTERNAL_CLASSES) && in zend_do_early_binding()
1209 if (CG(compiler_options) & ZEND_COMPILE_DELAYED_BINDING) { in zend_do_early_binding()
1210 uint32_t *opline_num = &CG(active_op_array)->early_binding; in zend_do_early_binding()
1213 opline_num = &CG(active_op_array)->opcodes[*opline_num].result.opline_num; in zend_do_early_binding()
1215 *opline_num = opline - CG(active_op_array)->opcodes; in zend_do_early_binding()
1222 if (do_bind_inherited_class(CG(active_op_array), opline, CG(class_table), ce, 1) == NULL) { in zend_do_early_binding()
1226 zend_del_literal(CG(active_op_array), fetch_class_opline->op2.constant); in zend_do_early_binding()
1229 table = CG(class_table); in zend_do_early_binding()
1245 zend_del_literal(CG(active_op_array), opline->op1.constant+1); in zend_do_early_binding()
1246 zend_del_literal(CG(active_op_array), opline->op1.constant); in zend_do_early_binding()
1253 if (!CG(active_op_array)->function_name) { in zend_mark_function_as_generator()
1258 if (CG(active_op_array)->fn_flags & ZEND_ACC_HAS_RETURN_TYPE) { in zend_mark_function_as_generator()
1259 zend_arg_info return_info = CG(active_op_array)->arg_info[-1]; in zend_mark_function_as_generator()
1276 CG(active_op_array)->fn_flags |= ZEND_ACC_GENERATOR; in zend_mark_function_as_generator()
1283 zend_bool orig_in_compilation = CG(in_compilation); in zend_do_delayed_early_binding()
1287 CG(in_compilation) = 1; in zend_do_delayed_early_binding()
1295 CG(in_compilation) = orig_in_compilation; in zend_do_delayed_early_binding()
1383 …((c->flags & CONST_PERSISTENT) && !(CG(compiler_options) & ZEND_COMPILE_NO_PERSISTENT_CONSTANT_SUB… in zend_try_ct_eval_const()
1384 …|| (Z_TYPE(c->value) < IS_OBJECT && !(CG(compiler_options) & ZEND_COMPILE_NO_CONSTANT_SUBSTITUTION… in zend_try_ct_eval_const()
1412 if (CG(active_op_array)->fn_flags & ZEND_ACC_CLOSURE) { in zend_is_scope_known()
1417 if (!CG(active_class_entry)) { in zend_is_scope_known()
1420 return CG(active_op_array)->function_name != NULL; in zend_is_scope_known()
1424 return (CG(active_class_entry)->ce_flags & ZEND_ACC_TRAIT) == 0; in zend_is_scope_known()
1430 if (!CG(active_class_entry)) { in class_name_refers_to_active_ce()
1437 && zend_string_equals_ci(class_name, CG(active_class_entry)->name); in class_name_refers_to_active_ce()
1468 if (fetch_type != ZEND_FETCH_CLASS_DEFAULT && !CG(active_class_entry) && zend_is_scope_known()) { in zend_ensure_valid_class_fetch_type()
1498 if (constant || (CG(active_class_entry) && zend_is_scope_known())) { in zend_try_compile_const_expr_resolve_class_name()
1499 ZVAL_STR_COPY(zv, CG(active_class_entry)->name); in zend_try_compile_const_expr_resolve_class_name()
1530 cc = zend_hash_find_ptr(&CG(active_class_entry)->constants_table, name); in zend_try_ct_eval_class_const()
1531 …} else if (fetch_type == ZEND_FETCH_CLASS_DEFAULT && !(CG(compiler_options) & ZEND_COMPILE_NO_CONS… in zend_try_ct_eval_class_const()
1532 …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()
1542 if (CG(compiler_options) & ZEND_COMPILE_NO_PERSISTENT_CONSTANT_SUBSTITUTION) { in zend_try_ct_eval_class_const()
1546 if (!cc || !zend_verify_const_access(cc, CG(active_class_entry))) { in zend_try_ct_eval_class_const()
1586 if (!(CG(compiler_options) & ZEND_COMPILE_EXTENDED_INFO)) { in zend_do_extended_info()
1590 opline = get_next_op(CG(active_op_array)); in zend_do_extended_info()
1602 if (!(CG(compiler_options) & ZEND_COMPILE_EXTENDED_INFO)) { in zend_do_extended_fcall_begin()
1606 opline = get_next_op(CG(active_op_array)); in zend_do_extended_fcall_begin()
1618 if (!(CG(compiler_options) & ZEND_COMPILE_EXTENDED_INFO)) { in zend_do_extended_fcall_end()
1622 opline = get_next_op(CG(active_op_array)); in zend_do_extended_fcall_end()
1633 if ((auto_global = zend_hash_str_find_ptr(CG(auto_globals), name, len)) != NULL) { in zend_is_auto_global_str()
1647 if ((auto_global = zend_hash_find_ptr(CG(auto_globals), name)) != NULL) { in zend_is_auto_global()
1666 …retval = zend_hash_add_mem(CG(auto_globals), auto_global.name, &auto_global, sizeof(zend_auto_glob… in zend_register_auto_global()
1677 ZEND_HASH_FOREACH_PTR(CG(auto_globals), auto_global) { in zend_activate_auto_globals()
1695 if (CG(increment_lineno)) { in zendlex()
1696 CG(zend_lineno)++; in zendlex()
1697 CG(increment_lineno) = 0; in zendlex()
1702 start_lineno = CG(zend_lineno); in zendlex()
1717 CG(increment_lineno) = 1; in zendlex()
1740 if (CG(compiler_options) & ZEND_COMPILE_GUARDS) { in zend_initialize_class_data()
1752 int n = zend_hash_num_elements(CG(class_table)); in zend_initialize_class_data()
1754 if (CG(static_members_table) && n >= CG(last_static_member)) { in zend_initialize_class_data()
1756 CG(last_static_member) = n+1; in zend_initialize_class_data()
1757 CG(static_members_table) = realloc(CG(static_members_table), (n+1)*sizeof(zval*)); in zend_initialize_class_data()
1758 CG(static_members_table)[n] = NULL; in zend_initialize_class_data()
1994 opline->result.var = get_temporary_variable(CG(active_op_array)); in zend_make_var_result()
2002 opline->result.var = get_temporary_variable(CG(active_op_array)); in zend_make_tmp_result()
2011 while (def != CG(active_op_array)->opcodes) { in zend_find_live_range()
2037 def = CG(active_op_array)->opcodes + def->op2.opline_num - 1; in zend_find_live_range()
2043 zend_end_live_range(CG(active_op_array), in zend_find_live_range()
2044 zend_start_live_range_ex(CG(active_op_array), in zend_find_live_range()
2045 def + 1 - CG(active_op_array)->opcodes), in zend_find_live_range()
2046 opline - CG(active_op_array)->opcodes, in zend_find_live_range()
2139 zend_op *opline = get_next_op(CG(active_op_array)); in zend_emit_op()
2165 zend_op *opline = get_next_op(CG(active_op_array)); in zend_emit_op_tmp()
2195 …if (CG(active_op_array)->last && CG(active_op_array)->opcodes[CG(active_op_array)->last - 1].opcod… in zend_emit_tick()
2199 opline = get_next_op(CG(active_op_array)); in zend_emit_tick()
2216 uint32_t opnum = get_next_op_number(CG(active_op_array)); in zend_emit_jump()
2249 uint32_t opnum = get_next_op_number(CG(active_op_array)); in zend_emit_cond_jump()
2254 && zend_is_smart_branch(CG(active_op_array)->opcodes + opnum - 1)) { in zend_emit_cond_jump()
2257 opnum = get_next_op_number(CG(active_op_array)); in zend_emit_cond_jump()
2267 zend_op *opline = &CG(active_op_array)->opcodes[opnum_jump]; in zend_update_jump_target()
2286 zend_update_jump_target(opnum_jump, get_next_op_number(CG(active_op_array))); in zend_update_jump_target_to_next()
2309 zend_stack_push(&CG(delayed_oplines_stack), &tmp_opline); in zend_delayed_emit_op()
2310 return zend_stack_top(&CG(delayed_oplines_stack)); in zend_delayed_emit_op()
2316 return zend_stack_count(&CG(delayed_oplines_stack)); in zend_delayed_compile_begin()
2322 zend_op *opline = NULL, *oplines = zend_stack_base(&CG(delayed_oplines_stack)); in zend_delayed_compile_end()
2323 uint32_t i, count = zend_stack_count(&CG(delayed_oplines_stack)); in zend_delayed_compile_end()
2327 opline = get_next_op(CG(active_op_array)); in zend_delayed_compile_end()
2331 CG(delayed_oplines_stack).top = offset; in zend_delayed_compile_end()
2383 opline->result.var = expr->u.op.var = get_temporary_variable(CG(active_op_array)); in zend_emit_return_type_check()
2386 opline->op2.num = CG(active_op_array)->cache_size; in zend_emit_return_type_check()
2387 CG(active_op_array)->cache_size += sizeof(void*); in zend_emit_return_type_check()
2399 zend_bool returns_reference = (CG(active_op_array)->fn_flags & ZEND_ACC_RETURN_REFERENCE) != 0; in zend_emit_final_return()
2401 if (CG(active_op_array)->fn_flags & ZEND_ACC_HAS_RETURN_TYPE in zend_emit_final_return()
2402 && !(CG(active_op_array)->fn_flags & ZEND_ACC_GENERATOR)) { in zend_emit_final_return()
2403 zend_emit_return_type_check(NULL, CG(active_op_array)->arg_info - 1, 1); in zend_emit_final_return()
2481 CG(active_op_array), Z_STR(class_node->u.constant)); in zend_set_class_name_op1()
2511 opline->op2.constant = zend_add_class_name_literal(CG(active_op_array), in zend_compile_class_ref()
2594 result->u.op.var = lookup_cv(CG(active_op_array), name); in zend_try_compile_cv()
2597 name = CG(active_op_array)->vars[EX_VAR_TO_NUM(result->u.op.var)]; in zend_try_compile_cv()
2799 CG(active_op_array), Z_STR(class_node.u.constant)); in zend_compile_static_prop_common()
3284 uint32_t opnum_init = get_next_op_number(CG(active_op_array)) - 1; in zend_compile_call_common()
3292 opline = &CG(active_op_array)->opcodes[opnum_init]; in zend_compile_call_common()
3322 zend_op *opline = get_next_op(CG(active_op_array)); in zend_compile_ns_call()
3327 CG(active_op_array), Z_STR(name_node->u.constant)); in zend_compile_ns_call()
3342 zend_op *opline = get_next_op(CG(active_op_array)); in zend_compile_dynamic_call()
3346 opline->op1.constant = zend_add_class_name_literal(CG(active_op_array), class); in zend_compile_dynamic_call()
3348 opline->op2.constant = zend_add_func_name_literal(CG(active_op_array), method); in zend_compile_dynamic_call()
3352 zend_op *opline = get_next_op(CG(active_op_array)); in zend_compile_dynamic_call()
3357 opline->op2.constant = zend_add_func_name_literal(CG(active_op_array), str); in zend_compile_dynamic_call()
3384 if ((CG(compiler_options) & ZEND_COMPILE_NO_BUILTIN_STRLEN) in zend_compile_func_strlen()
3467 zend_add_literal(CG(active_op_array), &c); in zend_compile_func_defined()
3483 if (CG(one_char_string)[c]) { in zend_compile_func_chr()
3484 ZVAL_INTERNED_STR(&result->u.constant, CG(one_char_string)[c]); in zend_compile_func_chr()
3526 fbc = zend_hash_find_ptr(CG(function_table), lcname); in zend_try_compile_ct_bound_init_user_func()
3528 …|| (fbc->type == ZEND_INTERNAL_FUNCTION && (CG(compiler_options) & ZEND_COMPILE_IGNORE_INTERNAL_FU… in zend_try_compile_ct_bound_init_user_func()
3529 …|| (fbc->type == ZEND_USER_FUNCTION && (CG(compiler_options) & ZEND_COMPILE_IGNORE_USER_FUNCTIONS)) in zend_try_compile_ct_bound_init_user_func()
3614 uint32_t check_op_number = get_next_op_number(CG(active_op_array)); in zend_compile_assert()
3627 CG(active_op_array), name); in zend_compile_assert()
3642 opline = &CG(active_op_array)->opcodes[check_op_number]; in zend_compile_assert()
3643 opline->op2.opline_num = get_next_op_number(CG(active_op_array)); in zend_compile_assert()
3667 if (CG(compiler_options) & ZEND_COMPILE_NO_BUILTINS) { in zend_try_compile_special_func()
3754 fbc = zend_hash_find_ptr(CG(function_table), lcname); in zend_compile_call()
3756 …|| (fbc->type == ZEND_INTERNAL_FUNCTION && (CG(compiler_options) & ZEND_COMPILE_IGNORE_INTERNAL_FU… in zend_compile_call()
3757 …|| (fbc->type == ZEND_USER_FUNCTION && (CG(compiler_options) & ZEND_COMPILE_IGNORE_USER_FUNCTIONS)) in zend_compile_call()
3808 opline->op2.constant = zend_add_func_name_literal(CG(active_op_array), in zend_compile_method_call()
3817 CG(active_class_entry) && zend_is_scope_known()) { in zend_compile_method_call()
3819 fbc = zend_hash_find_ptr(&CG(active_class_entry)->function_table, lcname); in zend_compile_method_call()
3862 opline = get_next_op(CG(active_op_array)); in zend_compile_static_call()
3869 opline->op2.constant = zend_add_func_name_literal(CG(active_op_array), in zend_compile_static_call()
3886 ce = zend_hash_find_ptr(CG(class_table), lcname); in zend_compile_static_call()
3887 if (!ce && CG(active_class_entry) in zend_compile_static_call()
3888 && zend_string_equals_ci(CG(active_class_entry)->name, lcname)) { in zend_compile_static_call()
3889 ce = CG(active_class_entry); in zend_compile_static_call()
3894 ce = CG(active_class_entry); in zend_compile_static_call()
3918 uint32_t dcl_opnum = get_next_op_number(CG(active_op_array)); in zend_compile_new()
3921 opline = &CG(active_op_array)->opcodes[dcl_opnum]; in zend_compile_new()
3927 opline->extended_value = get_next_op_number(CG(active_op_array)); in zend_compile_new()
3932 opnum = get_next_op_number(CG(active_op_array)); in zend_compile_new()
3938 CG(active_op_array), Z_STR(class_node.u.constant)); in zend_compile_new()
3948 opline = &CG(active_op_array)->opcodes[opnum]; in zend_compile_new()
3949 opline->op2.opline_num = get_next_op_number(CG(active_op_array)); in zend_compile_new()
4007 if (!CG(active_op_array)->static_variables) { in zend_compile_static_var_common()
4008 if (CG(active_op_array)->scope) { in zend_compile_static_var_common()
4009 CG(active_op_array)->scope->ce_flags |= ZEND_HAS_STATIC_IN_METHODS; in zend_compile_static_var_common()
4011 ALLOC_HASHTABLE(CG(active_op_array)->static_variables); in zend_compile_static_var_common()
4012 zend_hash_init(CG(active_op_array)->static_variables, 8, NULL, ZVAL_PTR_DTOR, 0); in zend_compile_static_var_common()
4015 if (GC_REFCOUNT(CG(active_op_array)->static_variables) > 1) { in zend_compile_static_var_common()
4016 if (!(GC_FLAGS(CG(active_op_array)->static_variables) & IS_ARRAY_IMMUTABLE)) { in zend_compile_static_var_common()
4017 GC_REFCOUNT(CG(active_op_array)->static_variables)--; in zend_compile_static_var_common()
4019 CG(active_op_array)->static_variables = zend_array_dup(CG(active_op_array)->static_variables); in zend_compile_static_var_common()
4021 zend_hash_update(CG(active_op_array)->static_variables, Z_STR(var_node.u.constant), value); in zend_compile_static_var_common()
4029 opline->op1.var = lookup_cv(CG(active_op_array), zend_string_copy(Z_STR(var_node.u.constant))); in zend_compile_static_var_common()
4090 zend_loop_var *loop_var = zend_stack_top(&CG(loop_var_stack)); in zend_handle_loops_and_finally_ex()
4095 base = zend_stack_base(&CG(loop_var_stack)); in zend_handle_loops_and_finally_ex()
4098 zend_op *opline = get_next_op(CG(active_op_array)); in zend_handle_loops_and_finally_ex()
4111 zend_op *opline = get_next_op(CG(active_op_array)); in zend_handle_loops_and_finally_ex()
4128 opline = get_next_op(CG(active_op_array)); in zend_handle_loops_and_finally_ex()
4144 return zend_handle_loops_and_finally_ex(zend_stack_count(&CG(loop_var_stack)) + 1, return_value); in zend_handle_loops_and_finally()
4151 zend_loop_var *loop_var = zend_stack_top(&CG(loop_var_stack)); in zend_has_finally_ex()
4156 base = zend_stack_base(&CG(loop_var_stack)); in zend_has_finally_ex()
4176 return zend_has_finally_ex(zend_stack_count(&CG(loop_var_stack)) + 1); in zend_has_finally()
4183 zend_bool is_generator = (CG(active_op_array)->fn_flags & ZEND_ACC_GENERATOR) != 0; in zend_compile_return()
4184 zend_bool by_ref = (CG(active_op_array)->fn_flags & ZEND_ACC_RETURN_REFERENCE) != 0; in zend_compile_return()
4203 if ((CG(active_op_array)->fn_flags & ZEND_ACC_HAS_FINALLY_BLOCK) in zend_compile_return()
4215 if (!is_generator && CG(active_op_array)->fn_flags & ZEND_ACC_HAS_RETURN_TYPE) { in zend_compile_return()
4217 expr_ast ? &expr_node : NULL, CG(active_op_array)->arg_info - 1, 0); in zend_compile_return()
4286 if (CG(context).current_brk_cont == -1) { in zend_compile_break_continue()
4297 opline->op1.num = CG(context).current_brk_cont; in zend_compile_break_continue()
4310 if (CG(context).labels == NULL || in zend_resolve_goto_label()
4311 (dest = zend_hash_find_ptr(CG(context).labels, Z_STR_P(label))) == NULL in zend_resolve_goto_label()
4313 CG(in_compilation) = 1; in zend_resolve_goto_label()
4314 CG(active_op_array) = op_array; in zend_resolve_goto_label()
4315 CG(zend_lineno) = opline->lineno; in zend_resolve_goto_label()
4323 for (; current != dest->brk_cont; current = CG(context).brk_cont_array[current].parent) { in zend_resolve_goto_label()
4325 CG(in_compilation) = 1; in zend_resolve_goto_label()
4326 CG(active_op_array) = op_array; in zend_resolve_goto_label()
4327 CG(zend_lineno) = opline->lineno; in zend_resolve_goto_label()
4330 if (CG(context).brk_cont_array[current].start >= 0) { in zend_resolve_goto_label()
4368 uint32_t opnum_start = get_next_op_number(CG(active_op_array)); in zend_compile_goto()
4375 opline->op1.num = get_next_op_number(CG(active_op_array)) - opnum_start - 1; in zend_compile_goto()
4376 opline->extended_value = CG(context).current_brk_cont; in zend_compile_goto()
4385 if (!CG(context).labels) { in zend_compile_label()
4386 ALLOC_HASHTABLE(CG(context).labels); in zend_compile_label()
4387 zend_hash_init(CG(context).labels, 8, NULL, label_ptr_dtor, 0); in zend_compile_label()
4390 dest.brk_cont = CG(context).current_brk_cont; in zend_compile_label()
4391 dest.opline_num = get_next_op_number(CG(active_op_array)); in zend_compile_label()
4393 if (!zend_hash_add_mem(CG(context).labels, label, &dest, sizeof(zend_label))) { in zend_compile_label()
4410 opnum_start = get_next_op_number(CG(active_op_array)); in zend_compile_while()
4413 opnum_cond = get_next_op_number(CG(active_op_array)); in zend_compile_while()
4433 opnum_start = get_next_op_number(CG(active_op_array)); in zend_compile_do_while()
4436 opnum_cond = get_next_op_number(CG(active_op_array)); in zend_compile_do_while()
4484 opnum_start = get_next_op_number(CG(active_op_array)); in zend_compile_for()
4487 opnum_loop = get_next_op_number(CG(active_op_array)); in zend_compile_for()
4538 opnum_reset = get_next_op_number(CG(active_op_array)); in zend_compile_foreach()
4543 opnum_fetch = get_next_op_number(CG(active_op_array)); in zend_compile_foreach()
4553 opline->op2.var = get_temporary_variable(CG(active_op_array)); in zend_compile_foreach()
4563 opline = &CG(active_op_array)->opcodes[opnum_fetch]; in zend_compile_foreach()
4572 opline = &CG(active_op_array)->opcodes[opnum_reset]; in zend_compile_foreach()
4573 opline->op2.opline_num = get_next_op_number(CG(active_op_array)); in zend_compile_foreach()
4575 opline = &CG(active_op_array)->opcodes[opnum_fetch]; in zend_compile_foreach()
4576 opline->extended_value = get_next_op_number(CG(active_op_array)); in zend_compile_foreach()
4643 case_node.u.op.var = get_temporary_variable(CG(active_op_array)); in zend_compile_switch()
4653 CG(zend_lineno) = case_ast->lineno; in zend_compile_switch()
4700 zend_end_loop(get_next_op_number(CG(active_op_array)), &expr_node); in zend_compile_switch()
4704 opline = get_next_op(CG(active_op_array)); in zend_compile_switch()
4726 uint32_t orig_fast_call_var = CG(context).fast_call_var; in zend_compile_try()
4727 uint32_t orig_try_catch_offset = CG(context).try_catch_offset; in zend_compile_try()
4734 if (CG(context).labels) { in zend_compile_try()
4736 ZEND_HASH_REVERSE_FOREACH_PTR(CG(context).labels, label) { in zend_compile_try()
4737 if (label->opline_num == get_next_op_number(CG(active_op_array))) { in zend_compile_try()
4744 try_catch_offset = zend_add_try_element(get_next_op_number(CG(active_op_array))); in zend_compile_try()
4748 if (!(CG(active_op_array)->fn_flags & ZEND_ACC_HAS_FINALLY_BLOCK)) { in zend_compile_try()
4749 CG(active_op_array)->fn_flags |= ZEND_ACC_HAS_FINALLY_BLOCK; in zend_compile_try()
4751 CG(context).fast_call_var = get_temporary_variable(CG(active_op_array)); in zend_compile_try()
4756 fast_call.var_num = CG(context).fast_call_var; in zend_compile_try()
4758 zend_stack_push(&CG(loop_var_stack), &fast_call); in zend_compile_try()
4761 CG(context).try_catch_offset = try_catch_offset; in zend_compile_try()
4780 CG(zend_lineno) = catch_ast->lineno; in zend_compile_try()
4791 opnum_catch = get_next_op_number(CG(active_op_array)); in zend_compile_try()
4793 CG(active_op_array)->try_catch_array[try_catch_offset].catch_op = opnum_catch; in zend_compile_try()
4796 opline = get_next_op(CG(active_op_array)); in zend_compile_try()
4799 opline->op1.constant = zend_add_class_name_literal(CG(active_op_array), in zend_compile_try()
4807 opline->op2.var = lookup_cv(CG(active_op_array), zend_string_copy(Z_STR_P(var_name))); in zend_compile_try()
4813 opline = &CG(active_op_array)->opcodes[opnum_catch]; in zend_compile_try()
4814 opline->extended_value = get_next_op_number(CG(active_op_array)); in zend_compile_try()
4830 opline = &CG(active_op_array)->opcodes[opnum_catch]; in zend_compile_try()
4832 opline->extended_value = get_next_op_number(CG(active_op_array)); in zend_compile_try()
4842 uint32_t opnum_jmp = get_next_op_number(CG(active_op_array)) + 1; in zend_compile_try()
4845 zend_stack_del_top(&CG(loop_var_stack)); in zend_compile_try()
4850 discard_exception.var_num = CG(context).fast_call_var; in zend_compile_try()
4851 zend_stack_push(&CG(loop_var_stack), &discard_exception); in zend_compile_try()
4853 CG(zend_lineno) = finally_ast->lineno; in zend_compile_try()
4858 opline->result.var = CG(context).fast_call_var; in zend_compile_try()
4862 CG(context).in_finally++; in zend_compile_try()
4864 CG(context).in_finally--; in zend_compile_try()
4866 CG(active_op_array)->try_catch_array[try_catch_offset].finally_op = opnum_jmp + 1; in zend_compile_try()
4867 CG(active_op_array)->try_catch_array[try_catch_offset].finally_end in zend_compile_try()
4868 = get_next_op_number(CG(active_op_array)); in zend_compile_try()
4872 opline->op1.var = CG(context).fast_call_var; in zend_compile_try()
4877 CG(context).fast_call_var = orig_fast_call_var; in zend_compile_try()
4880 zend_stack_del_top(&CG(loop_var_stack)); in zend_compile_try()
4883 CG(context).try_catch_offset = orig_try_catch_offset; in zend_compile_try()
4905 if (CG(multibyte)) { in zend_handle_encoding_declaration()
4911 CG(encoding_declared) = 1; in zend_handle_encoding_declaration()
4941 zend_ast_list *file_ast = zend_ast_get_list(CG(ast)); in zend_declare_is_first_statement()
5008 CG(active_op_array)->fn_flags |= ZEND_ACC_STRICT_TYPES; in zend_compile_declare()
5095 zend_op_array *op_array = CG(active_op_array); in zend_compile_params()
5148 var_node.u.op.var = lookup_cv(CG(active_op_array), zend_string_copy(name)); in zend_compile_params()
5172 uint32_t cops = CG(compiler_options); in zend_compile_params()
5173CG(compiler_options) |= ZEND_COMPILE_NO_CONSTANT_SUBSTITUTION | ZEND_COMPILE_NO_PERSISTENT_CONSTAN… in zend_compile_params()
5177 CG(compiler_options) = cops; in zend_compile_params()
5316 opline->op2.var = lookup_cv(CG(active_op_array), zend_string_copy(var_name)); in zend_compile_closure_binding()
5324 zend_op_array *op_array = CG(active_op_array); in zend_compile_closure_uses()
5358 zend_class_entry *ce = CG(active_class_entry); in zend_begin_method_decl()
5553 zend_hash_update_ptr(CG(function_table), key, op_array); in zend_begin_func_decl()
5560 opline = get_next_op(CG(active_op_array)); in zend_begin_func_decl()
5565 zend_add_literal_string(CG(active_op_array), &key); in zend_begin_func_decl()
5582 zend_op_array *orig_op_array = CG(active_op_array); in zend_compile_func_decl()
5583 zend_op_array *op_array = zend_arena_alloc(&CG(arena), sizeof(zend_op_array)); in zend_compile_func_decl()
5609 CG(active_op_array) = op_array; in zend_compile_func_decl()
5613 if (CG(compiler_options) & ZEND_COMPILE_EXTENDED_INFO) { in zend_compile_func_decl()
5623 zend_stack_push(&CG(loop_var_stack), (void *) &dummy_var); in zend_compile_func_decl()
5627 if (CG(active_op_array)->fn_flags & ZEND_ACC_GENERATOR) { in zend_compile_func_decl()
5638 CG(active_class_entry), (zend_function *) op_array, E_COMPILE_ERROR); in zend_compile_func_decl()
5642 CG(zend_lineno) = decl->end_lineno; in zend_compile_func_decl()
5647 pass_two(CG(active_op_array)); in zend_compile_func_decl()
5651 zend_stack_del_top(&CG(loop_var_stack)); in zend_compile_func_decl()
5653 CG(active_op_array) = orig_op_array; in zend_compile_func_decl()
5661 zend_class_entry *ce = CG(active_class_entry); in zend_compile_prop_decl()
5712 zend_class_entry *ce = CG(active_class_entry); in zend_compile_class_const_decl()
5793 zend_add_to_list(&CG(active_class_entry)->trait_precedences, precedence); in zend_compile_trait_precedence()
5823 zend_add_to_list(&CG(active_class_entry)->trait_aliases, alias); in zend_compile_trait_alias()
5831 zend_class_entry *ce = CG(active_class_entry); in zend_compile_use_trait()
5853 opline = get_next_op(CG(active_op_array)); in zend_compile_use_trait()
5857 opline->op2.constant = zend_add_class_name_literal(CG(active_op_array), in zend_compile_use_trait()
5899 opline->op2.constant = zend_add_class_name_literal(CG(active_op_array), in zend_compile_implements()
5902 CG(active_class_entry)->num_interfaces++; in zend_compile_implements()
5912 zend_string *filename = CG(active_op_array)->filename; in zend_generate_anon_class_name()
5928 zend_class_entry *ce = zend_arena_alloc(&CG(arena), sizeof(zend_class_entry)); in zend_compile_class_decl()
5932 zend_class_entry *original_ce = CG(active_class_entry); in zend_compile_class_decl()
5938 if (CG(active_class_entry)) { in zend_compile_class_decl()
5991 opline = get_next_op(CG(active_op_array)); in zend_compile_class_decl()
6007 if (!zend_hash_exists(CG(class_table), lcname)) { in zend_compile_class_decl()
6008 zend_hash_add_ptr(CG(class_table), lcname, ce); in zend_compile_class_decl()
6029 zend_add_literal_string(CG(active_op_array), &key); in zend_compile_class_decl()
6031 zend_hash_update_ptr(CG(class_table), key, ce); in zend_compile_class_decl()
6034 CG(active_class_entry) = ce; in zend_compile_class_decl()
6039 CG(zend_lineno) = ast->lineno; in zend_compile_class_decl()
6116 CG(active_class_entry) = original_ce; in zend_compile_class_decl()
6180 zend_class_entry *ce = zend_hash_find_ptr(CG(class_table), lookup_name); in zend_check_use_conflict()
6182 && ce->info.user.filename == CG(compiled_filename) in zend_check_use_conflict()
6190 zend_function *fn = zend_hash_find_ptr(CG(function_table), lookup_name); in zend_check_use_conflict()
6192 && fn->op_array.filename == CG(compiled_filename) in zend_check_use_conflict()
6200 zend_string *filename = zend_hash_find_ptr(&CG(const_filenames), lookup_name); in zend_check_use_conflict()
6201 if (filename && filename == CG(compiled_filename)) { in zend_check_use_conflict()
6343 zend_hash_add_ptr(&CG(const_filenames), name, CG(compiled_filename)); in zend_compile_const_decl()
6375 || (with_bracket && !FC(has_bracketed_namespaces))) && CG(active_op_array)->last > 0 in zend_compile_namespace()
6378 uint32_t num = CG(active_op_array)->last; in zend_compile_namespace()
6380 (CG(active_op_array)->opcodes[num-1].opcode == ZEND_EXT_STMT || in zend_compile_namespace()
6381 CG(active_op_array)->opcodes[num-1].opcode == ZEND_TICKS)) { in zend_compile_namespace()
6444 zend_op_array *op_array = CG(active_op_array); in zend_try_ct_eval_magic_const()
6445 zend_class_entry *ce = CG(active_class_entry); in zend_try_ct_eval_magic_const()
6452 ZVAL_STR_COPY(zv, CG(compiled_filename)); in zend_try_ct_eval_magic_const()
6456 zend_string *filename = CG(compiled_filename); in zend_try_ct_eval_magic_const()
6853 opnum_jmpz = get_next_op_number(CG(active_op_array)); in zend_compile_short_circuiting()
6860 opline_jmpz->result.var = get_temporary_variable(CG(active_op_array)); in zend_compile_short_circuiting()
6939 opnum_jmp_set = get_next_op_number(CG(active_op_array)); in zend_compile_shorthand_conditional()
6998 opnum = get_next_op_number(CG(active_op_array)); in zend_compile_coalesce()
7006 opline = &CG(active_op_array)->opcodes[opnum]; in zend_compile_coalesce()
7007 opline->op2.opline_num = get_next_op_number(CG(active_op_array)); in zend_compile_coalesce()
7052 zend_bool returns_by_ref = (CG(active_op_array)->fn_flags & ZEND_ACC_RETURN_REFERENCE) != 0; in zend_compile_yield()
7085 if (CG(active_op_array)->fn_flags & ZEND_ACC_RETURN_REFERENCE) { in zend_compile_yield_from()
7117 CG(active_op_array), Z_STR(class_node.u.constant)); in zend_compile_instanceof()
7200 range = zend_start_live_range(CG(active_op_array), get_next_op_number(CG(active_op_array))); in zend_compile_silence()
7213 zend_end_live_range(CG(active_op_array), range, get_next_op_number(CG(active_op_array)), in zend_compile_silence()
7278 opnum_init = get_next_op_number(CG(active_op_array)); in zend_compile_array()
7301 opline = &CG(active_op_array)->opcodes[opnum_init]; in zend_compile_array()
7318 zend_ast *last = CG(ast); in zend_compile_const()
7343 CG(active_op_array), resolved_name, 0); in zend_compile_const()
7349 CG(active_op_array), resolved_name, 1); in zend_compile_const()
7352 CG(active_op_array), resolved_name, 0); in zend_compile_const()
7423 if (CG(active_class_entry) && zend_is_scope_known()) { in zend_compile_resolve_class_name()
7425 ZVAL_STR_COPY(&result->u.constant, CG(active_class_entry)->name); in zend_compile_resolve_class_name()
7449 zend_op *opline = get_next_op(CG(active_op_array)); in zend_compile_rope_add()
7497 rope_init_lineno = get_next_op_number(CG(active_op_array)); in zend_compile_encaps_list()
7519 init_opline = CG(active_op_array)->opcodes + rope_init_lineno; in zend_compile_encaps_list()
7530 opline->result.var = get_temporary_variable(CG(active_op_array)); in zend_compile_encaps_list()
7540 opline->result.var = get_temporary_variable(CG(active_op_array)); in zend_compile_encaps_list()
7545 uint32_t range = zend_start_live_range(CG(active_op_array), rope_init_lineno); in zend_compile_encaps_list()
7549 opline->result.var = get_temporary_variable(CG(active_op_array)); in zend_compile_encaps_list()
7550 var = opline->op1.var = get_temporary_variable(CG(active_op_array)); in zend_compile_encaps_list()
7556 get_temporary_variable(CG(active_op_array)); in zend_compile_encaps_list()
7560 zend_end_live_range(CG(active_op_array), range, opline - CG(active_op_array)->opcodes, in zend_compile_encaps_list()
7589 CG(active_class_entry) && in zend_compile_magic_const()
7590 (CG(active_class_entry)->ce_flags & ZEND_ACC_TRAIT) != 0); in zend_compile_magic_const()
7692 CG(active_class_entry) && in zend_compile_const_expr_magic_const()
7693 (CG(active_class_entry)->ce_flags & ZEND_ACC_TRAIT) != 0); in zend_compile_const_expr_magic_const()
7776 CG(zend_lineno) = ((zend_ast_decl *) ast)->end_lineno; in zend_compile_top_stmt()
7788 CG(zend_lineno) = ast->lineno; in zend_compile_stmt()
7790 if ((CG(compiler_options) & ZEND_COMPILE_EXTENDED_INFO) && !zend_is_unticked_stmt(ast)) { in zend_compile_stmt()
7898 CG(zend_lineno) = zend_ast_get_lineno(ast); in zend_compile_expr()
8021 CG(zend_lineno) = zend_ast_get_lineno(ast); in zend_compile_var()
8265 if (CG(one_char_string)[c]) { in zend_eval_const_expr()
8266 ZVAL_INTERNED_STR(&result, CG(one_char_string)[c]); in zend_eval_const_expr()