RESOLVED DUPLICATE of bug 144848 144440
Introduce UniquePropertyID class instead of using StringImpl* as uid
https://bugs.webkit.org/show_bug.cgi?id=144440
Summary Introduce UniquePropertyID class instead of using StringImpl* as uid
Yusuke Suzuki
Reported 2015-04-30 02:23:40 PDT
To prevent the symbolized StringImpl* with the other string in their contents accidentally, I'm now planning to introduce a new class such as UniquePropertyID. In UniquePropertyID, we prohibit comparison in their contents. Pointer comparison is only allowed. This is the replacement to StringImpl* uid usage. The typical implementaion is the following... class UniquePropertyID : private StringImpl { using existingSymbolAwareHash; using symbolAwareHash; using isSymbol; StringImpl* publicName() { return isSymbol() ? nullptr : this; } // Factory functions from StringImpl*. // ... };
Attachments
Yusuke Suzuki
Comment 1 2015-04-30 03:01:14 PDT
Hm, but, if these use cases are rare enough, we can go without this fix.
Yusuke Suzuki
Comment 2 2015-05-01 01:43:31 PDT
After considering about it, I think this case is a little bit rare. Because when using StringImpl* would be used for Identifier, it is already atomized / symbolized by Identifier class. So places we need to take care is when comparing StringImpl* (which is used as uid) and the other strings .
Yusuke Suzuki
Comment 3 2015-05-20 10:22:20 PDT
*** This bug has been marked as a duplicate of bug 144848 ***
Note You need to log in before you can comment on or make changes to this bug.