Bug 136983

Summary: Structure should have a method for concurrently getting all of the property map entries, and this method shouldn't involve copy-paste
Product: WebKit Reporter: Filip Pizlo <fpizlo>
Component: JavaScriptCoreAssignee: Filip Pizlo <fpizlo>
Status: RESOLVED FIXED    
Severity: Normal CC: barraclough, commit-queue, ggaren, mark.lam, mhahnenb, mmirman, msaboff, nrotem, oliver, sam
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Bug Depends on:    
Bug Blocks: 136330    
Attachments:
Description Flags
the patch
none
the patch mhahnenb: review+

Filip Pizlo
Reported 2014-09-21 12:56:18 PDT
Patch forthcoming.
Attachments
the patch (8.59 KB, patch)
2014-09-21 13:01 PDT, Filip Pizlo
no flags
the patch (8.66 KB, patch)
2014-09-21 13:20 PDT, Filip Pizlo
mhahnenb: review+
Filip Pizlo
Comment 1 2014-09-21 13:01:06 PDT
Created attachment 238429 [details] the patch
WebKit Commit Bot
Comment 2 2014-09-21 13:03:53 PDT
Attachment 238429 [details] did not pass style-queue: ERROR: Source/JavaScriptCore/runtime/Structure.cpp:1115: Place brace on its own line for function definitions. [whitespace/braces] [4] Total errors found: 1 in 4 files If any of these errors are false positives, please file a bug against check-webkit-style.
Filip Pizlo
Comment 3 2014-09-21 13:20:13 PDT
Created attachment 238431 [details] the patch For real this time.
Mark Hahnenberg
Comment 4 2014-09-21 14:10:04 PDT
Comment on attachment 238431 [details] the patch View in context: https://bugs.webkit.org/attachment.cgi?id=238431&action=review r=me with comments. > Source/JavaScriptCore/runtime/Structure.h:76 > +struct PropertyMapEntry { Maybe it makes sense to just pull this into its own header? It seems sort of weird to move it to Structure.h from PropertyMapHashTable.h. > Source/JavaScriptCore/runtime/StructureInlines.h:117 > + for (auto entry : *table) { auto& maybe? Do we want to copy each entry as we're iterating?
Filip Pizlo
Comment 5 2014-09-21 16:50:37 PDT
(In reply to comment #4) > (From update of attachment 238431 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=238431&action=review > > r=me with comments. > > > Source/JavaScriptCore/runtime/Structure.h:76 > > +struct PropertyMapEntry { > > Maybe it makes sense to just pull this into its own header? It seems sort of weird to move it to Structure.h from PropertyMapHashTable.h. I would love to be able to do that. Structure.h is included by everything in WebKit, so moving PropertyMapEntry into another head and including it from Structure.h would mean that there would be one more header that is included by everything in WebKit. Last I checked, such things make kling and smfr sad. > > > Source/JavaScriptCore/runtime/StructureInlines.h:117 > > + for (auto entry : *table) { > > auto& maybe? Do we want to copy each entry as we're iterating? Lol OK. In this case it can't possibly matter. The body of the loop will use the elements on entry. If we use auto without the & it means that initially clang will emit loads for all of the elements of PropertyMapEntry, which are all PODs so these are really just simple loads, and then llvm will DCE the loads that you didn't use. If you use auto&, then clang will emit the loads at the point of use. It doesn't matter.
Filip Pizlo
Comment 6 2014-09-21 16:53:01 PDT
Note You need to log in before you can comment on or make changes to this bug.