Personal tools


From MozillaWiki

Jump to: navigation, search



  • Extend profiler stack-walking to use metadata (bug 994136) for general Ion frames and then extend support to asm.js so that asm.js frames shows up in the builtin devtools profiler
  • Optimize asm.js->asm.js FFI calls: bug 982036
  • Further optimize asm.js->Ion calls: bug 1000632
  • Add inline fast implementation of sin/cos: bug 967709
  • Implement SIMD proposal (bug 894105) and incorporate into asm.js (bug 992267)
  • Continued SharedArrayBuffer prototyping in SpiderMonkey and Emscripten

Planned next projects

  • Fully optimize calls into (bug 962641) and out of (bug 882399 asm.js
  • Move code generation into the parallel compilation tasks: bug 959263
  • Remove async-script requirement for asm.js caching: bug 961057

Usability improvements

  • Print warning on out-of-bounds heap access: bug 879891
  • Add about:config option to check for and emit warning on unaligned heap access

Possible further optimization projects

  • General backend optimizations:
  • Further improve load-time:
    • Start general JS parsing before the entire JS script has completed downloading so that asm.js compilation can overlap (and we'd be justified in doing all script parsing off the main thread)
    • asm.js parser: Avoid building an intermediate parse tree; type check during recursive descent bug 854061
  • Further improve caching:
    • Compress more than just the source in asm.js cache entries
  • Improve compile time on pathological functions:
    • Break up super-large functions into disjoint regions that can be regalloc'd and optimized separately
    • Investigate GVN quadratic behavior : bug 845068
  • For asm.js->asm.js calls on x86, pass the return value via xmm register, not fp stack
  • Extend the asm.js signal handler tricks to:
    • Remove idiv branching
    • Remove double-to-int conversion branching (see also bug 818750)

Possible asm.js extensions that don't require new JS features

  • Heap resizing: bug 965880
  • Effectively support 'goto' (even computed 'goto') by formalizing a pattern of while+switch that gets compiled as if it was goto
  • Extend asm.js to better support dynamically linking asm.js modules (a mutable, callable array argument to asm.js module, like the PLT)
  • Add enough try/catch to asm.js to allow compilation of C++ exceptions using the zero-cost implementation strategy
  • Add DataView to avoid the alignment mask on asm.js heap accesses (this is mostly a problem of DataView being slow in all browsers)

Proposed future JS features that would be useful to asm.js

  • ArrayBuffer.prototype.discard (bug 855669): to allow madvise(DONTNEED)
  • Typed Objects: (Typed Objects)
    • This feature comes with float32/uint64/int64 value types, which would be useful as scalar types in asm.js.
    • Formalize Typed Object "class declarations" in asm.js which could make asm.js a target for JVM/CLR/TypeScript (and allow these languages to reuse the builtin JS GC)
  • FunctionPromise: bug 854627, or perhaps just make some functions (asm.js, no-free-variables) structured-cloneable
  • Add way to programmatically observe whether asm.js validated: bug 952847

Current asm.js spec bugs

Credit to John Howard