2010-12-13 Peter Varga <pvarga@inf.u-szeged.hu>
authorabecsi@webkit.org <abecsi@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 13 Dec 2010 12:55:07 +0000 (12:55 +0000)
committerabecsi@webkit.org <abecsi@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 13 Dec 2010 12:55:07 +0000 (12:55 +0000)
        Reviewed by Gavin Barraclough.

        Reduce the size of the RegexStackSpaceForBackTrackInfoParentheses in YARR
        https://bugs.webkit.org/show_bug.cgi?id=49385

        Remove the BackTrackInfoParentheses struct prevBegin and prevEnd members.

        * yarr/RegexInterpreter.cpp:
        (JSC::Yarr::Interpreter::matchParentheses):
        (JSC::Yarr::Interpreter::backtrackParentheses):
        * yarr/RegexPattern.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@73903 268f45cc-cd09-0410-ab3c-d52691b4dbfc

JavaScriptCore/ChangeLog
JavaScriptCore/yarr/RegexInterpreter.cpp
JavaScriptCore/yarr/RegexPattern.h

index 6ebd064..16f5e5e 100644 (file)
@@ -1,3 +1,17 @@
+2010-12-13  Peter Varga  <pvarga@inf.u-szeged.hu>
+
+        Reviewed by Gavin Barraclough.
+
+        Reduce the size of the RegexStackSpaceForBackTrackInfoParentheses in YARR
+        https://bugs.webkit.org/show_bug.cgi?id=49385
+
+        Remove the BackTrackInfoParentheses struct prevBegin and prevEnd members.
+
+        * yarr/RegexInterpreter.cpp:
+        (JSC::Yarr::Interpreter::matchParentheses):
+        (JSC::Yarr::Interpreter::backtrackParentheses):
+        * yarr/RegexPattern.h:
+
 2010-12-10  Michael Saboff  <msaboff@apple.com>
 
         Reviewed by Gavin Barraclough.
index 0cb0d9c..9900cbe 100644 (file)
@@ -68,8 +68,6 @@ public:
     struct BackTrackInfoParentheses {
         uintptr_t matchAmount;
         ParenthesesDisjunctionContext* lastContext;
-        uintptr_t prevBegin;
-        uintptr_t prevEnd;
     };
 
     static inline void appendParenthesesDisjunctionContext(BackTrackInfoParentheses* backTrack, ParenthesesDisjunctionContext* context)
@@ -841,13 +839,8 @@ public:
         ASSERT(term.type == ByteTerm::TypeParenthesesSubpattern);
 
         BackTrackInfoParentheses* backTrack = reinterpret_cast<BackTrackInfoParentheses*>(context->frame + term.frameLocation);
-
-        unsigned subpatternId = term.atom.subpatternId;
         ByteDisjunction* disjunctionBody = term.atom.parenthesesDisjunction;
 
-        backTrack->prevBegin = output[(subpatternId << 1)];
-        backTrack->prevEnd = output[(subpatternId << 1) + 1];
-
         backTrack->matchAmount = 0;
         backTrack->lastContext = 0;
 
@@ -927,13 +920,6 @@ public:
         ASSERT(term.type == ByteTerm::TypeParenthesesSubpattern);
 
         BackTrackInfoParentheses* backTrack = reinterpret_cast<BackTrackInfoParentheses*>(context->frame + term.frameLocation);
-
-        if (term.capture()) {
-            unsigned subpatternId = term.atom.subpatternId;
-            output[(subpatternId << 1)] = backTrack->prevBegin;
-            output[(subpatternId << 1) + 1] = backTrack->prevEnd;
-        }
-
         ByteDisjunction* disjunctionBody = term.atom.parenthesesDisjunction;
 
         switch (term.atom.quantityType) {
index 44560a4..74ee897 100644 (file)
@@ -39,7 +39,7 @@ namespace JSC { namespace Yarr {
 #define RegexStackSpaceForBackTrackInfoParentheticalAssertion 1
 #define RegexStackSpaceForBackTrackInfoParenthesesOnce 1 // Only for !fixed quantifiers.
 #define RegexStackSpaceForBackTrackInfoParenthesesTerminal 1
-#define RegexStackSpaceForBackTrackInfoParentheses 4
+#define RegexStackSpaceForBackTrackInfoParentheses 2
 
 struct PatternDisjunction;