Javascript:SpiderMonkey:OdinMonkey: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
Line 21: Line 21:
* Compress asm.js cache entries
* Compress asm.js cache entries
* Add enough try/catch to asm.js to allow compilation of C++ exceptions using the zero-cost implementation strategy  
* Add enough try/catch to asm.js to allow compilation of C++ exceptions using the zero-cost implementation strategy  
* Start general JS parsing before the entire JS script has completed downloadeding so that asm.js compilation can overlap
* Start general JS parsing before the entire JS script has completed downloading so that asm.js compilation can overlap
* Standardize and implement value objects ({{bug|749786}}) then add int64/uint64 to asm.js
* Standardize and implement value objects ({{bug|749786}}) then add int64/uint64 to asm.js
* asm.js parser : {{bug|854061}}
* asm.js parser : {{bug|854061}}

Revision as of 12:32, 30 November 2013

Active

  • Cache compiled asm.js modules: caching landed on FF28 (Nightly). Follow-up improvements: cache from workers (bug 941830), cache more than one module per origin (bug 944821).
  • Math.fround is in ES6 and SpiderMonkey and optimized in Ion. Add to asm.js/Odin (bug 904918))
  • Standardize then implement SIMD extensions to JS (bug 894105) and then incorporate into asm.js (TODO: bug)
  • Land experimental SharedArrayBuffer (pref'd off, bug 933001) and use this to add experimental pthreads support to Emscripten and evaluate on threaded codebases in preparation for a standards proposal.

Planned next projects

  • Add stack-walking support for asm.js code:
    • Per-function information in the builtin FF profiler
    • Make asm.js calls show up in Error.stack.
  • Remove parsing limitations associated with huge JS files:
    • Fix lazy-parsing/decompression memory-spike and performance hit for huge js files (bug 938385).
    • Remove num-locals (bug 916612) and num-lines (bug 916564) parser limits.
  • Mitigate 32-bit OOM problems: (bug 865959)
  • Standardize then implement an ArrayBuffer.resize (bug 927182, to allow growable heap) and ArrayBuffer.discard (bug 855669, to allow madvise(DONTNEED))
  • Add && and || to asm.js to avoid sub-optimal control flow (bug 919052).

Possible next projects

  • Experiment with using LLVM as the compiler backend for asm.js code.
  • Extend asm.js to better support dynamically linking asm.js modules (a mutable, callable array argument to asm.js module, like the PLT)
  • Compress asm.js cache entries
  • Add enough try/catch to asm.js to allow compilation of C++ exceptions using the zero-cost implementation strategy
  • Start general JS parsing before the entire JS script has completed downloading so that asm.js compilation can overlap
  • Standardize and implement value objects (bug 749786) then add int64/uint64 to asm.js
  • asm.js parser : bug 854061
  • Support GC allocated Java-like objects to allow asm.js generation from JVM/CLR bytecode. Use Typed Objects to describe class structure. Use real vtables.
  • fall back to baseline jit for very large functions (maybe not necessary with Emscripten outlining): bug 875174
  • FunctionFuture : bug 854627

Potential backend optimizations

  • native vs. asm.js differential profiling : bug 863924
  • Revisit primary Ion algorithms (phi placement, gvn, regalloc) to avoid the polynomial compile-time blowup we sometimes see on huge functions
  • improve heap access performance : bug 865516, bug 865523, bug 869606, bug 870743, bug 897425
  • improve x86/ARM asm.js-to-asm.js ABI : bug 861785
  • further improve FFI calls : bug 882399, bug 886411
  • Optimize calls into asm.js code (to avoid the general CallAsmJS C++ trampoline.
  • Use a signal handler to:
    • remove stack overflow checks
    • remove idiv branching
    • remove double-to-int conversion branching (see also bug 818750)
  • Use useAny when lowering new AsmJS MIR nodes
  • Optimize CFG to minimize branching : bug 844779
  • Don't spill non-volatile registers at calls out to C++
  • Align loop headers on natural boundaries : bug 867001
  • Further optimize multiplication by a constant to use lea tricks for small constants (e.g. x*3 == x<<1+x)

Current asm.js spec bugs

https://github.com/dherman/asm.js/issues?state=open

Odinmonkey800.jpg
Credit to John Howard