summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/webkit/JavaScriptCore/runtime/RegExpConstructor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/3rdparty/webkit/JavaScriptCore/runtime/RegExpConstructor.cpp')
-rw-r--r--src/3rdparty/webkit/JavaScriptCore/runtime/RegExpConstructor.cpp46
1 files changed, 0 insertions, 46 deletions
diff --git a/src/3rdparty/webkit/JavaScriptCore/runtime/RegExpConstructor.cpp b/src/3rdparty/webkit/JavaScriptCore/runtime/RegExpConstructor.cpp
index dbf2d44ae2..c609e083a3 100644
--- a/src/3rdparty/webkit/JavaScriptCore/runtime/RegExpConstructor.cpp
+++ b/src/3rdparty/webkit/JavaScriptCore/runtime/RegExpConstructor.cpp
@@ -90,28 +90,6 @@ const ClassInfo RegExpConstructor::info = { "Function", &InternalFunction::info,
@end
*/
-struct RegExpConstructorPrivate : FastAllocBase {
- // Global search cache / settings
- RegExpConstructorPrivate()
- : lastNumSubPatterns(0)
- , multiline(false)
- , lastOvectorIndex(0)
- {
- }
-
- const Vector<int, 32>& lastOvector() const { return ovector[lastOvectorIndex]; }
- Vector<int, 32>& lastOvector() { return ovector[lastOvectorIndex]; }
- Vector<int, 32>& tempOvector() { return ovector[lastOvectorIndex ? 0 : 1]; }
- void changeLastOvector() { lastOvectorIndex = lastOvectorIndex ? 0 : 1; }
-
- UString input;
- UString lastInput;
- Vector<int, 32> ovector[2];
- unsigned lastNumSubPatterns : 30;
- bool multiline : 1;
- unsigned lastOvectorIndex : 1;
-};
-
RegExpConstructor::RegExpConstructor(ExecState* exec, NonNullPassRefPtr<Structure> structure, RegExpPrototype* regExpPrototype)
: InternalFunction(&exec->globalData(), structure, Identifier(exec, "RegExp"))
, d(new RegExpConstructorPrivate)
@@ -123,30 +101,6 @@ RegExpConstructor::RegExpConstructor(ExecState* exec, NonNullPassRefPtr<Structur
putDirectWithoutTransition(exec->propertyNames().length, jsNumber(exec, 2), ReadOnly | DontDelete | DontEnum);
}
-/*
- To facilitate result caching, exec(), test(), match(), search(), and replace() dipatch regular
- expression matching through the performMatch function. We use cached results to calculate,
- e.g., RegExp.lastMatch and RegExp.leftParen.
-*/
-void RegExpConstructor::performMatch(RegExp* r, const UString& s, int startOffset, int& position, int& length, int** ovector)
-{
- position = r->match(s, startOffset, &d->tempOvector());
-
- if (ovector)
- *ovector = d->tempOvector().data();
-
- if (position != -1) {
- ASSERT(!d->tempOvector().isEmpty());
-
- length = d->tempOvector()[1] - d->tempOvector()[0];
-
- d->input = s;
- d->lastInput = s;
- d->changeLastOvector();
- d->lastNumSubPatterns = r->numSubpatterns();
- }
-}
-
RegExpMatchesArray::RegExpMatchesArray(ExecState* exec, RegExpConstructorPrivate* data)
: JSArray(exec->lexicalGlobalObject()->regExpMatchesArrayStructure(), data->lastNumSubPatterns + 1)
{