Ignore:
Timestamp:
Dec 7, 2008, 3:55:04 PM (16 years ago)
Author:
[email protected]
Message:

<rdar://problem/6309878> Need more granular control over allocation of executable memory (21783)
<https://bugs.webkit.org/show_bug.cgi?id=21783>

Reviewed by Cameron Zwarich and Sam Weinig

Add a new allocator for use by the JIT that provides executable pages, so
we can get rid of the current hack that makes the entire heap executable.

1-2% progression on SunSpider-v8, 1% on SunSpider. Reduces memory usage as well!

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/runtime/RegExp.cpp

    r38975 r39083  
    3838#endif
    3939
    40 inline RegExp::RegExp(const UString& pattern)
     40inline RegExp::RegExp(JSGlobalData* globalData, const UString& pattern)
    4141    : m_pattern(pattern)
    4242    , m_flagBits(0)
     
    4646{
    4747#if ENABLE(WREC)
    48     m_wrecFunction = Generator::compileRegExp(pattern, &m_numSubpatterns, &m_constructionError);
     48    m_wrecFunction = Generator::compileRegExp(globalData, pattern, &m_numSubpatterns, &m_constructionError, m_executablePool);
    4949    if (m_wrecFunction)
    5050        return;
     
    5555}
    5656
    57 PassRefPtr<RegExp> RegExp::create(const UString& pattern)
     57PassRefPtr<RegExp> RegExp::create(JSGlobalData* globalData, const UString& pattern)
    5858{
    59     return adoptRef(new RegExp(pattern));
     59    return adoptRef(new RegExp(globalData, pattern));
    6060}
    6161
    62 inline RegExp::RegExp(const UString& pattern, const UString& flags)
     62inline RegExp::RegExp(JSGlobalData* globalData, const UString& pattern, const UString& flags)
    6363    : m_pattern(pattern)
    6464    , m_flags(flags)
     
    8787
    8888#if ENABLE(WREC)
    89     m_wrecFunction = Generator::compileRegExp(pattern, &m_numSubpatterns, &m_constructionError, (m_flagBits & IgnoreCase), (m_flagBits & Multiline));
     89    m_wrecFunction = Generator::compileRegExp(globalData, pattern, &m_numSubpatterns, &m_constructionError, m_executablePool, (m_flagBits & IgnoreCase), (m_flagBits & Multiline));
    9090    if (m_wrecFunction)
    9191        return;
     
    9696}
    9797
    98 PassRefPtr<RegExp> RegExp::create(const UString& pattern, const UString& flags)
     98PassRefPtr<RegExp> RegExp::create(JSGlobalData* globalData, const UString& pattern, const UString& flags)
    9999{
    100     return adoptRef(new RegExp(pattern, flags));
     100    return adoptRef(new RegExp(globalData, pattern, flags));
    101101}
    102102
     
    104104{
    105105    jsRegExpFree(m_regExp);
    106 #if ENABLE(WREC)
    107     if (m_wrecFunction)
    108         WTF::fastFreeExecutable(reinterpret_cast<void*>(m_wrecFunction));
    109 #endif
    110106}
    111107
Note: See TracChangeset for help on using the changeset viewer.