[Webkit-unassigned] [Bug 193764] New: Template Literal GC'ed Against Specs
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Thu Jan 24 01:29:36 PST 2019
https://bugs.webkit.org/show_bug.cgi?id=193764
Bug ID: 193764
Summary: Template Literal GC'ed Against Specs
Product: WebKit
Version: Safari Technology Preview
Hardware: Unspecified
OS: Unspecified
Status: NEW
Severity: Normal
Priority: P2
Component: JavaScriptCore
Assignee: webkit-unassigned at lists.webkit.org
Reporter: andrea.giammarchi at gmail.com
Created attachment 360000
--> https://bugs.webkit.org/attachment.cgi?id=360000&action=review
the alert shown on Safari Technology Preview
Accordingly with Note 2 of ECMAScript Language Specification:
http://www.ecma-international.org/ecma-262/#sec-gettemplateobject
Each TemplateLiteral in the program code of a realm is associated with a unique template object that is used in the evaluation of tagged Templates (12.2.9.6).
The template objects are frozen and the same template object is used each time a specific tagged Template is evaluated.
Whether template objects are created lazily upon first evaluation of the TemplateLiteral or eagerly prior to first evaluation is an implementation choice that is not observable to ECMAScript code.
However, as you can easily test on this code pen https://codepen.io/WebReflection/pen/OdVrqN?editors=0010 , you will see an alert, at some point, demonstrating that the template literal has been collected and recreated, hence it's both not unique and also observable in terms of GC operation.
This happens in both latest Safari on macOS Mojave, and Safari Technology Preview, and it makes code relying on uniqueness of template literals incapable of performing well in Safari ('cause templates needs to be transformed per their value instead of their unique reference).
Please provide an ETA so I can also evaluate if I should penalize safari performance in various libraries based on that part of the specifications.
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20190124/66a18141/attachment.html>
More information about the webkit-unassigned
mailing list