Javascript:SpiderMonkey:OdinMonkey: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
== Active ==
== Active ==
* Heap resizing: {{bug|965880}}
* Continue iteration on [https://github.com/johnmccutchan/ecmascript_simd SIMD proposal] and implementation/optimization in Ion/Odin.
* Implement SIMD proposal ({{bug|894105}}) and incorporate into asm.js ({{bug|992267}})
* [https://docs.google.com/spreadsheets/d/1PFa3aDxY6mffT8uoflCaFitX9lKj_Y4_aZwtMApIRiI/edit#gid=0 SharedArrayBuffer, Atomics, Futex]
* Continued SharedArrayBuffer prototyping in SpiderMonkey and Emscripten
 
== Planned next projects ==
* PGAOT (Profile-Guided Ahead-of-Time Compilation):  
* PGAOT (Profile-Guided Ahead-of-Time Compilation):  
** Create a baseline asm.js compiler: super-fast codegen but with full static type info
** Create a baseline asm.js compiler: super-fast codegen but with full static type info
** Allow individual functions in an asm.js module to choose full or baseline (via "use" pragma on individual functions)
** Allow individual functions in an asm.js module to choose full or baseline (via "use" pragma on individual functions)
** Allow Emscripten users to change default (full or baseline), hand-annotate, or do profiling to place pragmas.
** Allow Emscripten users to change default (full or baseline), hand-annotate, or do profiling to place pragmas.
== Planned next projects ==
* Zero-cost exception handling: {{bug|1065089}}
* Zero-cost exception handling: {{bug|1065089}}
* Optimize calls into ({{bug|962641}}), out of ({{bug|1000632}}), and between ({{bug|982036}}) asm.js modules.
* Remove async-script requirement for asm.js caching:  
* Remove async-script requirement for asm.js caching:  
** Maybe remove it from QuotaManager: {{bug|961057}}
** Maybe remove it from QuotaManager: {{bug|961057}}
Line 29: Line 27:
* For asm.js->asm.js calls on x86, pass the return value via xmm register, not fp stack
* For asm.js->asm.js calls on x86, pass the return value via xmm register, not fp stack
* Remove branching from double-to-int conversion using signal handler (see also {{bug|818750}})
* Remove branching from double-to-int conversion using signal handler (see also {{bug|818750}})
* Optimize calls into ({{bug|962641}}), out of ({{bug|1000632}}), and between ({{bug|982036}}) asm.js modules.


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

Revision as of 19:33, 16 October 2014

Active

  • Continue iteration on SIMD proposal and implementation/optimization in Ion/Odin.
  • SharedArrayBuffer, Atomics, Futex
  • PGAOT (Profile-Guided Ahead-of-Time Compilation):
    • Create a baseline asm.js compiler: super-fast codegen but with full static type info
    • Allow individual functions in an asm.js module to choose full or baseline (via "use" pragma on individual functions)
    • Allow Emscripten users to change default (full or baseline), hand-annotate, or do profiling to place pragmas.

Planned next projects

  • Zero-cost exception handling: bug 1065089
  • Remove async-script requirement for asm.js caching:
    • Maybe remove it from QuotaManager: bug 961057
    • More likely, just take (large) script parsing off the main thread.
  • Fix asm.js caching browser interop (bug 1047098, bug 1047105

Possible further load-time optimizations

  • Parse and AOT compile while downloading: bug 1061886
  • Move code generation into the parallel compilation tasks: bug 959263
  • asm.js parser: Avoid building an intermediate parse tree; type check during recursive descent bug 854061

Possible further throughput optimizations

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

  • Extend asm.js to allow proper tail calls for all return types and do the tail-call optimization
  • 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 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

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

Current asm.js spec bugs

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

Odinmonkey800.jpg
Credit to John Howard