1. 23 Aug, 2013 2 commits
    • oliver@apple.com's avatar
      Add more validation logic to CompressibleVector · 91823a4a
      oliver@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=120227
      
      Reviewed by Brent Fulgham.
      
      Add a pile of assertions to try on catch whatever is going wrong
      in the windows environment or other platforms.
      
      * wtf/Compression.cpp:
      (WTF::GenericCompressedData::create):
      (WTF::GenericCompressedData::decompress):
      * wtf/Compression.h:
      (WTF::CompressedVector::decompress):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154516 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      91823a4a
    • oliver@apple.com's avatar
      Support in memory compression of rarely used data · abcf78c4
      oliver@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=120143
      
      Reviewed by Gavin Barraclough.
      
      Source/JavaScriptCore:
      
      Include zlib in LD_FLAGS and make UnlinkedCodeBlock make use of CompressibleVector.  This saves ~200k on google maps.
      
      * Configurations/JavaScriptCore.xcconfig:
      * bytecode/UnlinkedCodeBlock.cpp:
      (JSC::UnlinkedCodeBlock::expressionRangeForBytecodeOffset):
      (JSC::UnlinkedCodeBlock::addExpressionInfo):
      * bytecode/UnlinkedCodeBlock.h:
      
      Source/WTF:
      
      Adds a set of utility functions to wrap the use of zlib over a generic
      type or a Vector<> as well as adding CompressibleVector that wraps
      either a Vector<> or compressed data.
      
      * GNUmakefile.list.am:
      * WTF.pro:
      * WTF.vcxproj/WTF.vcxproj:
      * WTF.xcodeproj/project.pbxproj:
      * wtf/CMakeLists.txt:
      * wtf/CheckedArithmetic.h:
      * wtf/Compression.cpp: Added.
      (WTF::zAlloc):
      (WTF::zFree):
      (WTF::GenericCompressedData::create):
      (WTF::GenericCompressedData::decompress):
      * wtf/Compression.h: Added.
      (WTF::GenericCompressedData::compressedSize):
      (WTF::GenericCompressedData::originalSize):
      (WTF::GenericCompressedData::GenericCompressedData):
      (WTF::CompressedVector::create):
      (WTF::CompressedVector::decompress):
      (WTF::CompressedVector::size):
      (WTF::CompressibleVector::CompressibleVector):
      (WTF::CompressibleVector::shrinkToFit):
      (WTF::CompressibleVector::size):
      (WTF::CompressibleVector::operator[]):
      (WTF::CompressibleVector::at):
      (WTF::CompressibleVector::begin):
      (WTF::CompressibleVector::end):
      (WTF::CompressibleVector::data):
      (WTF::CompressibleVector::decompressIfNecessary):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154498 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      abcf78c4