1616namespace V8 ;
1717
1818
19+ use V8 \ScriptCompiler \CachedData ;
1920use V8 \ScriptCompiler \Source ;
2021
2122
@@ -64,13 +65,8 @@ public static function getCachedDataVersionTag(): float
6465 * Cached data as part of the source object can be optionally produced to be
6566 * consumed later to speed up compilation of identical source scripts.
6667 *
67- * Note that when producing cached data, the source must point to NULL for
68- * cached data. When consuming cached data, the cached data must have been
69- * produced by the same version of V8.
70- *
71- * \param source Script source code.
72- * \return Compiled script object (context independent; for running it must be
73- * bound to a context).
68+ * Note that when producing cached data, the source must have no cached data set.
69+ * When consuming cached data, the cached data must have been produced by the same version of V8.
7470 *
7571 * @param Context $context
7672 * @param Source $source
@@ -85,14 +81,6 @@ public static function compileUnboundScript(Context $context, Source $source, in
8581 /**
8682 * Compiles the specified script (bound to current context).
8783 *
88- * \param source Script source code.
89- * \param pre_data Pre-parsing data, as obtained by ScriptData::PreCompile()
90- * using pre_data speeds compilation if it's done multiple times.
91- * Owned by caller, no references are kept when this function returns.
92- * \return Compiled script object, bound to the context that was active
93- * when this function was called. When run it will always use this
94- * context.
95- *
9684 * @param Context $context
9785 * @param Source $source
9886 * @param int $options
@@ -110,8 +98,7 @@ public static function compile(Context $context, Source $source, int $options =
11098 * return function(args) { ... }
11199 * }
112100 *
113- * It is possible to specify multiple context extensions (obj in the above
114- * example).
101+ * It is possible to specify multiple context extensions (obj in the above example).
115102 *
116103 * @param Context $context
117104 * @param Source $source
@@ -123,4 +110,16 @@ public static function compile(Context $context, Source $source, int $options =
123110 public static function compileFunctionInContext (Context $ context , Source $ source , array $ arguments = [], array $ context_extensions = []): FunctionObject
124111 {
125112 }
113+
114+ /**
115+ * Creates and returns code cache for the specified unbound_script.
116+ *
117+ * @param UnboundScript $unbound_script
118+ * @param StringValue $source_string
119+ *
120+ * @return CachedData
121+ */
122+ public static function createCodeCache (UnboundScript $ unbound_script , StringValue $ source_string ): CachedData
123+ {
124+ }
126125}
0 commit comments