I changed the JS engine to initialize the FPU to sane numeric modes once for the first thread that runs JS. That was wrong: if an OS is insane, it'll reset the FPU modes for other threads, so JS must re-reset them on every new-thread (if it can hook into new-thread). For a long time, JS has redundantly initialized the FPU on every JS_NewContext, which is at least 1:1 with thread, and N:1 for big N in Mozilla-the-browser (each window in the DOM/UI/Layout thread has its own cx). See bug 39237, which tried to morph into this bug, but should not (once we fix this bug, 39237 will still be a valid, Futured bug about keyboard event probs). Mike Kaply of IBM found strange similar problems on OS2. I'm going to restore the old JS FPU initialization timing. /be
We are able to work around this by putting the _control87 call directly before the call to JS_DefineConstDoubles. Rather than backing all the changes out, it might be easier to either make this a configure option like "broken floating point" or just put it in an XP_OS2.
Mike, anyone: please test this patch and give me an r= if it's good. Thanks, /be
We did some research and found that we don't need special _control87 flags for OS/2. We can take the M_IX86 path and have no OS/2 specific code here.
Based on just eyeballing the code, r=mkaply I have it building but I won't know for some time whether it is OK. If possible though, I would like it checked in anyway to get a nightly build tonight. Thanks for the help on this.
Thanks, it's in (sorry to nitpick your patch, but it has CRLF rather than LF as line terminator, and at least one four-space initial indentation was expanded wrongly to a hard tab; hey, I've attached CRLF-terminated patches myself, but they don't work for Unix users, whereas LF-termination works all around, IIRC). Thanks again, let me know if it doesn't work for OS2. /be /be
I just found out that GNU C does not define _M_IX86 Our other main OS/2 contributor would prefer an explicit mention of XP_OS2 on this line, so how about: #if !defined __MWERKS__ && defined (XP_PC) && (defined (_M_IX86) || defined(XP_OS2))