Summary: | Track inheritance structures in a side table, instead of using a private name in each prototype | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Geoffrey Garen <ggaren> | ||||||
Component: | New Bugs | Assignee: | Geoffrey Garen <ggaren> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | fpizlo, gyuyoung.kim, rakuco, sam, webkit.review.bot | ||||||
Priority: | P2 | ||||||||
Version: | 528+ (Nightly build) | ||||||||
Hardware: | Unspecified | ||||||||
OS: | Unspecified | ||||||||
Attachments: |
|
Description
Geoffrey Garen
2013-01-19 13:08:23 PST
Created attachment 183632 [details]
Patch
Created attachment 183633 [details]
performance
Seems performance-neutral, as expected. Comment on attachment 183632 [details]
Patch
Sam and Phil reviewed this.
Committed r140259: <http://trac.webkit.org/changeset/140259> ASSERTing on a sputnik test: http://build.webkit.org/results/Apple%20MountainLion%20Debug%20WK1%20(Tests)/r140274%20(4771)/sputnik/Conformance/13_Function_Definition/13.2_Creating_Function_Objects/S13.2.2_A3_T1-crash-log.txt. Disabled the ASSERT for the time being to get the bots green: <http://trac.webkit.org/changeset/140259>. Follow-up ASSERT fix: <http://trac.webkit.org/changeset/140284>. Comment on attachment 183632 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=183632&action=review > Source/JavaScriptCore/runtime/PrototypeMap.h:41 > + bool isPrototype(JSObject*); // Returns a conservative estimate. Two thoughts: 1) If it’s a conservative estimate, then how about a name that reflects that? Perhaps mayBePrototype? I’m not really sure what a conservative estimate means. 2) Should be a const member function. (In reply to comment #9) > (From update of attachment 183632 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=183632&action=review > > > Source/JavaScriptCore/runtime/PrototypeMap.h:41 > > + bool isPrototype(JSObject*); // Returns a conservative estimate. > > Two thoughts: > > 1) If it’s a conservative estimate, then how about a name that reflects that? Perhaps mayBePrototype? I’m not really sure what a conservative estimate means. I like mayBePrototype. But I think the reason why this was landed as isPrototype is that we were thinking of converting all of these possibly-conservative Boolean queries to use TriState. Hence you would say isPrototype(thing) != FalseTriState. But this would require moving the declaration of TriState from WebCore into WTF, so that'll be a separate patch. This TriState approach is great because I think it more accurately captures other forms of queries in JSC. It's common for us to be able to answer a question with "maybe". > > 2) Should be a const member function. > This TriState approach is great because I think it more accurately captures other forms of queries in JSC. It's common for us to be able to answer a question with "maybe". I did this in bug 108628. > I’m not really sure what a conservative estimate means. Added a comment to try to clarify this. > 2) Should be a const member function. Fixed in bug 108628. |