Bug 49385 - Reduce the size of the RegexStackSpaceForBackTrackInfoParentheses in YARR
Summary: Reduce the size of the RegexStackSpaceForBackTrackInfoParentheses in YARR
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Peter Varga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-11 08:03 PST by Peter Varga
Modified: 2010-12-13 04:58 PST (History)
6 users (show)

See Also:


Attachments
proposed patch (3.48 KB, patch)
2010-11-11 08:06 PST, Peter Varga
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Varga 2010-11-11 08:03:26 PST
The BackTrackInfoParentheses struct in YARR Interpreter stores two members (prevBegin, prevEnd) which are unnecessary for
the current matching logic. These are storing the last successful match of a parentheses. The result of match is restored
from these members in case of backtrack but this isn't needed because the recordParenthesesMatch() or the resetMatches() 
function updates the result of match in every case.

NOTE: This modification is needed just in the Interpreter because the JIT doesn't store
backtrack information of iterative parentheses for the time being.
Comment 1 Peter Varga 2010-11-11 08:06:42 PST
Created attachment 73615 [details]
proposed patch
Comment 2 Eric Seidel (no email) 2010-12-09 23:44:00 PST
This is a patch for gbarra. :)
Comment 3 Gavin Barraclough 2010-12-10 19:22:31 PST
Comment on attachment 73615 [details]
proposed patch

Hmmm, think I added these at an early state of development, thinking PCRE's behaviour of coalescing results across repeated iterations of karen matching was correct (ie. /(?:(a)|(b))/.exec(ab) as ["ab", "a", "b"], rather than  ["ab", , "b"]).  Anyway, good catch, yes, these look like garbage now.
Comment 4 WebKit Commit Bot 2010-12-10 19:33:53 PST
Comment on attachment 73615 [details]
proposed patch

Rejecting attachment 73615 [details] from commit-queue.

Failed to run "['./WebKitTools/Scripts/webkit-patch', '--status-host=queues.webkit.org', '--bot-id=eseidel-cq-sl', 'apply-attachment', '--non-interactive', 73615]" exit_code: 2
Last 500 characters of output:
d at 1 with fuzz 3.
patching file JavaScriptCore/yarr/RegexInterpreter.cpp
Hunk #1 succeeded at 68 (offset 2 lines).
Hunk #2 succeeded at 839 (offset 71 lines).
Hunk #3 succeeded at 920 (offset 82 lines).
patching file JavaScriptCore/yarr/RegexPattern.h
Hunk #1 FAILED at 41.
1 out of 1 hunk FAILED -- saving rejects to file JavaScriptCore/yarr/RegexPattern.h.rej

Failed to run "[u'/Projects/CommitQueue/WebKitTools/Scripts/svn-apply', u'--reviewer', u'Gavin Barraclough', u'--force']" exit_code: 1

Full output: http://queues.webkit.org/results/6899047
Comment 5 Andras Becsi 2010-12-13 04:57:52 PST
Updated patch landed in http://trac.webkit.org/changeset/73903.
Comment 6 Andras Becsi 2010-12-13 04:58:25 PST
Comment on attachment 73615 [details]
proposed patch

Clearing flags.