Closed Bug 785755 Opened 10 years ago Closed 10 years ago

IonMonkey: Multiple Emscripten-compiled projects regressed by bug 774253


(Core :: JavaScript Engine, defect)

Not set





(Reporter: bugs, Assigned: bhackett1024)


(Depends on 1 open bug, Blocks 1 open bug, )



(1 file)

Chrome does stutter quite a bit, it must be noted, which offers a bit worse a gameplay experience.

Load the URL.  Wait for the initial data fetch, then click on the first game button.
Once the game starts, observe the fps in the upper right corner.

Well, actually, in the case of IonMonkey you don't need to pay too much attention to the FPS since the game is essentially non-functional.

Game is a cross-compile using emscripten.
I see this too (32-bit linux). 1fps in latest ionmonkey nightly, 15fps in regular nightly.
OS: Linux → All
Hardware: x86_64 → All
Blocks: gecko-games
Assignee: general → jdemooij
Depends on: 785974
Depends on: 785986
The main problem is that we are JM-compiling the same script lots of times, filed bug 785986 to avoid this.

There are also many JM stub calls for "x >>> 0" when the result does not fit in an int32. Ion currently takes a bailout but should just handle this inline without any stub calls (bug 785974 and bug 750947).
I bisected this. It regressed due to bug 774253, specifically

changeset:   104950:01854460aa68
user:        Brian Hackett <>
date:        Sat Aug 25 06:29:43 2012 -0600
summary:     Tweak condition for triggering Ion compilation from JM, bug 774253. r=dvander

That changeset also regressed two other Emscripten-compiled projects, OpenTTD ( , stalls before getting to load screen, was about to file a bug) and BananaBread (bug 786026, which I will now dupe on this one).
Blocks: 774253
Further testing shows that another compiled project, Me & My Shadow ( , stalls during LZMA decompression in worker) was also regressed by that changeset.
Summary: IonMonkey runs emscripten compiled game at 1-2fps (FF nightly: 35-55 fps, chromium stable: 60-80fps) → IonMonkey: Multiple Emscripten-compiled projects regressed by bug 774253
Attached patch bandaidSplinter Review
The real fix for this is bug 785986, but in the meantime this patch avoids repeatedly recompiling / discarding code for the same script in JM by not inserting Ion compilation checks if the script has already been compiled for Ion, as will happen if script->ion->bailoutExpected().
Assignee: jdemooij → bhackett1024
Attachment #655830 - Flags: review?(dvander)
Attachment #655830 - Flags: review?(dvander) → review+
I haven't checked this against any of the Emscripten projects, but in the shell this fixes pdf.js in the octane benchmark which was suffering from the same problem Jan identified in comment 2.  So I assume this is the same issue, but let me know if performance is still broken anywhere.
I built with the patch, and checked all the emscripten projects. Everything looks great!
Closed: 10 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.