WebKit ES6 Support

WebKit ES6 Support

Introduce the status of WebKit ES6 Support and WIP issues.

09b5a917b6ea8928e0d5bf8a432412fe?s=128

Yusuke SUZUKI

June 26, 2015
Tweet

Transcript

  1. Latest ES6 work on WebKit Yusuke Suzuki @Constellation <utatane.tea@gmail.com>

  2. Self-introduction • WebKit Reviewer <utatane.tea@gmail.com> – Expertise: CSS JIT, ECMAScript

    / JavaScript – IRC: yusukesuzuki • Owner of some ECMAScript modules – Escodegen, Escope, Esmangle, Estraverse, Doctrine etc. – Have you ever used it?
  3. ES6 in Safari9 • Safari9

  4. ES6 supported by WebKit • This list is the part

    of the whole ES6 support
  5. ES6 supported by WebKit • This list is the part

    of the whole ES6 support
  6. ES6 supported by WebKit • This list is the part

    of the whole ES6 support
  7. Do you know the status of ES6 in WebKit? •

    The status of ES6 in WebKit JavaScriptCore – Not V8 / SpiderMonkey / Chakra • Already announced a lot of features will be shipped in Safari9
  8. The other parts (1) • iterators & for-of – Complete

    support of `iterator.return()` – Of course, @@iterator is supported • You can easily create the custom iterators • destructuring – Array, Object patterns are already supported – Rest element is just supported (WK) – Destructuring accepts iterators (WK) – Spec conformance becomes higher than Firefox 40
  9. The other parts (2) • Default initializer for assignments &

    decls – Like, `var { a = 20 } = obj;` • Several well-known Symbols – @@unscopable – @@iterator
  10. The other parts (3) • String extra methods – String#codePointAt,

    String#repeat etc. • Array extra methods – Array#find etc • Object extra methods – Object.assign, Object.getPrototypeOf etc. • Math extra methods – Math.imul etc. • Number extra methods
  11. The other parts (4) • Map, Set, WeakMap – Their

    implementation is upgraded to match to the ES6 spec – e.g. entries() returns iterator
  12. WebKit implementation status • WebKit now has a status page

    – http://www.webkit.org/status.html • Supported ES6 features are also listed here – When I implemented something, I will add it.
  13. Ongoing parts (1) • Arrow functions – Parsing functionality is

    just landed (today) • http://trac.webkit.org/changeset/185989 • Block scoped variables (let, const) – Patch by Saam • https://bugs.webkit.org/show_bug.cgi?id=142944
  14. Ongoing parts (2) • Default parameters – Since it requires

    blocked scope system (TDZ) • Spread operators
  15. Details of JSC • JSC already has the system to

    write builtin functions in JS – For example, Array#sort is rewritten in JS – Bucket & merge sort • Privileged JS code can emit bytecodes – @putDirectByVal • JS-written builtin encourages DFG/FTL JIT – ArrayIterator#next is written in JS • Inlining • Object sinking
  16. Conclusion • The latest WebKit will ship a lot of

    ES6 features • ES6 features are now actively implemented in WebKit