Lines Matching refs:script
122 ((char*)(ptr) <= (char*)script->size)
124 (((char*)(ptr) >= (char*)script->mem && (char*)(ptr) <= (char*)script->mem + script->size) || \
129 (ptr) = (void*)((char*)(ptr) - (char*)script->mem); \
145 if (EXPECTED(script->corrupted)) { \
149 (ptr) = (void*)((char*)(ptr) - (char*)script->mem); \
156 (ptr) = (void*)zend_file_cache_unserialize_interned((zend_string*)(ptr), !script->corrupted); \
161 if (EXPECTED(!script->corrupted)) { \
177 zend_file_cache_serialize_hash(ht, script, info, buf, zend_file_cache_serialize_attribute); \
186 zend_file_cache_unserialize_hash(ht, script, buf, zend_file_cache_unserialize_attribute, NULL); \
229 zend_persistent_script *script,
234 zend_persistent_script *script,
238 zend_persistent_script *script,
242 zend_persistent_script *script,
304 zend_persistent_script *script, argument
325 func(p, script, info, buf);
339 func(&p->val, script, info, buf);
347 zend_persistent_script *script, argument
355 zend_file_cache_serialize_zval(&((zend_ast_zval*)ast)->val, script, info, buf);
363 zend_file_cache_serialize_ast(tmp, script, info, buf);
373 zend_file_cache_serialize_ast(tmp, script, info, buf);
380 zend_persistent_script *script, argument
397 zend_file_cache_serialize_hash(ht, script, info, buf, zend_file_cache_serialize_zval);
407 zend_file_cache_serialize_ast(GC_AST(ast), script, info, buf);
421 zend_persistent_script *script, argument
437 zend_file_cache_serialize_zval(&attr->args[i].value, script, info, buf);
442 zend_type *type, zend_persistent_script *script, zend_file_cache_metainfo *info, void *buf) argument
452 zend_file_cache_serialize_type(list_type, script, info, buf);
462 zend_persistent_script *script, argument
503 zend_file_cache_serialize_hash(ht, script, info, buf, zend_file_cache_serialize_zval);
514 zend_file_cache_serialize_zval(p, script, info, buf);
601 zend_file_cache_serialize_type(&p->type, script, info, buf);
631 zend_file_cache_serialize_op_array(def, script, info, buf);
648 zend_persistent_script *script, argument
657 zend_file_cache_serialize_op_array(&func->op_array, script, info, buf);
661 zend_persistent_script *script, argument
690 zend_file_cache_serialize_op_array(&hook->op_array, script, info, buf);
694 zend_file_cache_serialize_type(&prop->type, script, info, buf);
700 zend_persistent_script *script, argument
715 zend_file_cache_serialize_zval(&c->value, script, info, buf);
721 zend_file_cache_serialize_type(&c->type, script, info, buf);
727 zend_persistent_script *script, argument
745 …zend_file_cache_serialize_hash(&ce->function_table, script, info, buf, zend_file_cache_serialize_f…
754 zend_file_cache_serialize_zval(p, script, info, buf);
767 zend_file_cache_serialize_zval(p, script, info, buf);
771 …zend_file_cache_serialize_hash(&ce->constants_table, script, info, buf, zend_file_cache_serialize_…
775 …zend_file_cache_serialize_hash(&ce->properties_info, script, info, buf, zend_file_cache_serialize_…
917 zend_persistent_script *script, zend_file_cache_metainfo *info, void *buf) argument
919 if (script->warnings) {
921 SERIALIZE_PTR(script->warnings);
922 warnings = script->warnings;
925 for (uint32_t i = 0; i < script->num_warnings; i++) {
937 zend_persistent_script *script, zend_file_cache_metainfo *info, void *buf) argument
939 if (script->early_bindings) {
940 SERIALIZE_PTR(script->early_bindings);
941 zend_early_binding *early_bindings = script->early_bindings;
943 for (uint32_t i = 0; i < script->num_early_bindings; i++) {
951 static void zend_file_cache_serialize(zend_persistent_script *script, argument
959 info->mem_size = script->size;
961 info->script_offset = (char*)script - (char*)script->mem;
962 info->timestamp = script->timestamp;
964 memcpy(buf, script->mem, script->size);
967 SERIALIZE_STR(new_script->script.filename);
969 …zend_file_cache_serialize_hash(&new_script->script.class_table, script, info, buf, zend_file_cache…
970 …zend_file_cache_serialize_hash(&new_script->script.function_table, script, info, buf, zend_file_ca…
971 zend_file_cache_serialize_op_array(&new_script->script.main_op_array, script, info, buf);
1038 static bool zend_file_cache_script_write(int fd, const zend_persistent_script *script, const zend_f… argument
1041 const ssize_t total_size = (ssize_t)(sizeof(*info) + script->size + info->str_size);
1046 { .iov_base = (void *)buf, .iov_len = script->size },
1073 written = write(fd, buf, script->size);
1074 if (UNEXPECTED(written != script->size)) {
1089 int zend_file_cache_script_store(zend_persistent_script *script, bool in_shm) argument
1103 filename = zend_file_cache_get_bin_file_path(script->script.filename);
1128 mem = emalloc(script->size + 64);
1131 mem = buf = emalloc(script->size);
1138 script->corrupted = true; /* used to check if script restored to SHM or process memory */
1140 zend_file_cache_serialize(script, &info, buf);
1142 script->corrupted = false;
1153 __msan_unpoison(buf, script->size);
1156 info.checksum = zend_adler32(ADLER32_INIT, buf, script->size);
1159 if (!zend_file_cache_script_write(fd, script, &info, buf, s)) {
1181 zend_persistent_script *script, argument
1206 func(p, script, buf);
1218 func(&p->val, script, buf);
1226 zend_persistent_script *script, argument
1232 zend_file_cache_unserialize_zval(&((zend_ast_zval*)ast)->val, script, buf);
1238 zend_file_cache_unserialize_ast(list->child[i], script, buf);
1246 zend_file_cache_unserialize_ast(ast->child[i], script, buf);
1253 zend_persistent_script *script, argument
1271 script, buf, zend_file_cache_unserialize_zval, ZVAL_PTR_DTOR);
1277 zend_file_cache_unserialize_ast(Z_ASTVAL_P(zv), script, buf);
1290 static void zend_file_cache_unserialize_attribute(zval *zv, zend_persistent_script *script, void *b… argument
1303 zend_file_cache_unserialize_zval(&attr->args[i].value, script, buf);
1308 zend_type *type, zend_class_entry *scope, zend_persistent_script *script, void *buf) argument
1317 zend_file_cache_unserialize_type(list_type, scope, script, buf);
1323 if (!script->corrupted) {
1332 zend_persistent_script *script, argument
1335 if (!script->corrupted) {
1336 if (op_array != &script->script.main_op_array) {
1383 script, buf, zend_file_cache_unserialize_zval, ZVAL_PTR_DTOR);
1393 zend_file_cache_unserialize_zval(p, script, buf);
1474 …lize_type(&p->type, (op_array->fn_flags & ZEND_ACC_CLOSURE) ? NULL : op_array->scope, script, buf);
1497 zend_file_cache_unserialize_op_array(op_array->dynamic_func_defs[i], script, buf);
1513 zend_persistent_script *script, argument
1520 zend_file_cache_unserialize_op_array(&func->op_array, script, buf);
1524 zend_persistent_script *script, argument
1547 zend_file_cache_unserialize_op_array(&prop->hooks[i]->op_array, script, buf);
1551 zend_file_cache_unserialize_type(&prop->type, prop->ce, script, buf);
1557 zend_persistent_script *script, argument
1570 zend_file_cache_unserialize_zval(&c->value, script, buf);
1576 zend_file_cache_unserialize_type(&c->type, c->ce, script, buf);
1582 zend_persistent_script *script, argument
1592 if (!script->corrupted) {
1606 script, buf, zend_file_cache_unserialize_func, ZEND_FUNCTION_DTOR);
1614 zend_file_cache_unserialize_zval(p, script, buf);
1624 zend_file_cache_unserialize_zval(p, script, buf);
1629 script, buf, zend_file_cache_unserialize_class_constant, NULL);
1634 script, buf, zend_file_cache_unserialize_prop_info, NULL);
1748 if (!(script->corrupted)) {
1772 static void zend_file_cache_unserialize_warnings(zend_persistent_script *script, void *buf) argument
1774 if (script->warnings) {
1775 UNSERIALIZE_PTR(script->warnings);
1776 for (uint32_t i = 0; i < script->num_warnings; i++) {
1777 UNSERIALIZE_PTR(script->warnings[i]);
1778 UNSERIALIZE_STR(script->warnings[i]->filename);
1779 UNSERIALIZE_STR(script->warnings[i]->message);
1784 static void zend_file_cache_unserialize_early_bindings(zend_persistent_script *script, void *buf) argument
1786 if (script->early_bindings) {
1787 UNSERIALIZE_PTR(script->early_bindings);
1788 for (uint32_t i = 0; i < script->num_early_bindings; i++) {
1789 UNSERIALIZE_STR(script->early_bindings[i].lcname);
1790 UNSERIALIZE_STR(script->early_bindings[i].rtd_key);
1791 UNSERIALIZE_STR(script->early_bindings[i].lc_parent_name);
1796 static void zend_file_cache_unserialize(zend_persistent_script *script, argument
1799 script->mem = buf;
1801 UNSERIALIZE_STR(script->script.filename);
1803 zend_file_cache_unserialize_hash(&script->script.class_table,
1804 script, buf, zend_file_cache_unserialize_class, ZEND_CLASS_DTOR);
1805 zend_file_cache_unserialize_hash(&script->script.function_table,
1806 script, buf, zend_file_cache_unserialize_func, ZEND_FUNCTION_DTOR);
1807 zend_file_cache_unserialize_op_array(&script->script.main_op_array, script, buf);
1808 zend_file_cache_unserialize_warnings(script, buf);
1809 zend_file_cache_unserialize_early_bindings(script, buf);
1817 zend_persistent_script *script; local
1927 script = (zend_persistent_script *)bucket->data;
1928 if (!script->corrupted) {
1932 return script;
1960 script = (zend_persistent_script*)((char*)buf + info.script_offset);
1961 script->corrupted = !cache_it; /* used to check if script restored to SHM or process memory */
1965 zend_file_cache_unserialize(script, buf);
1980 script->corrupted = false;
1984 script->dynamic_members.last_used = ZCG(request_time);
1986 zend_accel_hash_update(&ZCSG(hash), script->script.filename, 0, script);
1989 …r(ACCEL_LOG_INFO, "File cached script loaded into memory '%s'", ZSTR_VAL(script->script.filename));
1995 return script;