Ignore:
Timestamp:
Apr 23, 2009, 5:32:31 PM (16 years ago)
Author:
[email protected]
Message:

JavaScriptCore:

2009-04-23 Gavin Barraclough <[email protected]>

Reviewed by Geoff "Dread Pirate Roberts" Garen.

Various small fixes to YARR JIT, in preparation for enabling it by default.

  • Correctly index into the callframe when storing restart addresses for nested alternatives.
  • Allow backtracking back into matched alternatives of parentheses.
  • Fix callframe offset calculation for parenthetical assertions.
  • When a set of parenthese are quantified with a fixed and variable portion, and the variable portion is quantified once, this should not reset the pattern match on failure to match (the last match from the firxed portion should be preserved).
  • Up the pattern size limit to match PCRE's new limit.
  • Unlclosed parentheses should be reported with the message "missing )".
  • wtf/Platform.h:
  • yarr/RegexCompiler.cpp: (JSC::Yarr::RegexPatternConstructor::quantifyAtom): (JSC::Yarr::RegexPatternConstructor::setupAlternativeOffsets):
  • yarr/RegexInterpreter.cpp: (JSC::Yarr::Interpreter::matchParentheses): (JSC::Yarr::Interpreter::backtrackParentheses): (JSC::Yarr::ByteCompiler::emitDisjunction):
  • yarr/RegexJIT.cpp: (JSC::Yarr::RegexGenerator::loadFromFrameAndJump): (JSC::Yarr::RegexGenerator::generateParenthesesDisjunction): (JSC::Yarr::RegexGenerator::generateParentheticalAssertion): (JSC::Yarr::RegexGenerator::generateTerm): (JSC::Yarr::executeRegex):
  • yarr/RegexParser.h: (JSC::Yarr::Parser::): (JSC::Yarr::Parser::parseTokens): (JSC::Yarr::Parser::parse):
  • yarr/RegexPattern.h: (JSC::Yarr::PatternTerm::): (JSC::Yarr::PatternTerm::PatternTerm):

LayoutTests:

2009-04-23 Gavin Barraclough <[email protected]>

Reviewed by Geoff "Dread Pirate Roberts" Garen.

This test tries to force itself into PCRE; modify the
test so that as well as dodging WREC it can also avoid
YARR!

  • fast/js/resources/regexp-overflow-too-big.js:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/yarr/RegexCompiler.cpp

    r42481 r42800  
    542542            // NOTE: this term is interesting from an analysis perspective, in that it can be ignored.....
    543543            m_alternative->lastTerm().quantify((max == UINT_MAX) ? max : max - min, greedy ? QuantifierGreedy : QuantifierNonGreedy);
     544            if (m_alternative->lastTerm().type == PatternTerm::TypeParenthesesSubpattern)
     545                m_alternative->lastTerm().parentheses.isCopy = true;
    544546        }
    545547    }
     
    608610                // Note: for fixed once parentheses we will ensure at least the minimum is available; others are on their own.
    609611                term.frameLocation = currentCallFrameSize;
    610                 if (term.quantityCount == 1) {
     612                if ((term.quantityCount == 1) && !term.parentheses.isCopy) {
    611613                    if (term.quantityType == QuantifierFixedCount) {
    612614                        currentCallFrameSize = setupDisjunctionOffsets(term.parentheses.disjunction, currentCallFrameSize, currentInputPosition);
Note: See TracChangeset for help on using the changeset viewer.