Bug 158908

Summary: JSC::Symbol should be hash-consed
Product: WebKit Reporter: Filip Pizlo <fpizlo>
Component: JavaScriptCoreAssignee: Yusuke Suzuki <ysuzuki>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, fpizlo, ggaren, keith_miller, mark.lam, msaboff, saam, ysuzuki
Priority: P2    
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Attachments:
Description Flags
Patch
none
Patch
none
Patch fpizlo: review+

Filip Pizlo
Reported 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.
Attachments
Patch (63.45 KB, patch)
2016-07-28 03:01 PDT, Yusuke Suzuki
no flags
Patch (64.10 KB, patch)
2016-07-28 03:03 PDT, Yusuke Suzuki
no flags
Patch (64.11 KB, patch)
2016-07-28 03:26 PDT, Yusuke Suzuki
fpizlo: review+
Yusuke Suzuki
Comment 1 2016-06-19 22:15:25 PDT
It sounds nice when using symbols as enum values (And using symbols in switch / if-else chain).
Yusuke Suzuki
Comment 2 2016-07-28 03:01:43 PDT
Yusuke Suzuki
Comment 3 2016-07-28 03:03:50 PDT
Yusuke Suzuki
Comment 4 2016-07-28 03:26:58 PDT
Filip Pizlo
Comment 5 2016-07-28 10:56:58 PDT
Comment on attachment 284770 [details] Patch Nice!!
Yusuke Suzuki
Comment 6 2016-07-29 00:16:21 PDT
Yusuke Suzuki
Comment 7 2016-07-29 01:00:46 PDT
Note You need to log in before you can comment on or make changes to this bug.