--- parser3/src/include/pa_request.h 2026/09/30 17:42:38 1.280 +++ parser3/src/include/pa_request.h 2026/10/10 02:01:15 1.283 @@ -8,7 +8,7 @@ #ifndef PA_REQUEST_H #define PA_REQUEST_H -#define IDENT_PA_REQUEST_H "$Id: pa_request.h,v 1.280 2026/09/30 17:42:38 moko Exp $" +#define IDENT_PA_REQUEST_H "$Id: pa_request.h,v 1.283 2026/10/10 02:01:15 moko Exp $" #include "pa_pool.h" #include "pa_hash.h" @@ -54,6 +54,8 @@ extern int pa_execute_recursion_limit; extern int pa_httpd_timeout; extern size_t pa_file_size_limit; +class Code_cache; + /// Main workhorse. class Request: public PA_Object { friend class Temp_lang; @@ -64,6 +66,7 @@ class Request: public PA_Object { friend class Request_context_saver; friend class Exception_trace; friend class VException; + friend class Code_cache_manager; public: class Trace { @@ -211,7 +214,7 @@ public: core request processing BEWARE: may throw exception to you: catch it! */ - void core(const char* config_filespec, bool header_only, const String& amain_method_name = main_method_name, const String* amain_class_name = NULL); + void core(const char* config_filespec, const String& amain_method_name = main_method_name, const String* amain_class_name = NULL); /// executes ops void execute(ArrayOperation& ops); // execute.C @@ -267,8 +270,8 @@ public: /// for @USE only, calls ^use (which may be user-defined) void use_file(const String& file_name, const String* use_filespec, Operation::Origin origin); - /// compiles a @a source buffer - void use_buf(VStateless_class& aclass, const char* source, const String* main_alias, uint file_no, int line_no_offset=0); + /// compiles a @a source buffer, recording it into @a code if given, or replays the cached @a code + void use_buf(VStateless_class& aclass, const char* source, const String* main_alias, uint file_no, int line_no_offset=0, Code_cache* code=0); /// processes any code-junction there may be inside of @a value Value& process_getter(Junction& junction); // execute.C @@ -305,7 +308,7 @@ public: /// '/'-normalized disk path of a file name; a uri of another scheme is returned as is if allowed, otherwise throws const String& full_disk_path(const String& relative_name, uint allowed=0); - /// '/'-normalized full_disk_path of a real file on disk, which does not throw: 0 for a uri or a remote or invalid file:// one + /// '/'-normalized full_disk_path of a real file on disk, which does not throw: 0 for a uri or a remote, invalid or tainted file:// one const String* real_disk_path(const String& name); /// returns the mime type of 'user_file_name' @@ -399,7 +402,7 @@ private: private: // compile.C - ArrayClass& compile(VStateless_class* aclass, const char* source, const String* main_alias, uint file_no, int line_no_offset); + ArrayClass& compile(VStateless_class* aclass, const char* source, const String* main_alias, uint file_no, int line_no_offset, Code_cache* code); private: // execute.C