state of js implementations, 2014 edition (web engines hackfest 2014)
TRANSCRIPT
![Page 1: State of JS Implementations, 2014 Edition (Web Engines Hackfest 2014)](https://reader033.vdocument.in/reader033/viewer/2022051516/55a8654c1a28abed3f8b4609/html5/thumbnails/1.jpg)
State of JSImplementations,2014 Editionwebengineshackfest.org
Andy Wingo
![Page 2: State of JS Implementations, 2014 Edition (Web Engines Hackfest 2014)](https://reader033.vdocument.in/reader033/viewer/2022051516/55a8654c1a28abed3f8b4609/html5/thumbnails/2.jpg)
AgendaHistory
New things
![Page 3: State of JS Implementations, 2014 Edition (Web Engines Hackfest 2014)](https://reader033.vdocument.in/reader033/viewer/2022051516/55a8654c1a28abed3f8b4609/html5/thumbnails/3.jpg)
A brief history of JS1996-2008: slow
2014: fastish
![Page 4: State of JS Implementations, 2014 Edition (Web Engines Hackfest 2014)](https://reader033.vdocument.in/reader033/viewer/2022051516/55a8654c1a28abed3f8b4609/html5/thumbnails/4.jpg)
A brief history of JS1996-2008: slow
2014: fastish
Environmental forcing functions
Visiting a page == installing an app
Cruel latency requirements
![Page 5: State of JS Implementations, 2014 Edition (Web Engines Hackfest 2014)](https://reader033.vdocument.in/reader033/viewer/2022051516/55a8654c1a28abed3f8b4609/html5/thumbnails/5.jpg)
JS: speed via dynamic proof“Adaptive optimization”
A revival of compilation techniques pioneeredby Smalltalk, Self, Strongtalk, Javaexpr ifTrue: block
Inlining key for performance: build sizableproof term
JS focus: low-latency adaptive optimization(fast start)
lazy parsing and compilation❧
![Page 6: State of JS Implementations, 2014 Edition (Web Engines Hackfest 2014)](https://reader033.vdocument.in/reader033/viewer/2022051516/55a8654c1a28abed3f8b4609/html5/thumbnails/6.jpg)
![Page 7: State of JS Implementations, 2014 Edition (Web Engines Hackfest 2014)](https://reader033.vdocument.in/reader033/viewer/2022051516/55a8654c1a28abed3f8b4609/html5/thumbnails/7.jpg)
All about the tiers“Method JIT compilers”; Java’s HotSpot iscanonical comparison
The function is the unit of optimization
asm.js code can start in IonMonkey / Turbofan;embedded static proof pipeline
![Page 8: State of JS Implementations, 2014 Edition (Web Engines Hackfest 2014)](https://reader033.vdocument.in/reader033/viewer/2022051516/55a8654c1a28abed3f8b4609/html5/thumbnails/8.jpg)
Optimizing compiler awash ininformationOperand and result types
Free variable values
Global variable values
Sets of values: mono-, poly-, mega-morphic
![Page 9: State of JS Implementations, 2014 Edition (Web Engines Hackfest 2014)](https://reader033.vdocument.in/reader033/viewer/2022051516/55a8654c1a28abed3f8b4609/html5/thumbnails/9.jpg)
Optimizations: An inventoryInlining
Code motion: CSE, DCE, hoisting, sea-of-nodes
Specialization
Numeric: int32, uint32, float, ...❧
Object: Indexed slot access❧
String: Cons, packed, pinned, ...❧
Allocation optimization: coalescing, scalarreplacement, sinking
Register allocation
![Page 10: State of JS Implementations, 2014 Edition (Web Engines Hackfest 2014)](https://reader033.vdocument.in/reader033/viewer/2022051516/55a8654c1a28abed3f8b4609/html5/thumbnails/10.jpg)
Dynamic proof, dynamicbailoutCompilation is proof-driven term specialization
Dynamic assertions: the future will be like thepast
Dynamic assertion failure causes proofinvalidation: abort (“bailout”) to baseline tier
Bailout enables static compilation techniques(FTL)
![Page 11: State of JS Implementations, 2014 Edition (Web Engines Hackfest 2014)](https://reader033.vdocument.in/reader033/viewer/2022051516/55a8654c1a28abed3f8b4609/html5/thumbnails/11.jpg)
![Page 12: State of JS Implementations, 2014 Edition (Web Engines Hackfest 2014)](https://reader033.vdocument.in/reader033/viewer/2022051516/55a8654c1a28abed3f8b4609/html5/thumbnails/12.jpg)
A brief history of JS1996-2008: slow
2014: fastish
...via adaptive optimization.
![Page 13: State of JS Implementations, 2014 Edition (Web Engines Hackfest 2014)](https://reader033.vdocument.in/reader033/viewer/2022051516/55a8654c1a28abed3f8b4609/html5/thumbnails/13.jpg)
New things in 2014
![Page 14: State of JS Implementations, 2014 Edition (Web Engines Hackfest 2014)](https://reader033.vdocument.in/reader033/viewer/2022051516/55a8654c1a28abed3f8b4609/html5/thumbnails/14.jpg)
New things in 2014SM, JSC, V8
First perf, then features
![Page 15: State of JS Implementations, 2014 Edition (Web Engines Hackfest 2014)](https://reader033.vdocument.in/reader033/viewer/2022051516/55a8654c1a28abed3f8b4609/html5/thumbnails/15.jpg)
SpiderMonkey perfSM won Octane!
Landing of precise GC, then generational GC
https://blog.mozilla.org/javascript/2013/07/18/clawing-our-way-back-to-precision/
Compacting GC in the works
Lots of Ion work
![Page 16: State of JS Implementations, 2014 Edition (Web Engines Hackfest 2014)](https://reader033.vdocument.in/reader033/viewer/2022051516/55a8654c1a28abed3f8b4609/html5/thumbnails/16.jpg)
JSC perf(I am less knowledgeable here)
“Fourth-tier LLVM” (FTL) JIT
![Page 17: State of JS Implementations, 2014 Edition (Web Engines Hackfest 2014)](https://reader033.vdocument.in/reader033/viewer/2022051516/55a8654c1a28abed3f8b4609/html5/thumbnails/17.jpg)
![Page 18: State of JS Implementations, 2014 Edition (Web Engines Hackfest 2014)](https://reader033.vdocument.in/reader033/viewer/2022051516/55a8654c1a28abed3f8b4609/html5/thumbnails/18.jpg)
V8 perfEnd of the road for Crankshaft
New thing: Turbofan
Fully typed IR, more capable of reliablyinferring types over big asm.js programs
Sea-of-nodes approach transparently enablescode motion
Status: enabled, but for asm.js code only
![Page 19: State of JS Implementations, 2014 Edition (Web Engines Hackfest 2014)](https://reader033.vdocument.in/reader033/viewer/2022051516/55a8654c1a28abed3f8b4609/html5/thumbnails/19.jpg)
FeaturesECMAScript 6 (ES6) was supposed to arrive thisyear, punted to next year, but all implementorsinvolved in process
All engines are actively implementing ES6features
JSC has implemented some features but not asfocussed
http://kangax.github.io/compat-table/es6/
![Page 20: State of JS Implementations, 2014 Edition (Web Engines Hackfest 2014)](https://reader033.vdocument.in/reader033/viewer/2022051516/55a8654c1a28abed3f8b4609/html5/thumbnails/20.jpg)
![Page 21: State of JS Implementations, 2014 Edition (Web Engines Hackfest 2014)](https://reader033.vdocument.in/reader033/viewer/2022051516/55a8654c1a28abed3f8b4609/html5/thumbnails/21.jpg)
TrendsArchitectural convergence
Ongoing perf work to make JS a better languageto compile to (OdinMonkey, FTL, TF)
Ongoing ES6 feature work to make JS a betterlanguage to write
![Page 22: State of JS Implementations, 2014 Edition (Web Engines Hackfest 2014)](https://reader033.vdocument.in/reader033/viewer/2022051516/55a8654c1a28abed3f8b4609/html5/thumbnails/22.jpg)
2015 predictionsTF landing?
More LLVM passes enabled in FTL?
ES6, ES7, other language experimentations?
?