state of js implementations, 2014 edition (web engines hackfest 2014)

22
State of JS Implementations, 2014 Edition webengineshackfest.org Andy Wingo

Upload: igalia

Post on 17-Jul-2015

103 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: State of JS Implementations, 2014 Edition (Web Engines Hackfest 2014)

State of JSImplementations,2014 Editionwebengineshackfest.org

Andy Wingo

Page 2: State of JS Implementations, 2014 Edition (Web Engines Hackfest 2014)

AgendaHistory

New things

Page 3: State of JS Implementations, 2014 Edition (Web Engines Hackfest 2014)

A brief history of JS1996-2008: slow

2014: fastish

Page 4: State of JS Implementations, 2014 Edition (Web Engines Hackfest 2014)

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)

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)
Page 7: State of JS Implementations, 2014 Edition (Web Engines Hackfest 2014)

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)

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)

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)

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)
Page 12: State of JS Implementations, 2014 Edition (Web Engines Hackfest 2014)

A brief history of JS1996-2008: slow

2014: fastish

...via adaptive optimization.

Page 13: State of JS Implementations, 2014 Edition (Web Engines Hackfest 2014)

New things in 2014

Page 14: State of JS Implementations, 2014 Edition (Web Engines Hackfest 2014)

New things in 2014SM, JSC, V8

First perf, then features

Page 15: State of JS Implementations, 2014 Edition (Web Engines Hackfest 2014)

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)

JSC perf(I am less knowledgeable here)

“Fourth-tier LLVM” (FTL) JIT

Page 17: State of JS Implementations, 2014 Edition (Web Engines Hackfest 2014)
Page 18: State of JS Implementations, 2014 Edition (Web Engines Hackfest 2014)

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)

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)
Page 21: State of JS Implementations, 2014 Edition (Web Engines Hackfest 2014)

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)

2015 predictionsTF landing?

More LLVM passes enabled in FTL?

ES6, ES7, other language experimentations?

?