Changeset 38975 in webkit for trunk/JavaScriptCore/runtime


Ignore:
Timestamp:
Dec 3, 2008, 4:10:53 PM (16 years ago)
Author:
[email protected]
Message:

2008-12-03 Sam Weinig <[email protected]>

Reviewed by Geoffrey Garen.

Remove shared AssemblerBuffer 1MB buffer and instead give AssemblerBuffer
an 256 byte inline capacity.

1% progression on Sunspider.

  • assembler/AssemblerBuffer.h: (JSC::AssemblerBuffer::AssemblerBuffer): (JSC::AssemblerBuffer::~AssemblerBuffer): (JSC::AssemblerBuffer::grow):
  • assembler/MacroAssembler.h: (JSC::MacroAssembler::MacroAssembler):
  • assembler/X86Assembler.h: (JSC::X86Assembler::X86Assembler):
  • interpreter/Interpreter.cpp: (JSC::Interpreter::Interpreter):
  • interpreter/Interpreter.h:
  • jit/JIT.cpp: (JSC::JIT::JIT):
  • parser/Nodes.cpp: (JSC::RegExpNode::emitBytecode):
  • runtime/RegExp.cpp: (JSC::RegExp::RegExp): (JSC::RegExp::create):
  • runtime/RegExp.h:
  • runtime/RegExpConstructor.cpp: (JSC::constructRegExp):
  • runtime/RegExpPrototype.cpp: (JSC::regExpProtoFuncCompile):
  • runtime/StringPrototype.cpp: (JSC::stringProtoFuncMatch): (JSC::stringProtoFuncSearch):
  • wrec/WREC.cpp: (JSC::WREC::Generator::compileRegExp):
  • wrec/WRECGenerator.h: (JSC::WREC::Generator::Generator):
  • wrec/WRECParser.h: (JSC::WREC::Parser::Parser):
Location:
trunk/JavaScriptCore/runtime
Files:
5 edited

Legend:

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

    r38839 r38975  
    3838#endif
    3939
    40 inline RegExp::RegExp(JSGlobalData* globalData, const UString& pattern)
     40inline RegExp::RegExp(const UString& pattern)
    4141    : m_pattern(pattern)
    4242    , m_flagBits(0)
     
    4646{
    4747#if ENABLE(WREC)
    48     m_wrecFunction = Generator::compileRegExp(globalData->interpreter, pattern, &m_numSubpatterns, &m_constructionError);
     48    m_wrecFunction = Generator::compileRegExp(pattern, &m_numSubpatterns, &m_constructionError);
    4949    if (m_wrecFunction)
    5050        return;
    5151    // Fall through to non-WREC case.
    52 #else
    53     UNUSED_PARAM(globalData);
    5452#endif
    5553    m_regExp = jsRegExpCompile(reinterpret_cast<const UChar*>(pattern.data()), pattern.size(),
     
    5755}
    5856
    59 PassRefPtr<RegExp> RegExp::create(JSGlobalData* globalData, const UString& pattern)
     57PassRefPtr<RegExp> RegExp::create(const UString& pattern)
    6058{
    61     return adoptRef(new RegExp(globalData, pattern));
     59    return adoptRef(new RegExp(pattern));
    6260}
    6361
    64 inline RegExp::RegExp(JSGlobalData* globalData, const UString& pattern, const UString& flags)
     62inline RegExp::RegExp(const UString& pattern, const UString& flags)
    6563    : m_pattern(pattern)
    6664    , m_flags(flags)
     
    8987
    9088#if ENABLE(WREC)
    91     m_wrecFunction = Generator::compileRegExp(globalData->interpreter, pattern, &m_numSubpatterns, &m_constructionError, (m_flagBits & IgnoreCase), (m_flagBits & Multiline));
     89    m_wrecFunction = Generator::compileRegExp(pattern, &m_numSubpatterns, &m_constructionError, (m_flagBits & IgnoreCase), (m_flagBits & Multiline));
    9290    if (m_wrecFunction)
    9391        return;
    9492    // Fall through to non-WREC case.
    95 #else
    96     UNUSED_PARAM(globalData);
    9793#endif
    9894    m_regExp = jsRegExpCompile(reinterpret_cast<const UChar*>(pattern.data()), pattern.size(),
     
    10096}
    10197
    102 PassRefPtr<RegExp> RegExp::create(JSGlobalData* globalData, const UString& pattern, const UString& flags)
     98PassRefPtr<RegExp> RegExp::create(const UString& pattern, const UString& flags)
    10399{
    104     return adoptRef(new RegExp(globalData, pattern, flags));
     100    return adoptRef(new RegExp(pattern, flags));
    105101}
    106102
  • trunk/JavaScriptCore/runtime/RegExp.h

    r38603 r38975  
    3535    class RegExp : public RefCounted<RegExp> {
    3636    public:
    37         static PassRefPtr<RegExp> create(JSGlobalData*, const UString& pattern);
    38         static PassRefPtr<RegExp> create(JSGlobalData*, const UString& pattern, const UString& flags);
     37        static PassRefPtr<RegExp> create(const UString& pattern);
     38        static PassRefPtr<RegExp> create(const UString& pattern, const UString& flags);
    3939        ~RegExp();
    4040
     
    5353
    5454    private:
    55         RegExp(JSGlobalData*, const UString& pattern);
    56         RegExp(JSGlobalData*, const UString& pattern, const UString& flags);
     55        RegExp(const UString& pattern);
     56        RegExp(const UString& pattern, const UString& flags);
    5757
    5858        void compile();
  • trunk/JavaScriptCore/runtime/RegExpConstructor.cpp

    r38440 r38975  
    332332    UString flags = arg1->isUndefined() ? UString("") : arg1->toString(exec);
    333333
    334     RefPtr<RegExp> regExp = RegExp::create(&exec->globalData(), pattern, flags);
     334    RefPtr<RegExp> regExp = RegExp::create(pattern, flags);
    335335    if (!regExp->isValid())
    336336        return throwError(exec, SyntaxError, UString("Invalid regular expression: ").append(regExp->errorMessage()));
  • trunk/JavaScriptCore/runtime/RegExpPrototype.cpp

    r38440 r38975  
    8686        UString pattern = args.isEmpty() ? UString("") : arg0->toString(exec);
    8787        UString flags = arg1->isUndefined() ? UString("") : arg1->toString(exec);
    88         regExp = RegExp::create(&exec->globalData(), pattern, flags);
     88        regExp = RegExp::create(pattern, flags);
    8989    }
    9090
  • trunk/JavaScriptCore/runtime/StringPrototype.cpp

    r38603 r38975  
    413413         *  replaced with the result of the expression new RegExp(regexp).
    414414         */
    415         reg = RegExp::create(&exec->globalData(), a0->toString(exec));
     415        reg = RegExp::create(a0->toString(exec));
    416416    }
    417417    RegExpConstructor* regExpConstructor = exec->lexicalGlobalObject()->regExpConstructor();
     
    463463         *  replaced with the result of the expression new RegExp(regexp).
    464464         */
    465         reg = RegExp::create(&exec->globalData(), a0->toString(exec));
     465        reg = RegExp::create(a0->toString(exec));
    466466    }
    467467    RegExpConstructor* regExpConstructor = exec->lexicalGlobalObject()->regExpConstructor();
Note: See TracChangeset for help on using the changeset viewer.