Message10050

Author zyasoft
Recipients fmartins, zyasoft
Date 2015-05-11.22:36:33
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1431383793.96.0.208015155418.issue2354@psf.upfronthosting.co.za>
In-reply-to
Content
Throwing an exception is certainly easiest... but I will attempt to sketch out a solution.

Java bytecode cannot be accessed once loaded, and preemptively storing bytecode just-in-case is too much overhead for functionality that is rarely used. Assuming the source jar (or class file) is still available, we could use the inspect module to find the $py.class file. Then we could find the specific code object in the PyFunctionTable by introspecting for the index. Then we could ASM to write out the specific code object. Note that reloading a single code object via a ClassLoader will be quite inefficient, which is a big reason we have the PyFunctionTable approach today.

We probably don't want to do this solution.

Python bytecode is a long term scenario for Jython for code objects that are not hot. Such code objects can be readily dumped and loaded, and there's currently support in marshal for loading them to support pycimport. One we fully implement Python bytecode for this, we will have Python bytecode for every object, and only for hot code we will have - in addition - equivalent, but optimized Java bytecode. But this is not hapenning any time soon.

So throwing an exception is the correct solution for now.
History
Date User Action Args
2015-05-11 22:36:33zyasoftsetmessageid: <1431383793.96.0.208015155418.issue2354@psf.upfronthosting.co.za>
2015-05-11 22:36:33zyasoftsetrecipients: + zyasoft, fmartins
2015-05-11 22:36:33zyasoftlinkissue2354 messages
2015-05-11 22:36:33zyasoftcreate