Ignore:
Timestamp:
Jul 20, 2017, 2:06:12 PM (8 years ago)
Author:
Chris Dumez
Message:

Replace calls to Vector::resize() with calls to more efficient shrink() / grow() when applicable
https://bugs.webkit.org/show_bug.cgi?id=174660

Reviewed by Geoffrey Garen.

Replace calls to Vector::resize() with calls to more efficient shrink() / grow() when applicable.
This essentially replaces a branch to figure out if the new size is less or greater than the
current size by an assertion.

Source/bmalloc:

  • bmalloc/Map.h:

(bmalloc::Hash>::rehash):

Source/JavaScriptCore:

  • b3/B3BasicBlockUtils.h:

(JSC::B3::clearPredecessors):

  • b3/B3InferSwitches.cpp:
  • b3/B3LowerToAir.cpp:

(JSC::B3::Air::LowerToAir::finishAppendingInstructions):

  • b3/B3ReduceStrength.cpp:
  • b3/B3SparseCollection.h:

(JSC::B3::SparseCollection::packIndices):

  • b3/B3UseCounts.cpp:

(JSC::B3::UseCounts::UseCounts):

  • b3/air/AirAllocateRegistersAndStackByLinearScan.cpp:
  • b3/air/AirEmitShuffle.cpp:

(JSC::B3::Air::emitShuffle):

  • b3/air/AirLowerAfterRegAlloc.cpp:

(JSC::B3::Air::lowerAfterRegAlloc):

  • b3/air/AirOptimizeBlockOrder.cpp:

(JSC::B3::Air::optimizeBlockOrder):

  • bytecode/Operands.h:

(JSC::Operands::ensureLocals):

  • bytecode/PreciseJumpTargets.cpp:

(JSC::computePreciseJumpTargetsInternal):

  • dfg/DFGBlockInsertionSet.cpp:

(JSC::DFG::BlockInsertionSet::execute):

  • dfg/DFGBlockMapInlines.h:

(JSC::DFG::BlockMap<T>::BlockMap):

  • dfg/DFGByteCodeParser.cpp:

(JSC::DFG::ByteCodeParser::processSetLocalQueue):
(JSC::DFG::ByteCodeParser::clearCaches):

  • dfg/DFGDisassembler.cpp:

(JSC::DFG::Disassembler::Disassembler):

  • dfg/DFGFlowIndexing.cpp:

(JSC::DFG::FlowIndexing::recompute):

  • dfg/DFGGraph.cpp:

(JSC::DFG::Graph::registerFrozenValues):

  • dfg/DFGInPlaceAbstractState.cpp:

(JSC::DFG::setLiveValues):

  • dfg/DFGLICMPhase.cpp:

(JSC::DFG::LICMPhase::run):

  • dfg/DFGLivenessAnalysisPhase.cpp:
  • dfg/DFGNaturalLoops.cpp:

(JSC::DFG::NaturalLoops::NaturalLoops):

  • dfg/DFGStoreBarrierClusteringPhase.cpp:
  • ftl/FTLLowerDFGToB3.cpp:

(JSC::FTL::DFG::LowerDFGToB3::compileNode):

  • heap/CodeBlockSet.cpp:

(JSC::CodeBlockSet::deleteUnmarkedAndUnreferenced):

  • heap/MarkedSpace.cpp:

(JSC::MarkedSpace::sweepLargeAllocations):

  • inspector/ContentSearchUtilities.cpp:

(Inspector::ContentSearchUtilities::findMagicComment):

  • interpreter/ShadowChicken.cpp:

(JSC::ShadowChicken::update):

  • parser/ASTBuilder.h:

(JSC::ASTBuilder::shrinkOperandStackBy):

  • parser/Lexer.h:

(JSC::Lexer::setOffset):

  • runtime/RegExpInlines.h:

(JSC::RegExp::matchInline):

  • runtime/RegExpPrototype.cpp:

(JSC::genericSplit):

  • yarr/RegularExpression.cpp:

(JSC::Yarr::RegularExpression::match):

Source/WebCore:

  • Modules/gamepad/Gamepad.cpp:

(WebCore::Gamepad::Gamepad):

  • Modules/webaudio/AudioContext.cpp:

(WebCore::AudioContext::addReaction):

  • Modules/websockets/WebSocketChannel.cpp:

(WebCore::WebSocketChannel::skipBuffer):

  • Modules/websockets/WebSocketDeflater.cpp:

(WebCore::WebSocketDeflater::finish):

  • contentextensions/ContentExtensionCompiler.cpp:

(WebCore::ContentExtensions::serializeSelector):

  • contentextensions/DFABytecodeCompiler.cpp:

(WebCore::ContentExtensions::append):

  • crypto/gcrypt/CryptoAlgorithmAES_CBCGCrypt.cpp:

(WebCore::gcryptEncrypt):
(WebCore::gcryptDecrypt):

  • crypto/gcrypt/CryptoAlgorithmECDHGCrypt.cpp:

(WebCore::gcryptDerive):

  • platform/gamepad/cocoa/GameControllerGamepadProvider.mm:

(WebCore::GameControllerGamepadProvider::controllerDidConnect):

  • platform/gamepad/mac/HIDGamepadProvider.cpp:

(WebCore::HIDGamepadProvider::deviceAdded):

  • platform/graphics/ImageBackingStore.h:

(WebCore::ImageBackingStore::setSize):

  • platform/graphics/WOFFFileFormat.cpp:
  • platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.cpp:

(WebCore::InbandMetadataTextTrackPrivateAVF::updatePendingCueEndTimes):
(WebCore::InbandMetadataTextTrackPrivateAVF::flushPartialCues):

  • platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp:

(WebCore::InbandTextTrackPrivateAVF::resetCueValues):
(WebCore::InbandTextTrackPrivateAVF::readNativeSampleBuffer):

  • platform/graphics/avfoundation/cf/InbandTextTrackPrivateAVCF.cpp:

(WebCore::InbandTextTrackPrivateAVCF::readNativeSampleBuffer):

  • platform/graphics/cg/ImageBufferCG.cpp:

(WebCore::cfData):

  • platform/image-decoders/bmp/BMPImageDecoder.cpp:

(WebCore::BMPImageDecoder::frameBufferAtIndex):

  • platform/image-decoders/ico/ICOImageDecoder.cpp:

(WebCore::ICOImageDecoder::decode):

  • platform/image-decoders/jpeg/JPEGImageDecoder.cpp:

(WebCore::JPEGImageDecoder::frameBufferAtIndex):

  • platform/image-decoders/png/PNGImageDecoder.cpp:

(WebCore::PNGImageDecoder::frameBufferAtIndex):
(WebCore::PNGImageDecoder::readChunks):

  • platform/image-decoders/webp/WEBPImageDecoder.cpp:

(WebCore::WEBPImageDecoder::frameBufferAtIndex):

  • platform/image-encoders/JPEGImageEncoder.cpp:

(WebCore::compressRGBABigEndianToJPEG):

  • platform/text/DecodeEscapeSequences.h:

(WebCore::URLEscapeSequence::decodeRun):

  • platform/text/SuffixTree.h:

(WebCore::SuffixTree::Node::Node):

  • rendering/Grid.cpp:

(WebCore::Grid::setNeedsItemsPlacement):

  • rendering/RenderTable.cpp:

(WebCore::RenderTable::invalidateCachedColumns):

Source/WebKit:

  • Platform/IPC/ArgumentCoders.h:
  • UIProcess/Gamepad/UIGamepadProvider.cpp:

(WebKit::UIGamepadProvider::platformGamepadConnected):

  • UIProcess/WebProcessPool.cpp:

(WebKit::WebProcessPool::setInitialConnectedGamepads):

  • WebProcess/Network/WebLoaderStrategy.cpp:

(WebKit::WebLoaderStrategy::loadResourceSynchronously):

  • WebProcess/WebCoreSupport/WebPasteboardOverrides.cpp:

(WebKit::WebPasteboardOverrides::getDataForOverride):

  • WebProcess/WebPage/ios/WebPageIOS.mm:

(WebKit::WebPage::requestAutocorrectionData):

Source/WebKitLegacy/mac:

  • Plugins/WebNetscapePluginView.mm:

(-[WebNetscapePluginView saveAndSetNewPortStateForUpdate:]):

Source/WTF:

  • wtf/IndexSparseSet.h:

(WTF::OverflowHandler>::IndexSparseSet):
(WTF::OverflowHandler>::clear):

  • wtf/Insertion.h:

(WTF::executeInsertions):

  • wtf/RangeSet.h:

(WTF::RangeSet::compact):

  • wtf/Vector.h:

(WTF::removeRepeatedElements):

  • wtf/persistence/Coders.h:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/dfg/DFGLICMPhase.cpp

    r210023 r219702  
    196196                continue;
    197197           
    198             loopStack.resize(0);
     198            loopStack.shrink(0);
    199199            for (
    200200                const NaturalLoop* current = loop;
Note: See TracChangeset for help on using the changeset viewer.