From: Arno P. <ar...@pu...> - 2012-10-15 15:33:49
|
On 10/15/12 7:28 AM, JR Schmidt wrote: > It appears that object serialization relies on a few redlist-ed > "objectaccessor" classes within Harmony. Removing those from the > redlist and recompiling generates some linker errors since > (unsurprisingly) these low level classes rely on some native code. I am > curious: If I grab the corresponding native code from Harmony and link > this in, is this likely to work? Or is all the internal class data > stored in a completely different format? No, it won't work. XMLVM implements JNI differently so you will have to adapt the native implementations from Harmony. The reason we don't implement JNI is because XMLVM operates under a closed world assumption (i.e., all classes that belong to an application are known at compile time) that allows for better optimizations compared to the JNI API. After you remove classes from the red list, you should run "ant gen-c-native-skeletons". This will generate stubs for native methods in src/xmlvm2c/lib/native that you can implement. > Alternatively, is there ANY > reflection support implemented in XMLVM? We do support reflection, but that won't help you to access the native layer. > Any thought on getting serialization working via a straightforward fix, > or should I just "manually" serialize objects into a bytestream? Well, ideally you port over Harmony's native implementation to XMLVM. This is a clean solution that would also benefit other XMLVMers. Arno |