Lines Matching refs:script
121 ((char*)(ptr) <= (char*)script->size)
123 (((char*)(ptr) >= (char*)script->mem && (char*)(ptr) <= (char*)script->mem + script->size) || \
128 (ptr) = (void*)((char*)(ptr) - (char*)script->mem); \
144 if (EXPECTED(script->corrupted)) { \
148 (ptr) = (void*)((char*)(ptr) - (char*)script->mem); \
155 (ptr) = (void*)zend_file_cache_unserialize_interned((zend_string*)(ptr), !script->corrupted); \
160 if (EXPECTED(!script->corrupted)) { \
176 zend_file_cache_serialize_hash(ht, script, info, buf, zend_file_cache_serialize_attribute); \
185 zend_file_cache_unserialize_hash(ht, script, buf, zend_file_cache_unserialize_attribute, NULL); \
226 zend_persistent_script *script,
231 zend_persistent_script *script,
235 zend_persistent_script *script,
239 zend_persistent_script *script,
301 zend_persistent_script *script, argument
322 func(p, script, info, buf);
336 func(&p->val, script, info, buf);
344 zend_persistent_script *script, argument
352 zend_file_cache_serialize_zval(&((zend_ast_zval*)ast)->val, script, info, buf);
360 zend_file_cache_serialize_ast(tmp, script, info, buf);
370 zend_file_cache_serialize_ast(tmp, script, info, buf);
377 zend_persistent_script *script, argument
394 zend_file_cache_serialize_hash(ht, script, info, buf, zend_file_cache_serialize_zval);
404 zend_file_cache_serialize_ast(GC_AST(ast), script, info, buf);
418 zend_persistent_script *script, argument
434 zend_file_cache_serialize_zval(&attr->args[i].value, script, info, buf);
439 zend_type *type, zend_persistent_script *script, zend_file_cache_metainfo *info, void *buf) argument
449 zend_file_cache_serialize_type(list_type, script, info, buf);
459 zend_persistent_script *script, argument
499 zend_file_cache_serialize_hash(ht, script, info, buf, zend_file_cache_serialize_zval);
510 zend_file_cache_serialize_zval(p, script, info, buf);
596 zend_file_cache_serialize_type(&p->type, script, info, buf);
626 zend_file_cache_serialize_op_array(def, script, info, buf);
642 zend_persistent_script *script, argument
651 zend_file_cache_serialize_op_array(&func->op_array, script, info, buf);
655 zend_persistent_script *script, argument
674 zend_file_cache_serialize_type(&prop->type, script, info, buf);
680 zend_persistent_script *script, argument
695 zend_file_cache_serialize_zval(&c->value, script, info, buf);
701 zend_file_cache_serialize_type(&c->type, script, info, buf);
707 zend_persistent_script *script, argument
725 …zend_file_cache_serialize_hash(&ce->function_table, script, info, buf, zend_file_cache_serialize_f…
734 zend_file_cache_serialize_zval(p, script, info, buf);
747 zend_file_cache_serialize_zval(p, script, info, buf);
751 …zend_file_cache_serialize_hash(&ce->constants_table, script, info, buf, zend_file_cache_serialize_…
755 …zend_file_cache_serialize_hash(&ce->properties_info, script, info, buf, zend_file_cache_serialize_…
892 zend_persistent_script *script, zend_file_cache_metainfo *info, void *buf) argument
894 if (script->warnings) {
896 SERIALIZE_PTR(script->warnings);
897 warnings = script->warnings;
900 for (uint32_t i = 0; i < script->num_warnings; i++) {
912 zend_persistent_script *script, zend_file_cache_metainfo *info, void *buf) argument
914 if (script->early_bindings) {
915 SERIALIZE_PTR(script->early_bindings);
916 zend_early_binding *early_bindings = script->early_bindings;
918 for (uint32_t i = 0; i < script->num_early_bindings; i++) {
926 static void zend_file_cache_serialize(zend_persistent_script *script, argument
934 info->mem_size = script->size;
936 info->script_offset = (char*)script - (char*)script->mem;
937 info->timestamp = script->timestamp;
939 memcpy(buf, script->mem, script->size);
942 SERIALIZE_STR(new_script->script.filename);
944 …zend_file_cache_serialize_hash(&new_script->script.class_table, script, info, buf, zend_file_cache…
945 …zend_file_cache_serialize_hash(&new_script->script.function_table, script, info, buf, zend_file_ca…
946 zend_file_cache_serialize_op_array(&new_script->script.main_op_array, script, info, buf);
1013 static bool zend_file_cache_script_write(int fd, const zend_persistent_script *script, const zend_f… argument
1016 const ssize_t total_size = (ssize_t)(sizeof(*info) + script->size + info->str_size);
1021 { .iov_base = (void *)buf, .iov_len = script->size },
1048 written = write(fd, buf, script->size);
1049 if (UNEXPECTED(written != script->size)) {
1064 int zend_file_cache_script_store(zend_persistent_script *script, bool in_shm) argument
1078 filename = zend_file_cache_get_bin_file_path(script->script.filename);
1103 mem = emalloc(script->size + 64);
1106 mem = buf = emalloc(script->size);
1113 script->corrupted = true; /* used to check if script restored to SHM or process memory */
1115 zend_file_cache_serialize(script, &info, buf);
1117 script->corrupted = false;
1128 __msan_unpoison(buf, script->size);
1131 info.checksum = zend_adler32(ADLER32_INIT, buf, script->size);
1134 if (!zend_file_cache_script_write(fd, script, &info, buf, s)) {
1156 zend_persistent_script *script, argument
1181 func(p, script, buf);
1193 func(&p->val, script, buf);
1201 zend_persistent_script *script, argument
1207 zend_file_cache_unserialize_zval(&((zend_ast_zval*)ast)->val, script, buf);
1213 zend_file_cache_unserialize_ast(list->child[i], script, buf);
1221 zend_file_cache_unserialize_ast(ast->child[i], script, buf);
1228 zend_persistent_script *script, argument
1246 script, buf, zend_file_cache_unserialize_zval, ZVAL_PTR_DTOR);
1252 zend_file_cache_unserialize_ast(Z_ASTVAL_P(zv), script, buf);
1265 static void zend_file_cache_unserialize_attribute(zval *zv, zend_persistent_script *script, void *b… argument
1278 zend_file_cache_unserialize_zval(&attr->args[i].value, script, buf);
1283 zend_type *type, zend_class_entry *scope, zend_persistent_script *script, void *buf) argument
1292 zend_file_cache_unserialize_type(list_type, scope, script, buf);
1298 if (!script->corrupted) {
1307 zend_persistent_script *script, argument
1310 if (!script->corrupted) {
1311 if (op_array != &script->script.main_op_array) {
1357 script, buf, zend_file_cache_unserialize_zval, ZVAL_PTR_DTOR);
1367 zend_file_cache_unserialize_zval(p, script, buf);
1447 …lize_type(&p->type, (op_array->fn_flags & ZEND_ACC_CLOSURE) ? NULL : op_array->scope, script, buf);
1470 zend_file_cache_unserialize_op_array(op_array->dynamic_func_defs[i], script, buf);
1485 zend_persistent_script *script, argument
1492 zend_file_cache_unserialize_op_array(&func->op_array, script, buf);
1496 zend_persistent_script *script, argument
1513 zend_file_cache_unserialize_type(&prop->type, prop->ce, script, buf);
1519 zend_persistent_script *script, argument
1532 zend_file_cache_unserialize_zval(&c->value, script, buf);
1538 zend_file_cache_unserialize_type(&c->type, c->ce, script, buf);
1544 zend_persistent_script *script, argument
1554 if (!script->corrupted) {
1568 script, buf, zend_file_cache_unserialize_func, ZEND_FUNCTION_DTOR);
1576 zend_file_cache_unserialize_zval(p, script, buf);
1586 zend_file_cache_unserialize_zval(p, script, buf);
1591 script, buf, zend_file_cache_unserialize_class_constant, NULL);
1596 script, buf, zend_file_cache_unserialize_prop_info, NULL);
1710 if (!(script->corrupted)) {
1729 static void zend_file_cache_unserialize_warnings(zend_persistent_script *script, void *buf) argument
1731 if (script->warnings) {
1732 UNSERIALIZE_PTR(script->warnings);
1733 for (uint32_t i = 0; i < script->num_warnings; i++) {
1734 UNSERIALIZE_PTR(script->warnings[i]);
1735 UNSERIALIZE_STR(script->warnings[i]->filename);
1736 UNSERIALIZE_STR(script->warnings[i]->message);
1741 static void zend_file_cache_unserialize_early_bindings(zend_persistent_script *script, void *buf) argument
1743 if (script->early_bindings) {
1744 UNSERIALIZE_PTR(script->early_bindings);
1745 for (uint32_t i = 0; i < script->num_early_bindings; i++) {
1746 UNSERIALIZE_STR(script->early_bindings[i].lcname);
1747 UNSERIALIZE_STR(script->early_bindings[i].rtd_key);
1748 UNSERIALIZE_STR(script->early_bindings[i].lc_parent_name);
1753 static void zend_file_cache_unserialize(zend_persistent_script *script, argument
1756 script->mem = buf;
1758 UNSERIALIZE_STR(script->script.filename);
1760 zend_file_cache_unserialize_hash(&script->script.class_table,
1761 script, buf, zend_file_cache_unserialize_class, ZEND_CLASS_DTOR);
1762 zend_file_cache_unserialize_hash(&script->script.function_table,
1763 script, buf, zend_file_cache_unserialize_func, ZEND_FUNCTION_DTOR);
1764 zend_file_cache_unserialize_op_array(&script->script.main_op_array, script, buf);
1765 zend_file_cache_unserialize_warnings(script, buf);
1766 zend_file_cache_unserialize_early_bindings(script, buf);
1774 zend_persistent_script *script; local
1884 script = (zend_persistent_script *)bucket->data;
1885 if (!script->corrupted) {
1889 return script;
1917 script = (zend_persistent_script*)((char*)buf + info.script_offset);
1918 script->corrupted = !cache_it; /* used to check if script restored to SHM or process memory */
1922 zend_file_cache_unserialize(script, buf);
1937 script->corrupted = false;
1941 script->dynamic_members.last_used = ZCG(request_time);
1943 zend_accel_hash_update(&ZCSG(hash), script->script.filename, 0, script);
1946 …r(ACCEL_LOG_INFO, "File cached script loaded into memory '%s'", ZSTR_VAL(script->script.filename));
1952 return script;