From: Shai <sha...@ya...> - 2011-09-20 06:19:26
|
Hi, I'm running into quite a few issues in the generated code from XML VM. Our existing code base is huge and doesn't depend on Android/iPhone API's, we use native methods where appropriate but most of the work is in Java. For hello world apps things are starting to work as expected but I'm running into some hard difficulties when implementing elaborate functionality. The biggest problem I'm facing right now is a bad pointer in this code: { XMLVM_MEMCPY(curThread_w23657aaac46b1c17->fields.java_lang_Thread.xmlvmExceptionEnv_, local_env_w23657aaac46b1c17, sizeof(XMLVM_JMP_BUF)); goto label5; }; The stack does include java_lang_Thread so curThread should be fine: #5 0x000bb420 in java_lang_Thread_run0___long #6 0x008e43e8 in threadRunner () #7 0x0090b3b0 in GC_inner_start_routine () #8 0x00907ee4 in GC_call_with_stack_base () #9 0x0090af87 in GC_start_routine () #10 0x92a50ed9 in _pthread_start () #11 0x92a546de in thread_start () The debugger is claiming that curThread is 0x1. I would investigate this but I'm not sure where to start, I enabled null pointer exception checks but that didn't help. I couldn't find the code to enable array boundary checks, some of our code really needs that since race conditions could trigger a failure and constantly synchronizing is impractical for our code which is very performance sensitive. BTW Shouldn't such checks be on by default? I understand the cost but since quite allot of third party code expects this to work for Java... Another issue I'm facing is when I select the IDE option to modernize the project to LLVM things stop working. I'm guessing its related to endianess of math functions? Moving to LLVM would be huge both because of the performance boost on ARM and because of the MUCH shorter compile time. I also tried to get java.util.Calendar working without much luck, it has too many red dependencies in IBM specific system functions to get working. I don't need the entire API and can easily implement it natively however I was wondering, can I replace a "System" class with my own? E.g. can I just write a java.util.Calendar/GregorianCalendar class and have it take precedence over the classes that are generated from the Harmony bytecode? I'm guessing that I can obviously just change the redclass list to remove Calendar entirely and just build a class of my own but I'd rather not change XMLVM since I only need a subset of calendar and probably won't be able to reimplement calendar in a generic enough way for everyone's needs. Thanks. |