Bug 158908 - JSC::Symbol should be hash-consed
Summary: JSC::Symbol should be hash-consed
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Yusuke Suzuki
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-06-18 15:33 PDT by Filip Pizlo
Modified: 2016-07-29 01:00 PDT (History)
8 users (show)

See Also:


Attachments
Patch (63.45 KB, patch)
2016-07-28 03:01 PDT, Yusuke Suzuki
no flags Details | Formatted Diff | Diff
Patch (64.10 KB, patch)
2016-07-28 03:03 PDT, Yusuke Suzuki
no flags Details | Formatted Diff | Diff
Patch (64.11 KB, patch)
2016-07-28 03:26 PDT, Yusuke Suzuki
fpizlo: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Filip Pizlo 2016-06-18 15:33:57 PDT
I just realized that it's not possible to pointer-compare symbols!  This means that all symbol comparisons require dependent loads to get the Symbol's underlying uid.  This is probably worth fixing.  We would like symbol comparisons to not require loads.  To do that, we need to make Symbol hash-consed on a per-VM basis.
Comment 1 Yusuke Suzuki 2016-06-19 22:15:25 PDT
It sounds nice when using symbols as enum values (And using symbols in switch / if-else chain).
Comment 2 Yusuke Suzuki 2016-07-28 03:01:43 PDT
Created attachment 284766 [details]
Patch
Comment 3 Yusuke Suzuki 2016-07-28 03:03:50 PDT
Created attachment 284767 [details]
Patch
Comment 4 Yusuke Suzuki 2016-07-28 03:26:58 PDT
Created attachment 284770 [details]
Patch
Comment 5 Filip Pizlo 2016-07-28 10:56:58 PDT
Comment on attachment 284770 [details]
Patch

Nice!!
Comment 6 Yusuke Suzuki 2016-07-29 00:16:21 PDT
Committed r203895: <http://trac.webkit.org/changeset/203895>
Comment 7 Yusuke Suzuki 2016-07-29 01:00:46 PDT
Committed r203897: <http://trac.webkit.org/changeset/203897>