Stub out the “InterpreterData idata” field of every org.mozilla.javascript.InterpretedFunction loaded into your program. This isn’t trivial; I have prior art in https://github.com/szegedi/spring-web-jsflow. Specifically, the ScriptStorage class has two maps, functionsToStubs and stubsToFunctions and a FunctionStubFactory that populates them for every script file loaded into the system. ScriptStorage exposes these to the FlowStateSerializer class (which is the actual class that serializes/deserializes continuations) through its PersistenceSupport interface.
That implementation also calculates cryptographic hashes of functions. Since BPjs' continuations remain within a single Java program execution, that’s not necessary.
Stub out the “InterpreterData idata” field of every org.mozilla.javascript.InterpretedFunction loaded into your program. This isn’t trivial; I have prior art in https://github.com/szegedi/spring-web-jsflow. Specifically, the ScriptStorage class has two maps, functionsToStubs and stubsToFunctions and a FunctionStubFactory that populates them for every script file loaded into the system. ScriptStorage exposes these to the FlowStateSerializer class (which is the actual class that serializes/deserializes continuations) through its PersistenceSupport interface.
That implementation also calculates cryptographic hashes of functions. Since BPjs' continuations remain within a single Java program execution, that’s not necessary.