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/runtime/RegExp.cpp

    r62405 r64146  
    8686    Yarr::jitCompileRegex(globalData, m_regExpJITCode, m_pattern, m_numSubpatterns, m_constructionError, ignoreCase(), multiline());
    8787#else
    88     UNUSED_PARAM(globalData);
    89     m_regExpBytecode.set(Yarr::byteCompileRegex(m_pattern, m_numSubpatterns, m_constructionError, ignoreCase(), multiline()));
     88    m_regExpBytecode = Yarr::byteCompileRegex(m_pattern, m_numSubpatterns, m_constructionError, &globalData->m_regexAllocator, ignoreCase(), multiline());
    9089#endif
    9190}
Note: See TracChangeset for help on using the changeset viewer.