Javascript:SpiderMonkey:OdinMonkey

From MozillaWiki
Revision as of 22:44, 23 January 2013 by Lw (talk | contribs) (Created page with "== Goal == Provide an optimized implementation of the (co-evolvoing) [https://github.com/dherman/asm.js/blob/master/tex/def.pdf asm.js spec] which performs within 2x of of nativ...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Goal

Provide an optimized implementation of the (co-evolvoing) asm.js spec which performs within 2x of of native optimized (-O2) code.

Status

The project is currently in a research phase with the major evaluation criteria being to get a large-scale Emscripten app (such as BananaBread or sqlite running and showing the target performance. At this point, we can make the informed decision to transition to an engineering project.

The code is currently available as a patch queue based on mozilla inbound. Unit tests (which can serve as example code) are in js/src/jit-tests/tests/asm.js/.

The entire asm.js language has been implemented with the exception of DataView. Most of the (smaller) Emscripten benchmarks are running and coming in under 2x.

Milestones

  1. Experimental evaluation (large Emscripten apps)
    • Bug fixing, Emscripten work
  2. Safe, works on all tier-1 platforms
    • Major tasks
      • x64 (Windows)
      • x86 (Windows, Unix)
      • ARM
      • Signal handler support
        • DataView: avoid masking loads/stores
        • Stack-overflow check
        • Operation callback check
      • Quality
        • Get all LLVM tests passing
        • Fuzz (with decoders mutation-based fuzzer based on existing asm.js programs)
      • Optimize asm.js-to-Ion transition
      • VM stack integration
        • Error.stack
        • SPS's profiler stack
        • (Have debug-mode disable asm.js optimization for now)
    • Minor tasks
      • Test (and ease) IonMonkey internal limits for: number of locals, number of instructions, number of parameters, etc.
      • Make sure Odin code is OOM-safe.
      • Better error messages that include dynamic values (types/numbers involved).
      • Fix IonSpew
    • Optional optimizations
      • Add a float32 type to asm.js to allow 32-bit float arithmetic
      • FunctionBlob (TODO: link to proposal)
        • Efficient transfer between workers
        • Efficient IndexedDB serialization/deserialization
      • Full GVN/range analysis support for all the new asm.js IM MIR nodes
      • ToInt shouldn't generate so much code
      • Signal handler support for:
        • Integer division/modulus
        • Double-to-int conversion
      • General IonMonkey backend optimizations
        • Rearrange loops to put the condition at the end
        • Fold jump-to-jump into single jump
        • Use 32-bit register encoding on x64 for when the MIRType is int32
        • Use pc-relative constant double loads instead of trying to use immediates (GCC does)