src/jdk/nashorn/internal/runtime/ScriptFunctionData.java

Print this page

        

@@ -27,22 +27,22 @@
 
 import static jdk.nashorn.internal.lookup.Lookup.MH;
 import static jdk.nashorn.internal.runtime.ECMAErrors.typeError;
 import static jdk.nashorn.internal.runtime.ScriptRuntime.UNDEFINED;
 
+import java.io.Serializable;
 import java.lang.invoke.MethodHandle;
 import java.lang.invoke.MethodHandles;
 import java.lang.invoke.MethodType;
-import jdk.nashorn.internal.objects.Global;
 import jdk.nashorn.internal.runtime.linker.JavaAdapterFactory;
 
 /**
  * A container for data needed to instantiate a specific {@link ScriptFunction} at runtime.
  * Instances of this class are created during codegen and stored in script classes'
  * constants array to reduce function instantiation overhead during runtime.
  */
-public abstract class ScriptFunctionData {
+public abstract class ScriptFunctionData implements Serializable {
 
     /** Name of the function or "" for anonynous functions */
     protected final String name;
 
     /** All versions of this function that have been generated to code */

@@ -72,10 +72,12 @@
     /** Flag for built-in constructors */
     public static final int IS_BUILTIN_CONSTRUCTOR = IS_BUILTIN | IS_CONSTRUCTOR;
     /** Flag for strict constructors */
     public static final int IS_STRICT_CONSTRUCTOR = IS_STRICT | IS_CONSTRUCTOR;
 
+    private static final long serialVersionUID = 4252901245508769114L;
+
     /**
      * Constructor
      *
      * @param name          script function name
      * @param arity         arity