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

Issue 167123002: Simpler return value from HashTable::add()/HashMap::add() and others (Closed)

Created:
6 years, 10 months ago by Daniel Bratell
Modified:
6 years, 10 months ago
Reviewers:
Hajime Morrita, eseidel
CC:
blink-reviews, shans, jamesr, webcomponents-bugzilla_chromium.org, eae+blinkwatch, fs, yurys+blink_chromium.org, apavlov+blink_chromium.org, adamk+blink_chromium.org, 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, mstensho+blink_opera.com, 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, Mikhail
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
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 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=167217

Patch Set 1 #

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

Messages

Total messages: 7 (0 generated)
Daniel Bratell
morrita, eseidel, can you please mark this again as lgtm and rslgtm because https://codereview.chromium.org/138643003/ was ...
6 years, 10 months ago (2014-02-14 16:47:07 UTC) #1
Daniel Bratell
The CQ bit was checked by bratell@opera.com
6 years, 10 months ago (2014-02-14 17:08:26 UTC) #2
Daniel Bratell
The CQ bit was unchecked by bratell@opera.com
6 years, 10 months ago (2014-02-14 17:08:29 UTC) #3
eseidel
lgtm
6 years, 10 months ago (2014-02-14 17:10:04 UTC) #4
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/bratell@opera.com/167123002/1
6 years, 10 months ago (2014-02-14 17:10:33 UTC) #5
commit-bot: I haz the power
Change committed as 167217
6 years, 10 months ago (2014-02-14 19:19:10 UTC) #6
Daniel Bratell
6 years, 10 months ago (2014-02-18 08:12:06 UTC) #7
Message was sent while issue was closed.
On 2014/02/14 19:19:10, I haz the power (commit-bot) wrote:
> Change committed as 167217

I tried to verify the change but unfortunately this ended up in a huge blink
roll of over a hundred changes.

That blink roll reduced binary size by 33 KB for Mac, 9 KB for Windows and 59 KB
in Linux. From that I can only say that it seems like the patch might have
worked and I won't spend any more time thinking about it.

Powered by Google App Engine
This is Rietveld 408576698