50 return persistent_script;
55 if (!destroy_elements) {
72 for (uint32_t i = 0; i < persistent_script->
num_warnings; i++) {
75 zend_string_release(info->
message);
83 efree(persistent_script);
105 for (;
p !=
end;
p++) {
110 _zend_hash_append_ptr(dst,
p->key,
function);
136 for (;
p !=
end;
p++) {
141 _zend_hash_append_ptr(dst,
p->key, ce);
157 for (;
p !=
end;
p++) {
164 _zend_hash_append_ptr_ex(target,
p->key,
Z_PTR(
p->val), 1);
169 target->nInternalPointer = 0;
174 function1 =
Z_PTR(
p->val);
176 CG(in_compilation) = 1;
192 _zend_accel_function_hash_copy(target, source, 0);
197 _zend_accel_function_hash_copy(target, source, 1);
208 for (;
p !=
end;
p++) {
227 CG(in_compilation) = 1;
237 _zend_hash_append_ptr_ex(target,
p->key,
Z_PTR(
p->val), 1);
248 target->nInternalPointer = 0;
253 _zend_accel_class_hash_copy(target, source, 0);
258 _zend_accel_class_hash_copy(target, source, 1);
301 for (
zend_op *opline = op_array->
opcodes; opline < opline_end; opline++) {
306 while (!zend_string_equals(early_binding->
rtd_key, rtd_key)) {
308 if (early_binding >= early_binding_end) {
313 early_binding->
cache_slot = opline->extended_value;
315 if (early_binding >= early_binding_end) {
327 zend_string_release(early_binding->
lcname);
328 zend_string_release(early_binding->
rtd_key);
337static void zend_accel_do_delayed_early_binding(
348 bool orig_in_compilation =
CG(in_compilation);
350 CG(in_compilation) = 1;
365 if (ce && early_binding->
cache_slot != (uint32_t) -1) {
366 *(
void**)((
char*)run_time_cache + early_binding->
cache_slot) = ce;
370 CG(compiled_filename) = orig_compiled_filename;
371 CG(in_compilation) = orig_in_compilation;
382 if (
ZCSG(map_ptr_last) >
CG(map_ptr_last)) {
390 static const char haltoff[] =
"__COMPILER_HALT_OFFSET__";
393 if (!zend_hash_exists(
EG(zend_constants),
name)) {
412 zend_accel_class_hash_copy_notify(
CG(class_table), &persistent_script->
script.
class_table);
417 zend_accel_do_delayed_early_binding(persistent_script, op_array);
454#define ADLER32_BASE 65521
455#define ADLER32_NMAX 5552
458#define ADLER32_SCALAR_DO1(buf) {s1 += *(buf); s2 += s1;}
459#define ADLER32_SCALAR_DO2(buf, i) ADLER32_SCALAR_DO1(buf + i); ADLER32_SCALAR_DO1(buf + i + 1);
460#define ADLER32_SCALAR_DO4(buf, i) ADLER32_SCALAR_DO2(buf, i); ADLER32_SCALAR_DO2(buf, i + 2);
461#define ADLER32_SCALAR_DO8(buf, i) ADLER32_SCALAR_DO4(buf, i); ADLER32_SCALAR_DO4(buf, i + 4);
462#define ADLER32_SCALAR_DO16(buf) ADLER32_SCALAR_DO8(buf, 0); ADLER32_SCALAR_DO8(buf, 8);
464static zend_always_inline void adler32_do16_loop(
unsigned char *
buf,
unsigned char *
end,
unsigned int *s1_out,
unsigned int *s2_out)
466 unsigned int s1 = *s1_out;
467 unsigned int s2 = *s2_out;
470 const __m128i zero = _mm_setzero_si128();
472 __m128i accumulate_s2 = zero;
473 unsigned int accumulate_s1 = 0;
476 __m128i read = _mm_loadu_si128((__m128i *)
buf);
479 __m128i lower = _mm_unpacklo_epi8(read, zero);
480 __m128i higher = _mm_unpackhi_epi8(read, zero);
481 lower = _mm_madd_epi16(lower, _mm_set_epi16(9, 10, 11, 12, 13, 14, 15, 16));
482 higher = _mm_madd_epi16(higher, _mm_set_epi16(1, 2, 3, 4, 5, 6, 7, 8));
487 __m128i sum = _mm_add_epi32(lower, higher);
488 accumulate_s2 = _mm_add_epi32(accumulate_s2, sum);
492 sum = _mm_sad_epu8(read, zero);
493 s1 += _mm_cvtsi128_si32(sum) + _mm_extract_epi16(sum, 4);
499 __m128i shuffled = _mm_shuffle_epi32(accumulate_s2, _MM_SHUFFLE(1, 0, 0, 2));
500 accumulate_s2 = _mm_add_epi32(accumulate_s2, shuffled);
501 shuffled = _mm_shuffle_epi32(accumulate_s2, _MM_SHUFFLE(3, 3, 3, 3));
502 accumulate_s2 = _mm_add_epi32(accumulate_s2, shuffled);
503 s2 += accumulate_s1 * 16 + _mm_cvtsi128_si32(accumulate_s2);
517 unsigned int s1 = checksum & 0xffff;
518 unsigned int s2 = (checksum >> 16) & 0xffff;
524 adler32_do16_loop(
buf,
end, &s1, &s2);
534 adler32_do16_loop(
buf,
end, &s1, &s2);
548 return (s2 << 16) | s1;
553 unsigned char *mem = (
unsigned char*)persistent_script->
mem;
554 size_t size = persistent_script->
size;
555 size_t persistent_script_check_block_size = ((
char *)&(persistent_script->
dynamic_members)) - (
char *)persistent_script;
558 if (mem < (
unsigned char*)persistent_script) {
559 checksum =
zend_adler32(checksum, mem, (
unsigned char*)persistent_script - mem);
560 size -= (
unsigned char*)persistent_script - mem;
561 mem += (
unsigned char*)persistent_script - mem;
564 zend_adler32(checksum, mem, persistent_script_check_block_size);
565 mem +=
sizeof(*persistent_script);
566 size -=
sizeof(*persistent_script);
struct _zend_persistent_script zend_persistent_script
struct _zend_early_binding zend_early_binding
count(Countable|array $value, int $mode=COUNT_NORMAL)
memset(ptr, 0, type->size)
zend_ffi_ctype_name_buf buf
unsigned const char * end
struct _zend_class_entry::@126215362204241324314155352336150042254204116267::@166057154351252324007362117353350250255142166322 user
union _zend_class_entry::@126215362204241324314155352336150042254204116267 info
zend_string * lc_parent_name
uint32_t num_early_bindings
zend_early_binding * early_bindings
struct _zend_persistent_script::zend_persistent_script_dynamic_members dynamic_members
zend_error_info ** warnings
zend_long compiler_halt_offset
zend_op_array main_op_array
zend_string * function_name
struct _zend_function::@236135173067030250234125302313220025134003177336 common
ZEND_API ZEND_COLD ZEND_NORETURN void zend_error_noreturn(int type, const char *format,...)
ZEND_API void zend_map_ptr_extend(size_t last)
struct _zend_error_info zend_error_info
ZEND_API ZEND_COLD void zend_class_redeclaration_error(int type, zend_class_entry *old_ce)
void zend_accel_move_user_classes(HashTable *src, uint32_t count, zend_script *script)
void zend_accel_finalize_delayed_early_binding_list(zend_persistent_script *persistent_script)
void zend_accel_free_delayed_early_binding_list(zend_persistent_script *persistent_script)
unsigned int zend_accel_script_checksum(zend_persistent_script *persistent_script)
#define ADLER32_SCALAR_DO16(buf)
void free_persistent_script(zend_persistent_script *persistent_script, int destroy_elements)
unsigned int zend_adler32(unsigned int checksum, unsigned char *buf, uint32_t len)
#define ADLER32_SCALAR_DO1(buf)
zend_persistent_script * create_persistent_script(void)
void(* unique_copy_ctor_func_t)(void *pElement)
zend_op_array * zend_accel_load_script(zend_persistent_script *persistent_script, int from_shared_memory)
void zend_accel_build_delayed_early_binding_list(zend_persistent_script *persistent_script)
void zend_accel_move_user_functions(HashTable *src, uint32_t count, zend_script *script)
int(* id_function_t)(void *, void *)
zend_string_release_ex(func->internal_function.function_name, 0)
ZEND_API zend_string * zend_set_compiled_filename(zend_string *new_compiled_filename)
ZEND_API zend_string * zend_mangle_property_name(const char *src1, size_t src1_length, const char *src2, size_t src2_length, bool internal)
ZEND_API void destroy_op_array(zend_op_array *op_array)
#define ZEND_FUNCTION_DTOR
#define ZEND_USER_FUNCTION
struct _zend_op_array zend_op_array
#define ZEND_ACC_ANON_CLASS
#define RT_CONSTANT(opline, node)
#define ZEND_ACC_HEAP_RT_CACHE
#define ZEND_ACC_EARLY_BINDING
ZEND_API void zend_register_long_constant(const char *name, size_t name_len, zend_long lval, int flags, int module_number)
ZEND_API void(ZEND_FASTCALL *zend_touch_vm_stack_data)(void *vm_stack_data)
union _zend_function zend_function
ZEND_API void ZEND_FASTCALL zend_hash_destroy(HashTable *ht)
ZEND_API void ZEND_FASTCALL zend_hash_del_bucket(HashTable *ht, Bucket *p)
ZEND_API zval *ZEND_FASTCALL zend_hash_find_known_hash(const HashTable *ht, const zend_string *key)
ZEND_API void ZEND_FASTCALL zend_hash_extend(HashTable *ht, uint32_t nSize, bool packed)
#define zend_hash_init(ht, nSize, pHashFunction, pDestructor, persistent)
ZEND_API zend_class_entry * zend_try_early_bind(zend_class_entry *ce, zend_class_entry *parent_ce, zend_string *lcname, zval *delayed_early_binding)
struct _zend_string zend_string
#define ZEND_MAP_PTR_INIT(ptr, val)
#define ZEND_MAP_PTR(ptr)
bool zend_observer_function_declared_observed
bool zend_observer_class_linked_observed
ZEND_API void ZEND_FASTCALL _zend_observer_function_declared_notify(zend_op_array *op_array, zend_string *name)
ZEND_API void ZEND_FASTCALL _zend_observer_class_linked_notify(zend_class_entry *ce, zend_string *name)
struct _zend_script zend_script
#define zend_never_inline
#define EXPECTED(condition)
#define zend_always_inline
#define UNEXPECTED(condition)
struct _zend_class_entry zend_class_entry
struct _zend_array HashTable
void(* dtor_func_t)(zval *pDest)
#define ZSTR_HAS_CE_CACHE(s)
#define ZSTR_SET_CE_CACHE_EX(s, ce, validate)
function(EX_VAR(opline->result.var))
#define ZEND_DECLARE_CLASS_DELAYED