> > Though... IIRC the Newton ROM presented some API in C++ (or ObjC?) based > on the calling convention of some obscure obsolete compiler... so creating > code to the same ABI might be, um, "tricky"...?
> Yes, it is tricky. I need interfaces between the Just In TIme compiler and > the native code. Those interfaces convert from register notation into a > correctly formed C+ call, also taking care of the return value. But all > that has been working for a year now. > > The major issue is the extensive use of the MMU by Newton OS: a memory > access fault can happen at any time. The JIT takes care of that very well, > but native code would need to call the JIT, causing a recursion in the JIT > system. OK - that sounds even more complicated than I'd imagined though; I was just envisaging something analogous to what the Haiku folk seem to have (at least, as it seems to me) where they build with one ABI that matches the C++ compiler that BeOS used, so that older code and existing BeOS binaries will run, but they have an alternate ABI based on more recent C++ compilers that presents "the same" API in a more "modern" way... and some sort of wrapper to map the ABI's so that old code can run wrapped up on the new hosts, or something... > But then I found this neat thing call "fibers". A fiber is a thread > without the ability to run at the same time as another thread (Since > NewtonOS was never meant to run on multiple cores, it has very limited > thread protection). Or, looking at it from the other side, the ability to > have two or more stacks and environments inside a single "C" program. > > The solution now is using a fiber when changing into native code. If a > memory violation happens, we simply jump back to the original fiber, > handle the exception, and jump back to the native fiber. To the JIT, the > whole procedure appears just like two instructions, not knowing anything > about all the native stuff going on in the other fiber. > > Is it easy to tell by the long EMails today, that I try to avoid work? Must be time for another coffee I think... SELEX Galileo Ltd Registered Office: Sigma House, Christopher Martin Road, Basildon, Essex SS14 3EL A company registered in England & Wales. Company no. 02426132 ******************************************************************** This email and any attachments are confidential to the intended recipient and may also be privileged. If you are not the intended recipient please delete it from your system and notify the sender. You should not copy it or use it for any purpose nor disclose or distribute its contents to any other person. ******************************************************************** _______________________________________________ fltk mailing list [email protected] http://lists.easysw.com/mailman/listinfo/fltk

