The Source for Java Technology Collaboration


Windows CE implementation issues

Structured exceptions and static code cache

To implement trap-based features such as null-pointer and gc-checks, our Unix ports rely on the dreaded SEGV signal. While desktop versions of Windows support signals, WinCE? does not. Instead, it uses its own exception handling mechanism called "structured exceptions". One limitation of the WinCE? implementation of structured exceptions is that functions throwing exceptions must be registered. The compiler and assembler do this automatically for normal code, and the linker builds a nice sorted table for runtime use. Unfortunately there is no way to extend this function table for dynamically-generated (JIT) code. So we are forced to implement an ugly hack.

The ugly hack involves sandwiching our code cache in between a function prologue and epilogue, making it look like it is a part of a very big function. The function prologue is CVMJITgoNative, and the epilogue is CVMJITexitNative, so you can think of CVMJITgoNative and the code cache as one big self-modifying function.

The end result is that the code cache has a fixed size, no matter what size is requested. One possible way to support different code cache sizes would be to create at build time multiple DLLs, each containing a static code cache of a different size. At runtime we could load the DLL that most closely matches the desired size.

Virtual Memory limitations

WinCE? uses virtual memory in strange and unusual ways. When a DLL is loaded by one process, the virtual address range used by the DLL cannot be used by any other process. While this makes it easy for other processes to share the DLL, it also means that the virtual address range of DLLs is effectively global and shared. So if you subtract all of the standard DLLs that are automatically loaded by the system, a process is not left with much memory for its own DLLs. Later versions of WinCE? have been rumored to address this DLL issue in some way.

Networking issues

Pocket PC 2002 does not implement MSG_PEEK on sockets. Other versions of WinCE? probably share this limitation.

I/O issues

WinCE? does not have pipes or stdio.

Process issues

Because of the I/O issues, WinCE? cannot support the java.lang.Process APIs.

-- Main.prasadsanagavarapu - 12 Nov 2006

Topic PhoneMEAdvancedCVMWinCE . { Edit | Ref-By | Printable | Diffs r1 | More }
 XML java.net RSS

Revision r1 - 15 Apr 2005 - 22:26:49 - Main.prasadsanagavarapu
Parents: WebHome > PhoneMEAdvanced