|
| 1 | +/* |
| 2 | + * +----------------------------------------------------------------------+ |
| 3 | + * | Zend JIT | |
| 4 | + * +----------------------------------------------------------------------+ |
| 5 | + * | Copyright (c) The PHP Group | |
| 6 | + * +----------------------------------------------------------------------+ |
| 7 | + * | This source file is subject to version 3.01 of the PHP license, | |
| 8 | + * | that is bundled with this package in the file LICENSE, and is | |
| 9 | + * | available through the world-wide-web at the following url: | |
| 10 | + * | https://www.php.net/license/3_01.txt | |
| 11 | + * | If you did not receive a copy of the PHP license and are unable to | |
| 12 | + * | obtain it through the world-wide-web, please send a note to | |
| 13 | + * | license@php.net so we can mail you a copy immediately. | |
| 14 | + * +----------------------------------------------------------------------+ |
| 15 | + */ |
| 16 | + |
| 17 | +#ifndef ZEND_JIT_HELPERS_H |
| 18 | +#define ZEND_JIT_HELPERS_H |
| 19 | + |
| 20 | +#include "zend_compile.h" |
| 21 | + |
| 22 | +static zend_never_inline zend_op_array* ZEND_FASTCALL zend_jit_init_func_run_time_cache_helper(zend_op_array *op_array);; |
| 23 | +static zend_function* ZEND_FASTCALL zend_jit_find_func_helper(zend_string *name, void **cache_slot); |
| 24 | +static uint32_t ZEND_FASTCALL zend_jit_jmp_frameless_helper(zval *func_name, void **cache_slot); |
| 25 | +static zend_function* ZEND_FASTCALL zend_jit_find_ns_func_helper(zval *func_name, void **cache_slot); |
| 26 | +static ZEND_COLD void ZEND_FASTCALL zend_jit_invalid_method_call(zval *object); |
| 27 | +static ZEND_COLD void ZEND_FASTCALL zend_jit_invalid_method_call_tmp(zval *object); |
| 28 | +static void ZEND_FASTCALL zend_jit_unref_helper(zval *zv); |
| 29 | +static zend_function* ZEND_FASTCALL zend_jit_find_method_helper(zend_object *obj, zval *function_name, zend_object **obj_ptr); |
| 30 | +static zend_function* ZEND_FASTCALL zend_jit_find_method_tmp_helper(zend_object *obj, zval *function_name, zend_object **obj_ptr); |
| 31 | +static zend_class_entry* ZEND_FASTCALL zend_jit_find_class_helper(zend_execute_data *execute_data); |
| 32 | +static zend_function* ZEND_FASTCALL zend_jit_find_static_method_helper(zend_execute_data *execute_data, zend_class_entry *ce); |
| 33 | +static zend_execute_data* ZEND_FASTCALL zend_jit_push_this_method_call_frame(zend_class_entry *scope, zend_function *fbc, uint32_t num_args); |
| 34 | +static zend_execute_data* ZEND_FASTCALL zend_jit_push_static_method_call_frame(zend_object *obj, zend_function *fbc, uint32_t num_args); |
| 35 | +static zend_execute_data* ZEND_FASTCALL zend_jit_push_static_method_call_frame_tmp(zend_object *obj, zend_function *fbc, uint32_t num_args); |
| 36 | +static zend_execute_data* ZEND_FASTCALL zend_jit_extend_stack_helper(uint32_t used_stack, zend_function *fbc); |
| 37 | +static zend_execute_data* ZEND_FASTCALL zend_jit_int_extend_stack_helper(uint32_t used_stack); |
| 38 | +static zval* ZEND_FASTCALL zend_jit_symtable_find(HashTable *ht, zend_string *str); |
| 39 | +static zval* ZEND_FASTCALL zend_jit_hash_index_lookup_rw_no_packed(HashTable *ht, zend_long idx); |
| 40 | +static zval* ZEND_FASTCALL zend_jit_hash_index_lookup_rw(HashTable *ht, zend_long idx); |
| 41 | +static zval* ZEND_FASTCALL zend_jit_hash_lookup_rw(HashTable *ht, zend_string *str); |
| 42 | +static zval* ZEND_FASTCALL zend_jit_symtable_lookup_rw(HashTable *ht, zend_string *str); |
| 43 | +static zval* ZEND_FASTCALL zend_jit_symtable_lookup_w(HashTable *ht, zend_string *str); |
| 44 | +static int ZEND_FASTCALL zend_jit_undefined_op_helper(uint32_t var); |
| 45 | +static int ZEND_FASTCALL zend_jit_undefined_op_helper_write(HashTable *ht, uint32_t var); |
| 46 | +static void ZEND_FASTCALL zend_jit_fetch_dim_r_helper(zend_array *ht, zval *dim, zval *result); |
| 47 | +static void ZEND_FASTCALL zend_jit_fetch_dim_is_helper(zend_array *ht, zval *dim, zval *result); |
| 48 | +static int ZEND_FASTCALL zend_jit_fetch_dim_isset_helper(zend_array *ht, zval *dim); |
| 49 | +static zval* ZEND_FASTCALL zend_jit_fetch_dim_rw_helper(zend_array *ht, zval *dim); |
| 50 | +static zval* ZEND_FASTCALL zend_jit_fetch_dim_w_helper(zend_array *ht, zval *dim); |
| 51 | +static zend_string* ZEND_FASTCALL zend_jit_fetch_dim_str_offset_r_helper(zend_string *str, zend_long offset); |
| 52 | +static zend_string* ZEND_FASTCALL zend_jit_fetch_dim_str_r_helper(zend_string *str, zval *dim); |
| 53 | +static void ZEND_FASTCALL zend_jit_fetch_dim_str_is_helper(zend_string *str, zval *dim, zval *result); |
| 54 | +static void ZEND_FASTCALL zend_jit_fetch_dim_obj_r_helper(zval *container, zval *dim, zval *result); |
| 55 | +static void ZEND_FASTCALL zend_jit_fetch_dim_obj_is_helper(zval *container, zval *dim, zval *result); |
| 56 | +static zend_always_inline void ZEND_FASTCALL zend_jit_fetch_dim_obj_helper(zval *object_ptr, zval *dim, zval *result, int type); |
| 57 | +static void ZEND_FASTCALL zend_jit_fetch_dim_obj_w_helper(zval *object_ptr, zval *dim, zval *result); |
| 58 | +static void ZEND_FASTCALL zend_jit_fetch_dim_obj_rw_helper(zval *object_ptr, zval *dim, zval *result); |
| 59 | +static void ZEND_FASTCALL zend_jit_assign_dim_helper(zval *object_ptr, zval *dim, zval *value, zval *result); |
| 60 | +static void ZEND_FASTCALL zend_jit_assign_dim_op_helper(zval *container, zval *dim, zval *value, binary_op_type binary_op); |
| 61 | +static void ZEND_FASTCALL zend_jit_fast_assign_concat_helper(zval *op1, zval *op2); |
| 62 | +static void ZEND_FASTCALL zend_jit_fast_concat_helper(zval *result, zval *op1, zval *op2); |
| 63 | +static void ZEND_FASTCALL zend_jit_fast_concat_tmp_helper(zval *result, zval *op1, zval *op2); |
| 64 | +static int ZEND_FASTCALL zend_jit_isset_dim_helper(zval *container, zval *offset); |
| 65 | +static void ZEND_FASTCALL zend_jit_free_call_frame(zend_execute_data *call); |
| 66 | +static zend_reference* ZEND_FASTCALL zend_jit_fetch_global_helper(zend_string *varname, void **cache_slot); |
| 67 | +static bool ZEND_FASTCALL zend_jit_verify_arg_slow(zval *arg, zend_arg_info *arg_info); |
| 68 | +static void ZEND_FASTCALL zend_jit_verify_return_slow(zval *arg, const zend_op_array *op_array, zend_arg_info *arg_info); |
| 69 | +static void ZEND_FASTCALL zend_jit_fetch_obj_r_slow(zend_object *zobj); |
| 70 | +static void ZEND_FASTCALL zend_jit_fetch_obj_r_dynamic(zend_object *zobj, intptr_t prop_offset); |
| 71 | +static void ZEND_FASTCALL zend_jit_fetch_obj_is_slow(zend_object *zobj); |
| 72 | +static void ZEND_FASTCALL zend_jit_fetch_obj_is_dynamic(zend_object *zobj, intptr_t prop_offset); |
| 73 | +static zval* ZEND_FASTCALL zend_jit_fetch_obj_r_slow_ex(zend_object *zobj); |
| 74 | +static zval* ZEND_FASTCALL zend_jit_fetch_obj_r_dynamic_ex(zend_object *zobj, intptr_t prop_offset); |
| 75 | +static zval* ZEND_FASTCALL zend_jit_fetch_obj_is_slow_ex(zend_object *zobj); |
| 76 | +static zval* ZEND_FASTCALL zend_jit_fetch_obj_is_dynamic_ex(zend_object *zobj, intptr_t prop_offset); |
| 77 | +static void ZEND_FASTCALL zend_jit_fetch_obj_w_slow(zend_object *zobj); |
| 78 | +static void ZEND_FASTCALL zend_jit_check_array_promotion(zval *val, zend_property_info *prop); |
| 79 | +static void ZEND_FASTCALL zend_jit_create_typed_ref(zval *val, zend_property_info *prop, zval *result); |
| 80 | +static void ZEND_FASTCALL zend_jit_extract_helper(zend_refcounted *garbage); |
| 81 | +static void ZEND_FASTCALL zend_jit_vm_stack_free_args_helper(zend_execute_data *call); |
| 82 | +static zval* ZEND_FASTCALL zend_jit_assign_const_to_typed_ref(zend_reference *ref, zval *value); |
| 83 | +static zval* ZEND_FASTCALL zend_jit_assign_tmp_to_typed_ref(zend_reference *ref, zval *value); |
| 84 | +static zval* ZEND_FASTCALL zend_jit_assign_var_to_typed_ref(zend_reference *ref, zval *value); |
| 85 | +static zval* ZEND_FASTCALL zend_jit_assign_cv_to_typed_ref(zend_reference *ref, zval *value); |
| 86 | +static zval* ZEND_FASTCALL zend_jit_assign_const_to_typed_ref2(zend_reference *ref, zval *value, zval *result); |
| 87 | +static zval* ZEND_FASTCALL zend_jit_assign_tmp_to_typed_ref2(zend_reference *ref, zval *value, zval *result); |
| 88 | +static zval* ZEND_FASTCALL zend_jit_assign_var_to_typed_ref2(zend_reference *ref, zval *value, zval *result); |
| 89 | +static zval* ZEND_FASTCALL zend_jit_assign_cv_to_typed_ref2(zend_reference *ref, zval *value, zval *result); |
| 90 | +static void ZEND_FASTCALL zend_jit_pre_inc_typed_ref(zend_reference *ref, zval *ret); |
| 91 | +static void ZEND_FASTCALL zend_jit_pre_dec_typed_ref(zend_reference *ref, zval *ret); |
| 92 | +static void ZEND_FASTCALL zend_jit_post_inc_typed_ref(zend_reference *ref, zval *ret); |
| 93 | +static void ZEND_FASTCALL zend_jit_post_dec_typed_ref(zend_reference *ref, zval *ret); |
| 94 | +static void ZEND_FASTCALL zend_jit_assign_op_to_typed_ref(zend_reference *ref, zval *val, binary_op_type binary_op); |
| 95 | +static void ZEND_FASTCALL zend_jit_assign_op_to_typed_ref_tmp(zend_reference *ref, zval *val, binary_op_type binary_op); |
| 96 | +static void ZEND_FASTCALL zend_jit_only_vars_by_reference(zval *arg); |
| 97 | +static void ZEND_FASTCALL zend_jit_invalid_array_use(const zval *container); |
| 98 | +static void ZEND_FASTCALL zend_jit_invalid_array_access(zval *container); |
| 99 | +static void ZEND_FASTCALL zend_jit_nan_coerced_to_type_warning(void); |
| 100 | +static void ZEND_FASTCALL zend_jit_invalid_property_read(zval *container, const char *property_name); |
| 101 | +static void ZEND_FASTCALL zend_jit_invalid_property_write(zval *container, const char *property_name); |
| 102 | +static void ZEND_FASTCALL zend_jit_invalid_property_incdec(zval *container, const char *property_name); |
| 103 | +static void ZEND_FASTCALL zend_jit_invalid_property_assign(zval *container, const char *property_name); |
| 104 | +static void ZEND_FASTCALL zend_jit_invalid_property_assign_op(zval *container, const char *property_name); |
| 105 | +static zval * ZEND_FASTCALL zend_jit_prepare_assign_dim_ref(zval *ref); |
| 106 | +static void ZEND_FASTCALL zend_jit_pre_inc(zval *var_ptr, zval *ret); |
| 107 | +static void ZEND_FASTCALL zend_jit_pre_dec(zval *var_ptr, zval *ret); |
| 108 | +static zend_never_inline void ZEND_FASTCALL _zend_hash_iterators_remove(HashTable *ht); |
| 109 | +static void ZEND_FASTCALL zend_jit_array_free(HashTable *ht); |
| 110 | +static HashTable *ZEND_FASTCALL zend_jit_zval_array_dup(zval *arr); |
| 111 | +static zend_array *ZEND_FASTCALL zend_jit_add_arrays_helper(zend_array *op1, zend_array *op2); |
| 112 | +static void ZEND_FASTCALL zend_jit_assign_obj_helper(zend_object *zobj, zend_string *name, zval *value, void **cache_slot, zval *result); |
| 113 | +static void ZEND_FASTCALL zend_jit_assign_to_typed_prop(zval *property_val, zend_property_info *info, zval *value, zval *result); |
| 114 | +static void ZEND_FASTCALL zend_jit_assign_op_to_typed_prop(zval *zptr, zend_property_info *prop_info, zval *value, binary_op_type binary_op); |
| 115 | +static void ZEND_FASTCALL zend_jit_assign_obj_op_helper(zend_object *zobj, zend_string *name, zval *value, void **cache_slot, binary_op_type binary_op); |
| 116 | +static void ZEND_FASTCALL zend_jit_inc_typed_prop(zval *var_ptr, zend_property_info *prop_info); |
| 117 | +static void ZEND_FASTCALL zend_jit_dec_typed_prop(zval *var_ptr, zend_property_info *prop_info); |
| 118 | +static void ZEND_FASTCALL zend_jit_pre_inc_typed_prop(zval *var_ptr, zend_property_info *prop_info, zval *result); |
| 119 | +static void ZEND_FASTCALL zend_jit_pre_dec_typed_prop(zval *var_ptr, zend_property_info *prop_info, zval *result); |
| 120 | +static void ZEND_FASTCALL zend_jit_post_inc_typed_prop(zval *var_ptr, zend_property_info *prop_info, zval *result); |
| 121 | +static void ZEND_FASTCALL zend_jit_post_dec_typed_prop(zval *var_ptr, zend_property_info *prop_info, zval *result); |
| 122 | +static void ZEND_FASTCALL zend_jit_pre_inc_obj_helper(zend_object *zobj, zend_string *name, void **cache_slot, zval *result); |
| 123 | +static void ZEND_FASTCALL zend_jit_pre_dec_obj_helper(zend_object *zobj, zend_string *name, void **cache_slot, zval *result); |
| 124 | +static void ZEND_FASTCALL zend_jit_post_inc_obj_helper(zend_object *zobj, zend_string *name, void **cache_slot, zval *result); |
| 125 | +static void ZEND_FASTCALL zend_jit_post_dec_obj_helper(zend_object *zobj, zend_string *name, void **cache_slot, zval *result); |
| 126 | +static void ZEND_FASTCALL zend_jit_uninit_static_prop(void); |
| 127 | +static void ZEND_FASTCALL zend_jit_free_trampoline_helper(zend_function *func); |
| 128 | +static void ZEND_FASTCALL zend_jit_exception_in_interrupt_handler_helper(void); |
| 129 | +static zend_string* ZEND_FASTCALL zend_jit_rope_end(zend_string **rope, uint32_t count); |
| 130 | +static zend_never_inline bool zend_handle_fetch_obj_flags(zval *result, zval *ptr, zend_object *obj, zend_property_info *prop_info, uint32_t flags); |
| 131 | + |
| 132 | +#endif |
0 commit comments