Ignore:
Timestamp:
Oct 8, 2009, 8:22:41 PM (16 years ago)
Author:
[email protected]
Message:

At long last, I pronounce the death of AllInOneFile.cpp.

Patch by Geoffrey Garen <[email protected]> on 2009-10-08
Reviewed by Maciej Stachowiak.

SunSpider reports a 1.01x speedup.

to compilation stages.

  • parser/Grammar.y:
  • parser/Lexer.cpp:
  • parser/Lexer.h:

(JSC::jscyylex):

  • runtime/ArrayConstructor.cpp:

(JSC::constructArrayWithSizeQuirk):

  • runtime/Collector.h:
  • runtime/JSCell.cpp:

(JSC::JSCell::operator new):

  • runtime/JSCell.h:

(JSC::JSCell::operator new):

  • runtime/JSGlobalObject.cpp:

(JSC::JSGlobalObject::operator new):

  • runtime/JSNumberCell.h:

(JSC::JSNumberCell::operator new):

  • runtime/JSString.cpp:
  • runtime/JSString.h:

(JSC::jsString):
(JSC::jsSubstring):
(JSC::jsOwnedString):

  • runtime/RegExpConstructor.cpp:
  • runtime/RegExpConstructor.h:

(JSC::RegExpConstructorPrivate::RegExpConstructorPrivate):
(JSC::RegExpConstructorPrivate::lastOvector):
(JSC::RegExpConstructorPrivate::tempOvector):
(JSC::RegExpConstructorPrivate::changeLastOvector):
(JSC::RegExpConstructor::performMatch):

  • runtime/StringPrototype.cpp:

(JSC::stringProtoFuncMatch):

  • yarr/RegexJIT.cpp:
  • yarr/RegexJIT.h:

(JSC::Yarr::executeRegex): Inlined a few things that Shark said
were hot, on the presumption that AllInOneFile.cpp used to inline them
automatically.

File:
1 edited

Legend:

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

    r48836 r49365  
    9191*/
    9292
    93 struct RegExpConstructorPrivate : FastAllocBase {
    94     // Global search cache / settings
    95     RegExpConstructorPrivate()
    96         : lastNumSubPatterns(0)
    97         , multiline(false)
    98         , lastOvectorIndex(0)
    99     {
    100     }
    101 
    102     const Vector<int, 32>& lastOvector() const { return ovector[lastOvectorIndex]; }
    103     Vector<int, 32>& lastOvector() { return ovector[lastOvectorIndex]; }
    104     Vector<int, 32>& tempOvector() { return ovector[lastOvectorIndex ? 0 : 1]; }
    105     void changeLastOvector() { lastOvectorIndex = lastOvectorIndex ? 0 : 1; }
    106 
    107     UString input;
    108     UString lastInput;
    109     Vector<int, 32> ovector[2];
    110     unsigned lastNumSubPatterns : 30;
    111     bool multiline : 1;
    112     unsigned lastOvectorIndex : 1;
    113 };
    114 
    11593RegExpConstructor::RegExpConstructor(ExecState* exec, NonNullPassRefPtr<Structure> structure, RegExpPrototype* regExpPrototype)
    11694    : InternalFunction(&exec->globalData(), structure, Identifier(exec, "RegExp"))
     
    122100    // no. of arguments for constructor
    123101    putDirectWithoutTransition(exec->propertyNames().length, jsNumber(exec, 2), ReadOnly | DontDelete | DontEnum);
    124 }
    125 
    126 /*
    127   To facilitate result caching, exec(), test(), match(), search(), and replace() dipatch regular
    128   expression matching through the performMatch function. We use cached results to calculate,
    129   e.g., RegExp.lastMatch and RegExp.leftParen.
    130 */
    131 void RegExpConstructor::performMatch(RegExp* r, const UString& s, int startOffset, int& position, int& length, int** ovector)
    132 {
    133     position = r->match(s, startOffset, &d->tempOvector());
    134 
    135     if (ovector)
    136         *ovector = d->tempOvector().data();
    137 
    138     if (position != -1) {
    139         ASSERT(!d->tempOvector().isEmpty());
    140 
    141         length = d->tempOvector()[1] - d->tempOvector()[0];
    142 
    143         d->input = s;
    144         d->lastInput = s;
    145         d->changeLastOvector();
    146         d->lastNumSubPatterns = r->numSubpatterns();
    147     }
    148102}
    149103
Note: See TracChangeset for help on using the changeset viewer.