Bug 140048

Summary: Clean up OwnPtr in WebCore/loader
Product: WebKit Reporter: Gyuyoung Kim <gyuyoung.kim>
Component: WebCore Misc.Assignee: Gyuyoung Kim <gyuyoung.kim>
Status: NEW    
Severity: Normal CC: buildbot, commit-queue, japhet, rniwa
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
WIP
none
Patch
none
Patch
none
Archive of layout-test-results from ews104 for mac-mountainlion-wk2
none
Patch
none
Patch
buildbot: commit-queue-
Archive of layout-test-results from ews101 for mac-mountainlion
none
Archive of layout-test-results from ews104 for mac-mountainlion-wk2 none

Gyuyoung Kim
Reported 2015-01-02 20:21:47 PST
SSIA
Attachments
WIP (5.50 KB, patch)
2015-01-02 20:23 PST, Gyuyoung Kim
no flags
Patch (7.10 KB, patch)
2015-01-04 00:24 PST, Gyuyoung Kim
no flags
Patch (7.70 KB, patch)
2015-01-04 04:25 PST, Gyuyoung Kim
no flags
Archive of layout-test-results from ews104 for mac-mountainlion-wk2 (916.99 KB, application/zip)
2015-01-04 05:37 PST, Build Bot
no flags
Patch (9.13 KB, patch)
2015-01-05 19:53 PST, Gyuyoung Kim
no flags
Patch (9.19 KB, patch)
2015-01-06 08:27 PST, Gyuyoung Kim
buildbot: commit-queue-
Archive of layout-test-results from ews101 for mac-mountainlion (897.91 KB, application/zip)
2015-01-06 09:33 PST, Build Bot
no flags
Archive of layout-test-results from ews104 for mac-mountainlion-wk2 (910.25 KB, application/zip)
2015-01-06 09:39 PST, Build Bot
no flags
Gyuyoung Kim
Comment 1 2015-01-02 20:23:38 PST
Gyuyoung Kim
Comment 2 2015-01-04 00:24:48 PST
Gyuyoung Kim
Comment 3 2015-01-04 04:25:46 PST
Build Bot
Comment 4 2015-01-04 05:37:31 PST
Comment on attachment 243927 [details] Patch Attachment 243927 [details] did not pass mac-wk2-ews (mac-wk2): Output: http://webkit-queues.appspot.com/results/6523443113623552 Number of test failures exceeded the failure limit.
Build Bot
Comment 5 2015-01-04 05:37:33 PST
Created attachment 243928 [details] Archive of layout-test-results from ews104 for mac-mountainlion-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: ews104 Port: mac-mountainlion-wk2 Platform: Mac OS X 10.8.5
Darin Adler
Comment 6 2015-01-04 13:57:49 PST
Comment on attachment 243927 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=243927&action=review > Source/WebCore/loader/cache/MemoryCache.cpp:119 > if (!originMap) { > - originMap = new CachedResourceItem; > - resources.set(resource->url(), adoptPtr(originMap)); > + resources.set(resource->url(), std::make_unique<CachedResourceItem>()); > + originMap = resources.get(resource->url()); > } > originMap->set(resource->cachePartition(), resource); This does two extra hash table lookups the first time it populates the resources map for any given URL, bloating both code size and execution speed. The existing code was already doing one extra hash lookup, but this patch added yet another. The correct way to write this is: auto& originMap = resources.add(resource->url(), nullptr)->iterator.value; if (!originMap) originMap = std::make_unique<CachedResourceItem>(); originMap->set(resource->cachePartition(), resource); > Source/WebCore/loader/cache/MemoryCache.cpp:154 > CachedResourceItem* originMap = resources.get(resource->url()); > if (!originMap) { > - originMap = new CachedResourceItem; > - resources.set(resource->url(), adoptPtr(originMap)); > + resources.set(resource->url(), std::make_unique<CachedResourceItem>()); > + originMap = resources.get(resource->url()); > } > originMap->set(resource->cachePartition(), resource); Ditto.
Gyuyoung Kim
Comment 7 2015-01-05 19:53:29 PST
Gyuyoung Kim
Comment 8 2015-01-06 08:27:30 PST
Build Bot
Comment 9 2015-01-06 09:33:35 PST
Comment on attachment 244063 [details] Patch Attachment 244063 [details] did not pass mac-ews (mac): Output: http://webkit-queues.appspot.com/results/6334210612658176 Number of test failures exceeded the failure limit.
Build Bot
Comment 10 2015-01-06 09:33:38 PST
Created attachment 244067 [details] Archive of layout-test-results from ews101 for mac-mountainlion The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: ews101 Port: mac-mountainlion Platform: Mac OS X 10.8.5
Build Bot
Comment 11 2015-01-06 09:39:37 PST
Comment on attachment 244063 [details] Patch Attachment 244063 [details] did not pass mac-wk2-ews (mac-wk2): Output: http://webkit-queues.appspot.com/results/6682011561361408 Number of test failures exceeded the failure limit.
Build Bot
Comment 12 2015-01-06 09:39:40 PST
Created attachment 244069 [details] Archive of layout-test-results from ews104 for mac-mountainlion-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: ews104 Port: mac-mountainlion-wk2 Platform: Mac OS X 10.8.5
Note You need to log in before you can comment on or make changes to this bug.