Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(9)

Issue 138643003: Simpler return value of HashTable::add/HashMap:add and others (Closed)

Created:
6 years, 10 months ago by Daniel Bratell
Modified:
6 years, 10 months ago
CC:
blink-reviews, shans, jamesr, webcomponents-bugzilla_chromium.org, eae+blinkwatch, fs, yurys+blink_chromium.org, apavlov+blink_chromium.org, adamk+blink_chromium.org, pdr, loislo+blink_chromium.org, Steve Block, dino_apple.com, rune+blink, Nils Barth (inactive), blink-layers+watch_chromium.org, caseq+blink_chromium.org, Nate Chapin, arv+blink, alancutter (OOO until 2018), marja+watch_chromium.org, dsinclair, dglazkov+blink, abarth-chromium, aandrey+blink_chromium.org, dstockwell, Timothy Loh, Rik, gavinp+loader_chromium.org, jchaffraix+rendering, devtools-reviews_chromium.org, bemjb+rendering_chromium.org, pdr., rwlbuis, Eric Willigers, kenneth.christiansen, rjwright, zoltan1, sof, jbroman, lushnikov+blink_chromium.org, pfeldman+blink_chromium.org, eustas+blink_chromium.org, paulirish+reviews_chromium.org, gyuyoung.kim_webkit.org, darktears, haraken, krit, kojih, jsbell+bindings_chromium.org, danakj, alph+blink_chromium.org, leviw+renderwatch, vsevik+blink_chromium.org, Mike Lawther (Google), ed+blinkwatch_opera.com, f(malita), Inactive, chromiumbugtracker_adobe.com, Stephen Chennney
Visibility:
Public.

Description

Simpler return value of HashTable::add/HashMap:add and others The current return value of HashTable::add() is a bool paired with an iterator object. The creation and destruction of that iterator object contributed to code size and since it was only used at a few places it was not worth it. Instead, let us return a bool paired with a pointer to the stored object. That is after all what the code using the iterator object wanted to have. I renamed the variable iterator -> storedValue which is 99% [magic number] of the patch. Most users of HashTable did not access iterator and did not have to change at all. This change saves roughly 100 KB binary size of an x64 content_shell built with clang. Other compilers, other architectures will save different amounts, most likely less since most are not 64 bit. The save is both in the instantiated ::add methods that don't have to create an iterator object, and in the callers that don't have to copy and destroy it. R=morrita@chromium.org RSR=eseidel@chromium.org

Patch Set 1 #

Patch Set 2 : Updated to a newer master #

Patch Set 3 : Mac compile fix. #

Patch Set 4 : Win and Mac compile fixes #

Patch Set 5 : Rebased to newer master #

Patch Set 6 : Daily master update #

Patch Set 7 : Daily master update #

Patch Set 8 : Daily master update #

Patch Set 9 : Daily master update #

Patch Set 10 : Daily master update (now with base url?) #

Unified diffs Side-by-side diffs Delta from patch set Stats (+242 lines, -199 lines) Patch
M Source/bindings/v8/DOMWrapperMap.h View 1 chunk +2 lines, -2 lines 0 comments Download
M Source/bindings/v8/DOMWrapperWorld.cpp View 1 2 3 4 5 2 chunks +2 lines, -2 lines 0 comments Download
M Source/bindings/v8/NPV8Object.cpp View 1 chunk +2 lines, -2 lines 0 comments Download
M Source/build/scripts/templates/StyleBuilderFunctions.cpp.tmpl View 2 chunks +2 lines, -2 lines 0 comments Download
M Source/core/animation/KeyframeEffectModel.cpp View 1 2 3 4 5 1 chunk +7 lines, -6 lines 0 comments Download
M Source/core/css/CSSFontFaceSource.cpp View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M Source/core/css/CSSSegmentedFontFace.cpp View 2 chunks +4 lines, -3 lines 0 comments Download
M Source/core/css/CSSValuePool.cpp View 1 2 3 4 5 6 7 8 3 chunks +4 lines, -4 lines 0 comments Download
M Source/core/css/FontFaceCache.cpp View 5 2 chunks +4 lines, -4 lines 0 comments Download
M Source/core/css/PropertySetCSSStyleDeclaration.cpp View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M Source/core/css/RuleFeature.cpp View 2 chunks +4 lines, -4 lines 0 comments Download
M Source/core/css/RuleSet.cpp View 1 2 3 4 5 6 2 chunks +2 lines, -2 lines 0 comments Download
M Source/core/css/StyleSheetContents.cpp View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M Source/core/css/resolver/MatchedPropertiesCache.cpp View 1 chunk +2 lines, -2 lines 0 comments Download
M Source/core/css/resolver/ScopedStyleTree.cpp View 1 chunk +3 lines, -3 lines 0 comments Download
M Source/core/css/resolver/StyleBuilderCustom.cpp View 1 2 3 4 5 6 7 8 9 1 chunk +2 lines, -2 lines 0 comments Download
M Source/core/dom/ChildListMutationScope.cpp View 1 chunk +2 lines, -2 lines 0 comments Download
M Source/core/dom/Document.cpp View 1 2 3 4 5 6 7 8 9 2 chunks +3 lines, -3 lines 0 comments Download
M Source/core/dom/DocumentMarkerController.cpp View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/dom/DocumentOrderedMap.cpp View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/dom/Element.cpp View 1 2 3 4 5 6 7 8 1 chunk +1 line, -1 line 0 comments Download
M Source/core/dom/ElementDataCache.cpp View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/dom/ExecutionContext.cpp View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/dom/IdTargetObserverRegistry.cpp View 1 chunk +2 lines, -2 lines 0 comments Download
M Source/core/dom/Node.cpp View 1 2 3 4 5 2 chunks +2 lines, -2 lines 0 comments Download
M Source/core/dom/NodeRareData.h View 1 2 3 4 5 6 7 8 3 chunks +6 lines, -6 lines 0 comments Download
M Source/core/dom/PresentationAttributeStyle.cpp View 3 chunks +8 lines, -8 lines 0 comments Download
M Source/core/dom/QualifiedName.cpp View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/dom/SpaceSplitString.cpp View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/dom/StyleEngine.cpp View 5 2 chunks +6 lines, -6 lines 0 comments Download
M Source/core/dom/custom/CustomElementScheduler.cpp View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/dom/custom/CustomElementUpgradeCandidateMap.cpp View 1 chunk +5 lines, -2 lines 0 comments Download
M Source/core/dom/shadow/ElementShadow.cpp View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/events/EventPath.cpp View 1 2 3 4 5 2 chunks +2 lines, -2 lines 0 comments Download
M Source/core/fetch/ResourceLoadPriorityOptimizer.cpp View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/html/HTMLCollection.cpp View 1 2 3 4 5 6 7 8 1 chunk +1 line, -1 line 0 comments Download
M Source/core/html/PublicURLManager.cpp View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/html/forms/CheckedRadioButtons.cpp View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/html/forms/FormController.cpp View 2 chunks +4 lines, -4 lines 0 comments Download
M Source/core/inspector/AsyncCallStackTracker.cpp View 1 chunk +8 lines, -4 lines 0 comments Download
M Source/core/inspector/DOMPatchSupport.cpp View 1 chunk +2 lines, -4 lines 0 comments Download
M Source/core/inspector/InspectorConsoleAgent.cpp View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/inspector/InspectorDOMAgent.cpp View 1 2 3 4 5 1 chunk +3 lines, -3 lines 0 comments Download
M Source/core/inspector/InspectorDebuggerAgent.cpp View 1 chunk +3 lines, -2 lines 0 comments Download
M Source/core/inspector/InspectorTimelineAgent.cpp View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -1 line 0 comments Download
M Source/core/inspector/TraceEventDispatcher.cpp View 1 chunk +3 lines, -2 lines 0 comments Download
M Source/core/page/EventHandler.cpp View 1 2 3 4 5 1 chunk +4 lines, -2 lines 0 comments Download
M Source/core/page/TouchDisambiguation.cpp View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/page/scrolling/ScrollingCoordinator.cpp View 1 2 3 4 5 4 chunks +9 lines, -5 lines 0 comments Download
M Source/core/rendering/FastTextAutosizer.cpp View 1 2 3 4 5 6 7 8 2 chunks +4 lines, -4 lines 0 comments Download
M Source/core/rendering/RenderBlockLineLayout.cpp View 1 2 3 4 5 6 7 8 9 1 chunk +2 lines, -2 lines 0 comments Download
M Source/core/rendering/RenderLayer.cpp View 1 2 3 4 5 6 7 8 1 chunk +5 lines, -3 lines 0 comments Download
M Source/core/rendering/RenderObject.cpp View 1 2 3 4 5 6 7 8 1 chunk +6 lines, -3 lines 0 comments Download
M Source/core/rendering/RenderRegion.cpp View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -1 line 0 comments Download
M Source/core/rendering/RenderView.cpp View 1 2 3 4 5 6 7 8 9 3 chunks +3 lines, -3 lines 0 comments Download
M Source/core/rendering/shapes/ShapeInfo.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/rendering/svg/RenderSVGResourceGradient.cpp View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/rendering/svg/RenderSVGResourcePattern.cpp View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/rendering/svg/SVGResourcesCache.cpp View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/svg/SVGDocumentExtensions.cpp View 1 chunk +2 lines, -2 lines 0 comments Download
M Source/core/svg/animation/SMILTimeContainer.cpp View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/svg/properties/SVGAttributeToPropertyMap.cpp View 1 chunk +3 lines, -3 lines 0 comments Download
M Source/core/xml/XMLHttpRequest.cpp View 1 chunk +1 line, -1 line 0 comments Download
M Source/modules/webdatabase/QuotaTracker.cpp View 1 chunk +1 line, -1 line 0 comments Download
M Source/modules/webdatabase/SQLTransactionCoordinator.cpp View 1 chunk +7 lines, -4 lines 0 comments Download
M Source/platform/exported/WebHTTPLoadInfo.cpp View 1 chunk +1 line, -1 line 0 comments Download
M Source/platform/fonts/WidthCache.h View 2 chunks +2 lines, -2 lines 0 comments Download
M Source/platform/fonts/harfbuzz/HarfBuzzFace.cpp View 1 chunk +4 lines, -4 lines 0 comments Download
M Source/platform/fonts/harfbuzz/HarfBuzzFaceSkia.cpp View 1 chunk +2 lines, -2 lines 0 comments Download
M Source/platform/fonts/mac/SimpleFontDataCoreText.cpp View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M Source/platform/fonts/mac/SimpleFontDataMac.mm View 1 2 3 4 5 6 7 8 2 chunks +2 lines, -2 lines 0 comments Download
M Source/platform/fonts/skia/SimpleFontDataSkia.cpp View 1 2 3 4 5 6 7 8 2 chunks +2 lines, -2 lines 0 comments Download
M Source/platform/fonts/win/UniscribeHelper.cpp View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M Source/platform/graphics/ImageDecodingStore.cpp View 1 chunk +1 line, -1 line 0 comments Download
M Source/platform/network/ResourceRequest.cpp View 1 chunk +1 line, -1 line 0 comments Download
M Source/platform/network/ResourceResponse.cpp View 1 chunk +1 line, -1 line 0 comments Download
M Source/platform/network/WebSocketHandshakeRequest.cpp View 1 chunk +1 line, -1 line 0 comments Download
M Source/platform/weborigin/SecurityPolicy.cpp View 1 chunk +2 lines, -2 lines 0 comments Download
M Source/wtf/HashCountedSet.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/wtf/HashMap.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/wtf/HashTable.h View 1 2 3 4 5 6 7 8 7 chunks +17 lines, -13 lines 0 comments Download
M Source/wtf/InstanceCounter.cpp View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M Source/wtf/ListHashSet.h View 1 2 5 chunks +26 lines, -10 lines 0 comments Download
M Source/wtf/RefPtrHashMap.h View 2 chunks +2 lines, -2 lines 0 comments Download
M Source/wtf/text/AtomicString.cpp View 2 chunks +2 lines, -2 lines 0 comments Download

Messages

Total messages: 12 (0 generated)
Daniel Bratell
This is the full patch that replaces the concept patch in https://codereview.chromium.org/152883002/ Eric and Erik, ...
6 years, 10 months ago (2014-02-10 11:02:22 UTC) #1
Daniel Bratell
eseidal, any opinion?
6 years, 10 months ago (2014-02-12 07:28:25 UTC) #2
Daniel Bratell
On 2014/02/12 07:28:25, Daniel Bratell wrote: > eseidal, any opinion? eseidel*
6 years, 10 months ago (2014-02-12 07:28:47 UTC) #3
Daniel Bratell
Anyone else with wtf ownership that can give their blessing. In the concept patch (see ...
6 years, 10 months ago (2014-02-13 16:25:46 UTC) #4
gmorrita
lgtm, given the what description says is promising.
6 years, 10 months ago (2014-02-13 18:38:53 UTC) #5
Daniel Bratell
Thanks! I don't know how big the improvement will be on an mobile device, but ...
6 years, 10 months ago (2014-02-13 20:17:42 UTC) #6
eseidel
OK. rslgtm.
6 years, 10 months ago (2014-02-13 21:37:41 UTC) #7
Daniel Bratell
The CQ bit was checked by bratell@opera.com
6 years, 10 months ago (2014-02-14 08:26:59 UTC) #8
Daniel Bratell
The CQ bit was unchecked by bratell@opera.com
6 years, 10 months ago (2014-02-14 15:46:33 UTC) #9
Daniel Bratell
The CQ bit was checked by bratell@opera.com
6 years, 10 months ago (2014-02-14 15:46:52 UTC) #10
Daniel Bratell
On 2014/02/14 15:46:52, Daniel Bratell wrote: > The CQ bit was checked by mailto:bratell@opera.com Missing ...
6 years, 10 months ago (2014-02-14 17:00:07 UTC) #11
Daniel Bratell
6 years, 10 months ago (2014-02-14 17:00:11 UTC) #12
On 2014/02/14 15:46:52, Daniel Bratell wrote:
> The CQ bit was checked by mailto:bratell@opera.com

Missing Base URL so CQ can't do anything which it does without saying anything.
Opened https://codereview.chromium.org/167123002/ for CQ but need the lgtm and
rslgtm copied there.

Powered by Google App Engine
This is Rietveld 408576698