Ignore:
Timestamp:
Jul 27, 2010, 12:14:40 PM (15 years ago)
Author:
[email protected]
Message:

Bug 42621 - Add a bump allocator for the YARR interpreter

Reviewed by Oliver Hunt.

The regex engine requires lifo allocation, however currently uses the general purpose
malloc/free memory allocation. A simple bump pointer allocator should provide a lower
overhead allocation solution.

JavaScriptCore:

When using YARR interpreter, 15% progression on v8-regex.

  • JavaScriptCore.xcodeproj/project.pbxproj:
  • runtime/JSGlobalData.h:
  • runtime/RegExp.cpp:

(JSC::RegExp::compile):

  • wtf/BumpPointerAllocator.h: Added.

(WTF::BumpPointerPool::ensureCapacity):
(WTF::BumpPointerPool::alloc):
(WTF::BumpPointerPool::dealloc):
(WTF::BumpPointerPool::operator new):
(WTF::BumpPointerPool::BumpPointerPool):
(WTF::BumpPointerPool::create):
(WTF::BumpPointerPool::shrink):
(WTF::BumpPointerPool::destroy):
(WTF::BumpPointerPool::ensureCapacityCrossPool):
(WTF::BumpPointerPool::deallocCrossPool):
(WTF::BumpPointerAllocator::BumpPointerAllocator):
(WTF::BumpPointerAllocator::~BumpPointerAllocator):
(WTF::BumpPointerAllocator::startAllocator):
(WTF::BumpPointerAllocator::stopAllocator):

  • yarr/RegexInterpreter.cpp:

(JSC::Yarr::Interpreter::allocDisjunctionContext):
(JSC::Yarr::Interpreter::freeDisjunctionContext):
(JSC::Yarr::Interpreter::allocParenthesesDisjunctionContext):
(JSC::Yarr::Interpreter::freeParenthesesDisjunctionContext):
(JSC::Yarr::Interpreter::interpret):
(JSC::Yarr::Interpreter::Interpreter):
(JSC::Yarr::ByteCompiler::compile):
(JSC::Yarr::byteCompileRegex):

  • yarr/RegexInterpreter.h:

(JSC::Yarr::BytecodePattern::BytecodePattern):

JavaScriptGlue:

  • ForwardingHeaders/wtf/BumpPointerAllocator.h: Added.

WebCore:

  • ForwardingHeaders/wtf/BumpPointerAllocator.h: Added.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj

    r64105 r64146  
    205205                86565743115BE3DA00291F40 /* CString.h in Headers */ = {isa = PBXBuildFile; fileRef = 86565741115BE3DA00291F40 /* CString.h */; settings = {ATTRIBUTES = (Private, ); }; };
    206206                865F408810E7D56300947361 /* APIShims.h in Headers */ = {isa = PBXBuildFile; fileRef = 865F408710E7D56300947361 /* APIShims.h */; };
     207                86676D5211FED9BC004B6863 /* BumpPointerAllocator.h in Headers */ = {isa = PBXBuildFile; fileRef = 86676D4D11FED55D004B6863 /* BumpPointerAllocator.h */; settings = {ATTRIBUTES = (Private, ); }; };
    207208                868BFA08117CEFD100B908B1 /* AtomicString.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 868BFA00117CEFD100B908B1 /* AtomicString.cpp */; };
    208209                868BFA09117CEFD100B908B1 /* AtomicString.h in Headers */ = {isa = PBXBuildFile; fileRef = 868BFA01117CEFD100B908B1 /* AtomicString.h */; settings = {ATTRIBUTES = (Private, ); }; };
     
    775776                86565741115BE3DA00291F40 /* CString.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CString.h; path = text/CString.h; sourceTree = "<group>"; };
    776777                865F408710E7D56300947361 /* APIShims.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APIShims.h; sourceTree = "<group>"; };
     778                86676D4D11FED55D004B6863 /* BumpPointerAllocator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BumpPointerAllocator.h; sourceTree = "<group>"; };
    777779                867FC35F11B763950025105E /* JavaScriptCore.JSVALUE32_64only.exp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.exports; path = JavaScriptCore.JSVALUE32_64only.exp; sourceTree = "<group>"; };
    778780                867FC36011B763950025105E /* JavaScriptCore.JSVALUE32only.exp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.exports; path = JavaScriptCore.JSVALUE32only.exp; sourceTree = "<group>"; };
     
    14051407                                BC5F7BBB11823B590052C02C /* Atomics.h */,
    14061408                                E1A596370DE3E1C300C17E37 /* AVLTree.h */,
     1409                                86676D4D11FED55D004B6863 /* BumpPointerAllocator.h */,
    14071410                                A7A1F7AA0F252B3C00E184E2 /* ByteArray.cpp */,
    14081411                                A7A1F7AB0F252B3C00E184E2 /* ByteArray.h */,
     
    19221925                                147B83AC0E6DB8C9004775A4 /* BatchedTransitionOptimizer.h in Headers */,
    19231926                                BC18C3EC0E16F5CD00B34460 /* BooleanObject.h in Headers */,
     1927                                86676D5211FED9BC004B6863 /* BumpPointerAllocator.h in Headers */,
    19241928                                A7A1F7AD0F252B3C00E184E2 /* ByteArray.h in Headers */,
    19251929                                969A07230ED1CE3300F1F681 /* BytecodeGenerator.h in Headers */,
     
    20842088                                BC18C44A0E16F5CD00B34460 /* OwnPtr.h in Headers */,
    20852089                                4409D8470FAF80A200523B87 /* OwnPtrCommon.h in Headers */,
     2090                                8627E5EC11F1281900A313B5 /* PageAllocation.h in Headers */,
    20862091                                BC18C44B0E16F5CD00B34460 /* Parser.h in Headers */,
    20872092                                93052C350FB792190048FDC3 /* ParserArena.h in Headers */,
     
    21892194                                86D08D5411793613006E5ED0 /* WTFThreadData.h in Headers */,
    21902195                                9688CB160ED12B4E001D649F /* X86Assembler.h in Headers */,
    2191                                 8627E5EC11F1281900A313B5 /* PageAllocation.h in Headers */,
    21922196                        );
    21932197                        runOnlyForDeploymentPostprocessing = 0;
Note: See TracChangeset for help on using the changeset viewer.