Use lambda functions in DocumentOrderedMap instead of templates and separate named functions.
Created attachment 240958 [details] Patch
Attachment 240958 [details] did not pass style-queue: ERROR: Source/WebCore/dom/DocumentOrderedMap.h:71: Extra space before ( in function call [whitespace/parens] [4] Total errors found: 1 in 3 files If any of these errors are false positives, please file a bug against check-webkit-style.
Comment on attachment 240958 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=240958&action=review > Source/WebCore/dom/DocumentOrderedMap.cpp:88 > +inline Element* DocumentOrderedMap::get(const AtomicStringImpl& key, const TreeScope& scope, KeyMatchingFunction keyMatches) const Seems like this might not get inlined as much as it did before. Are you sure there is no performance problem introduced here?
Comment on attachment 240958 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=240958&action=review >> Source/WebCore/dom/DocumentOrderedMap.cpp:88 >> +inline Element* DocumentOrderedMap::get(const AtomicStringImpl& key, const TreeScope& scope, KeyMatchingFunction keyMatches) const > > Seems like this might not get inlined as much as it did before. Are you sure there is no performance problem introduced here? Hmm, this may be an issue indeed. I will verify.
Did you run perf tests for this?
(In reply to comment #5) > Did you run perf tests for this? I will, as pointed out by Darin, it is likely I'll need to keep the function templated. However, we can still use lambdas.
Created attachment 240985 [details] Archive of layout-test-results from webkit-ews-09 for mac-mountainlion-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: webkit-ews-09 Port: mac-mountainlion-wk2 Platform: Mac OS X 10.8.5
Comment on attachment 240958 [details] Patch I confirmed this regresses performance (~8% on getElementById). I'll re-upload a version keeping the function templated.
Created attachment 240990 [details] Patch
I have confirmed that this new version does not regress performance. getElementById() actually seems to be ~2% faster now although I am not sure why.
I set the review flag again as the changes to the patch after the review were non-trivial.
Comment on attachment 240990 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=240990&action=review > Source/WebCore/dom/DocumentOrderedMap.h:72 > + template <typename KeyMatchingFunction> > + Element* get(const AtomicStringImpl&, const TreeScope&, const KeyMatchingFunction&) const; I know we often format function template declarations like this on two lines, but I find it hard to see the structure here, with both lines flush left, but the second actually a continuation of the first. That’s why I prefer putting these into a single line, even if it makes the line long.
Comment on attachment 240990 [details] Patch Clearing flags on attachment: 240990 Committed r175697: <http://trac.webkit.org/changeset/175697>
All reviewed patches have been landed. Closing bug.