Rename the existing YARR files and classes
authorbarraclough@apple.com <barraclough@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 10 Jan 2011 21:08:28 +0000 (21:08 +0000)
committerbarraclough@apple.com <barraclough@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 10 Jan 2011 21:08:28 +0000 (21:08 +0000)
https://bugs.webkit.org/show_bug.cgi?id=51872

Patch by Peter Varga <pvarga@inf.u-szeged.hu> on 2011-01-10
Reviewed by Gavin Barraclough.

Replace the "Regex" prefix with "Yarr" in the name of YARR files and classes.

* Android.mk:
* CMakeLists.txt:
* GNUmakefile.am:
* JavaScriptCore.gypi:
* JavaScriptCore.pro:
* JavaScriptCore.xcodeproj/project.pbxproj:
* runtime/RegExp.cpp:
(JSC::RegExp::compile):
(JSC::RegExp::match):
(JSC::RegExp::printTraceData):
* yarr/YarrInterpreter.cpp: Renamed from Source/JavaScriptCore/yarr/RegexInterpreter.cpp.
(JSC::Yarr::Interpreter::appendParenthesesDisjunctionContext):
(JSC::Yarr::Interpreter::popParenthesesDisjunctionContext):
(JSC::Yarr::Interpreter::DisjunctionContext::DisjunctionContext):
(JSC::Yarr::Interpreter::DisjunctionContext::operator new):
(JSC::Yarr::Interpreter::allocDisjunctionContext):
(JSC::Yarr::Interpreter::freeDisjunctionContext):
(JSC::Yarr::Interpreter::ParenthesesDisjunctionContext::ParenthesesDisjunctionContext):
(JSC::Yarr::Interpreter::ParenthesesDisjunctionContext::operator new):
(JSC::Yarr::Interpreter::ParenthesesDisjunctionContext::restoreOutput):
(JSC::Yarr::Interpreter::ParenthesesDisjunctionContext::getDisjunctionContext):
(JSC::Yarr::Interpreter::allocParenthesesDisjunctionContext):
(JSC::Yarr::Interpreter::freeParenthesesDisjunctionContext):
(JSC::Yarr::Interpreter::InputStream::InputStream):
(JSC::Yarr::Interpreter::InputStream::next):
(JSC::Yarr::Interpreter::InputStream::rewind):
(JSC::Yarr::Interpreter::InputStream::read):
(JSC::Yarr::Interpreter::InputStream::readPair):
(JSC::Yarr::Interpreter::InputStream::readChecked):
(JSC::Yarr::Interpreter::InputStream::reread):
(JSC::Yarr::Interpreter::InputStream::prev):
(JSC::Yarr::Interpreter::InputStream::getPos):
(JSC::Yarr::Interpreter::InputStream::setPos):
(JSC::Yarr::Interpreter::InputStream::atStart):
(JSC::Yarr::Interpreter::InputStream::atEnd):
(JSC::Yarr::Interpreter::InputStream::checkInput):
(JSC::Yarr::Interpreter::InputStream::uncheckInput):
(JSC::Yarr::Interpreter::InputStream::isNotAvailableInput):
(JSC::Yarr::Interpreter::testCharacterClass):
(JSC::Yarr::Interpreter::checkCharacter):
(JSC::Yarr::Interpreter::checkCasedCharacter):
(JSC::Yarr::Interpreter::checkCharacterClass):
(JSC::Yarr::Interpreter::tryConsumeBackReference):
(JSC::Yarr::Interpreter::matchAssertionBOL):
(JSC::Yarr::Interpreter::matchAssertionEOL):
(JSC::Yarr::Interpreter::matchAssertionWordBoundary):
(JSC::Yarr::Interpreter::backtrackPatternCharacter):
(JSC::Yarr::Interpreter::backtrackPatternCasedCharacter):
(JSC::Yarr::Interpreter::matchCharacterClass):
(JSC::Yarr::Interpreter::backtrackCharacterClass):
(JSC::Yarr::Interpreter::matchBackReference):
(JSC::Yarr::Interpreter::backtrackBackReference):
(JSC::Yarr::Interpreter::recordParenthesesMatch):
(JSC::Yarr::Interpreter::resetMatches):
(JSC::Yarr::Interpreter::parenthesesDoBacktrack):
(JSC::Yarr::Interpreter::matchParenthesesOnceBegin):
(JSC::Yarr::Interpreter::matchParenthesesOnceEnd):
(JSC::Yarr::Interpreter::backtrackParenthesesOnceBegin):
(JSC::Yarr::Interpreter::backtrackParenthesesOnceEnd):
(JSC::Yarr::Interpreter::matchParenthesesTerminalBegin):
(JSC::Yarr::Interpreter::matchParenthesesTerminalEnd):
(JSC::Yarr::Interpreter::backtrackParenthesesTerminalBegin):
(JSC::Yarr::Interpreter::backtrackParenthesesTerminalEnd):
(JSC::Yarr::Interpreter::matchParentheticalAssertionBegin):
(JSC::Yarr::Interpreter::matchParentheticalAssertionEnd):
(JSC::Yarr::Interpreter::backtrackParentheticalAssertionBegin):
(JSC::Yarr::Interpreter::backtrackParentheticalAssertionEnd):
(JSC::Yarr::Interpreter::matchParentheses):
(JSC::Yarr::Interpreter::backtrackParentheses):
(JSC::Yarr::Interpreter::lookupForBeginChars):
(JSC::Yarr::Interpreter::matchDisjunction):
(JSC::Yarr::Interpreter::matchNonZeroDisjunction):
(JSC::Yarr::Interpreter::interpret):
(JSC::Yarr::Interpreter::Interpreter):
(JSC::Yarr::ByteCompiler::ParenthesesStackEntry::ParenthesesStackEntry):
(JSC::Yarr::ByteCompiler::ByteCompiler):
(JSC::Yarr::ByteCompiler::compile):
(JSC::Yarr::ByteCompiler::checkInput):
(JSC::Yarr::ByteCompiler::assertionBOL):
(JSC::Yarr::ByteCompiler::assertionEOL):
(JSC::Yarr::ByteCompiler::assertionWordBoundary):
(JSC::Yarr::ByteCompiler::atomPatternCharacter):
(JSC::Yarr::ByteCompiler::atomCharacterClass):
(JSC::Yarr::ByteCompiler::atomBackReference):
(JSC::Yarr::ByteCompiler::atomParenthesesOnceBegin):
(JSC::Yarr::ByteCompiler::atomParenthesesTerminalBegin):
(JSC::Yarr::ByteCompiler::atomParenthesesSubpatternBegin):
(JSC::Yarr::ByteCompiler::atomParentheticalAssertionBegin):
(JSC::Yarr::ByteCompiler::atomParentheticalAssertionEnd):
(JSC::Yarr::ByteCompiler::popParenthesesStack):
(JSC::Yarr::ByteCompiler::dumpDisjunction):
(JSC::Yarr::ByteCompiler::closeAlternative):
(JSC::Yarr::ByteCompiler::closeBodyAlternative):
(JSC::Yarr::ByteCompiler::atomParenthesesSubpatternEnd):
(JSC::Yarr::ByteCompiler::atomParenthesesOnceEnd):
(JSC::Yarr::ByteCompiler::atomParenthesesTerminalEnd):
(JSC::Yarr::ByteCompiler::regexBegin):
(JSC::Yarr::ByteCompiler::regexEnd):
(JSC::Yarr::ByteCompiler::alternativeBodyDisjunction):
(JSC::Yarr::ByteCompiler::alternativeDisjunction):
(JSC::Yarr::ByteCompiler::emitDisjunction):
(JSC::Yarr::byteCompile):
(JSC::Yarr::interpret):
* yarr/YarrInterpreter.h: Renamed from Source/JavaScriptCore/yarr/RegexInterpreter.h.
(JSC::Yarr::ByteTerm::ByteTerm):
(JSC::Yarr::ByteTerm::BOL):
(JSC::Yarr::ByteTerm::CheckInput):
(JSC::Yarr::ByteTerm::EOL):
(JSC::Yarr::ByteTerm::WordBoundary):
(JSC::Yarr::ByteTerm::BackReference):
(JSC::Yarr::ByteTerm::BodyAlternativeBegin):
(JSC::Yarr::ByteTerm::BodyAlternativeDisjunction):
(JSC::Yarr::ByteTerm::BodyAlternativeEnd):
(JSC::Yarr::ByteTerm::AlternativeBegin):
(JSC::Yarr::ByteTerm::AlternativeDisjunction):
(JSC::Yarr::ByteTerm::AlternativeEnd):
(JSC::Yarr::ByteTerm::SubpatternBegin):
(JSC::Yarr::ByteTerm::SubpatternEnd):
(JSC::Yarr::ByteTerm::invert):
(JSC::Yarr::ByteTerm::capture):
(JSC::Yarr::ByteDisjunction::ByteDisjunction):
(JSC::Yarr::BytecodePattern::BytecodePattern):
(JSC::Yarr::BytecodePattern::~BytecodePattern):
* yarr/YarrJIT.cpp: Renamed from Source/JavaScriptCore/yarr/RegexJIT.cpp.
(JSC::Yarr::YarrGenerator::optimizeAlternative):
(JSC::Yarr::YarrGenerator::matchCharacterClassRange):
(JSC::Yarr::YarrGenerator::matchCharacterClass):
(JSC::Yarr::YarrGenerator::jumpIfNoAvailableInput):
(JSC::Yarr::YarrGenerator::jumpIfAvailableInput):
(JSC::Yarr::YarrGenerator::checkInput):
(JSC::Yarr::YarrGenerator::atEndOfInput):
(JSC::Yarr::YarrGenerator::notAtEndOfInput):
(JSC::Yarr::YarrGenerator::jumpIfCharEquals):
(JSC::Yarr::YarrGenerator::jumpIfCharNotEquals):
(JSC::Yarr::YarrGenerator::readCharacter):
(JSC::Yarr::YarrGenerator::storeToFrame):
(JSC::Yarr::YarrGenerator::storeToFrameWithPatch):
(JSC::Yarr::YarrGenerator::loadFromFrame):
(JSC::Yarr::YarrGenerator::loadFromFrameAndJump):
(JSC::Yarr::YarrGenerator::IndirectJumpEntry::IndirectJumpEntry):
(JSC::Yarr::YarrGenerator::IndirectJumpEntry::addJump):
(JSC::Yarr::YarrGenerator::AlternativeBacktrackRecord::AlternativeBacktrackRecord):
(JSC::Yarr::YarrGenerator::GenerationState::GenerationState):
(JSC::Yarr::YarrGenerator::GenerationState::addIndirectJumpEntry):
(JSC::Yarr::YarrGenerator::GenerationState::emitIndirectJumpTable):
(JSC::Yarr::YarrGenerator::GenerationState::incrementParenNestingLevel):
(JSC::Yarr::YarrGenerator::GenerationState::decrementParenNestingLevel):
(JSC::Yarr::YarrGenerator::GenerationState::addParenthesesTail):
(JSC::Yarr::YarrGenerator::GenerationState::emitParenthesesTail):
(JSC::Yarr::YarrGenerator::GenerationState::addJumpToNextInteration):
(JSC::Yarr::YarrGenerator::GenerationState::addJumpsToNextInteration):
(JSC::Yarr::YarrGenerator::GenerationState::addDataLabelToNextIteration):
(JSC::Yarr::YarrGenerator::GenerationState::linkToNextIteration):
(JSC::Yarr::YarrGenerator::BacktrackDestination::BacktrackDestination):
(JSC::Yarr::YarrGenerator::BacktrackDestination::clear):
(JSC::Yarr::YarrGenerator::BacktrackDestination::clearDataLabel):
(JSC::Yarr::YarrGenerator::BacktrackDestination::hasDestination):
(JSC::Yarr::YarrGenerator::BacktrackDestination::isStackOffset):
(JSC::Yarr::YarrGenerator::BacktrackDestination::isLabel):
(JSC::Yarr::YarrGenerator::BacktrackDestination::isJumpList):
(JSC::Yarr::YarrGenerator::BacktrackDestination::hasDataLabel):
(JSC::Yarr::YarrGenerator::BacktrackDestination::copyTarget):
(JSC::Yarr::YarrGenerator::BacktrackDestination::copyTo):
(JSC::Yarr::YarrGenerator::BacktrackDestination::addBacktrackJump):
(JSC::Yarr::YarrGenerator::BacktrackDestination::setStackOffset):
(JSC::Yarr::YarrGenerator::BacktrackDestination::setLabel):
(JSC::Yarr::YarrGenerator::BacktrackDestination::setNextBacktrackLabel):
(JSC::Yarr::YarrGenerator::BacktrackDestination::copyBacktrackToLabel):
(JSC::Yarr::YarrGenerator::BacktrackDestination::setBacktrackToLabel):
(JSC::Yarr::YarrGenerator::BacktrackDestination::setBacktrackJumpList):
(JSC::Yarr::YarrGenerator::BacktrackDestination::setBacktrackSourceLabel):
(JSC::Yarr::YarrGenerator::BacktrackDestination::setDataLabel):
(JSC::Yarr::YarrGenerator::BacktrackDestination::setSubDataLabelPtr):
(JSC::Yarr::YarrGenerator::BacktrackDestination::linkToNextBacktrack):
(JSC::Yarr::YarrGenerator::BacktrackDestination::getStackOffset):
(JSC::Yarr::YarrGenerator::BacktrackDestination::getLabel):
(JSC::Yarr::YarrGenerator::BacktrackDestination::getBacktrackJumps):
(JSC::Yarr::YarrGenerator::BacktrackDestination::getDataLabel):
(JSC::Yarr::YarrGenerator::BacktrackDestination::jumpToBacktrack):
(JSC::Yarr::YarrGenerator::BacktrackDestination::linkDataLabelToHereIfExists):
(JSC::Yarr::YarrGenerator::BacktrackDestination::plantJumpToBacktrackIfExists):
(JSC::Yarr::YarrGenerator::BacktrackDestination::linkAlternativeBacktracks):
(JSC::Yarr::YarrGenerator::BacktrackDestination::linkAlternativeBacktracksTo):
(JSC::Yarr::YarrGenerator::TermGenerationState::TermGenerationState):
(JSC::Yarr::YarrGenerator::TermGenerationState::resetAlternative):
(JSC::Yarr::YarrGenerator::TermGenerationState::alternativeValid):
(JSC::Yarr::YarrGenerator::TermGenerationState::nextAlternative):
(JSC::Yarr::YarrGenerator::TermGenerationState::alternative):
(JSC::Yarr::YarrGenerator::TermGenerationState::isLastAlternative):
(JSC::Yarr::YarrGenerator::TermGenerationState::resetTerm):
(JSC::Yarr::YarrGenerator::TermGenerationState::termValid):
(JSC::Yarr::YarrGenerator::TermGenerationState::nextTerm):
(JSC::Yarr::YarrGenerator::TermGenerationState::term):
(JSC::Yarr::YarrGenerator::TermGenerationState::isLastTerm):
(JSC::Yarr::YarrGenerator::TermGenerationState::getSubParenNum):
(JSC::Yarr::YarrGenerator::TermGenerationState::isMainDisjunction):
(JSC::Yarr::YarrGenerator::TermGenerationState::setParenthesesTail):
(JSC::Yarr::YarrGenerator::TermGenerationState::getParenthesesTail):
(JSC::Yarr::YarrGenerator::TermGenerationState::lookaheadTerm):
(JSC::Yarr::YarrGenerator::TermGenerationState::isSinglePatternCharacterLookaheadTerm):
(JSC::Yarr::YarrGenerator::TermGenerationState::inputOffset):
(JSC::Yarr::YarrGenerator::TermGenerationState::clearBacktrack):
(JSC::Yarr::YarrGenerator::TermGenerationState::jumpToBacktrack):
(JSC::Yarr::YarrGenerator::TermGenerationState::plantJumpToBacktrackIfExists):
(JSC::Yarr::YarrGenerator::TermGenerationState::linkDataLabelToBacktrackIfExists):
(JSC::Yarr::YarrGenerator::TermGenerationState::addBacktrackJump):
(JSC::Yarr::YarrGenerator::TermGenerationState::setBacktrackDataLabel):
(JSC::Yarr::YarrGenerator::TermGenerationState::setBackTrackStackOffset):
(JSC::Yarr::YarrGenerator::TermGenerationState::setBacktrackLabel):
(JSC::Yarr::YarrGenerator::TermGenerationState::linkAlternativeBacktracks):
(JSC::Yarr::YarrGenerator::TermGenerationState::linkAlternativeBacktracksTo):
(JSC::Yarr::YarrGenerator::TermGenerationState::setBacktrackLink):
(JSC::Yarr::YarrGenerator::TermGenerationState::chainBacktracks):
(JSC::Yarr::YarrGenerator::TermGenerationState::chainBacktrackJumps):
(JSC::Yarr::YarrGenerator::TermGenerationState::getBacktrackDestination):
(JSC::Yarr::YarrGenerator::TermGenerationState::propagateBacktrackingFrom):
(JSC::Yarr::YarrGenerator::ParenthesesTail::ParenthesesTail):
(JSC::Yarr::YarrGenerator::ParenthesesTail::processBacktracks):
(JSC::Yarr::YarrGenerator::ParenthesesTail::setNextIteration):
(JSC::Yarr::YarrGenerator::ParenthesesTail::addAfterParenJump):
(JSC::Yarr::YarrGenerator::ParenthesesTail::generateCode):
(JSC::Yarr::YarrGenerator::generateAssertionBOL):
(JSC::Yarr::YarrGenerator::generateAssertionEOL):
(JSC::Yarr::YarrGenerator::matchAssertionWordchar):
(JSC::Yarr::YarrGenerator::generateAssertionWordBoundary):
(JSC::Yarr::YarrGenerator::generatePatternCharacterSingle):
(JSC::Yarr::YarrGenerator::generatePatternCharacterPair):
(JSC::Yarr::YarrGenerator::generatePatternCharacterFixed):
(JSC::Yarr::YarrGenerator::generatePatternCharacterGreedy):
(JSC::Yarr::YarrGenerator::generatePatternCharacterNonGreedy):
(JSC::Yarr::YarrGenerator::generateCharacterClassSingle):
(JSC::Yarr::YarrGenerator::generateCharacterClassFixed):
(JSC::Yarr::YarrGenerator::generateCharacterClassGreedy):
(JSC::Yarr::YarrGenerator::generateCharacterClassNonGreedy):
(JSC::Yarr::YarrGenerator::generateParenthesesDisjunction):
(JSC::Yarr::YarrGenerator::generateParenthesesSingle):
(JSC::Yarr::YarrGenerator::generateParenthesesGreedyNoBacktrack):
(JSC::Yarr::YarrGenerator::generateParentheticalAssertion):
(JSC::Yarr::YarrGenerator::generateTerm):
(JSC::Yarr::YarrGenerator::generateDisjunction):
(JSC::Yarr::YarrGenerator::generateEnter):
(JSC::Yarr::YarrGenerator::generateReturn):
(JSC::Yarr::YarrGenerator::YarrGenerator):
(JSC::Yarr::YarrGenerator::generate):
(JSC::Yarr::YarrGenerator::compile):
(JSC::Yarr::jitCompile):
* yarr/YarrJIT.h: Renamed from Source/JavaScriptCore/yarr/RegexJIT.h.
(JSC::Yarr::YarrCodeBlock::YarrCodeBlock):
(JSC::Yarr::YarrCodeBlock::~YarrCodeBlock):
(JSC::Yarr::YarrCodeBlock::setFallBack):
(JSC::Yarr::YarrCodeBlock::isFallBack):
(JSC::Yarr::YarrCodeBlock::set):
(JSC::Yarr::YarrCodeBlock::execute):
(JSC::Yarr::YarrCodeBlock::getAddr):
(JSC::Yarr::execute):
* yarr/YarrParser.h: Renamed from Source/JavaScriptCore/yarr/RegexParser.h.
(JSC::Yarr::Parser::CharacterClassParserDelegate::CharacterClassParserDelegate):
(JSC::Yarr::Parser::CharacterClassParserDelegate::begin):
(JSC::Yarr::Parser::CharacterClassParserDelegate::atomPatternCharacter):
(JSC::Yarr::Parser::CharacterClassParserDelegate::atomBuiltInCharacterClass):
(JSC::Yarr::Parser::CharacterClassParserDelegate::end):
(JSC::Yarr::Parser::CharacterClassParserDelegate::assertionWordBoundary):
(JSC::Yarr::Parser::CharacterClassParserDelegate::atomBackReference):
(JSC::Yarr::Parser::Parser):
(JSC::Yarr::Parser::parseEscape):
(JSC::Yarr::Parser::parseAtomEscape):
(JSC::Yarr::Parser::parseCharacterClassEscape):
(JSC::Yarr::Parser::parseCharacterClass):
(JSC::Yarr::Parser::parseParenthesesBegin):
(JSC::Yarr::Parser::parseParenthesesEnd):
(JSC::Yarr::Parser::parseQuantifier):
(JSC::Yarr::Parser::parseTokens):
(JSC::Yarr::Parser::parse):
(JSC::Yarr::Parser::saveState):
(JSC::Yarr::Parser::restoreState):
(JSC::Yarr::Parser::atEndOfPattern):
(JSC::Yarr::Parser::peek):
(JSC::Yarr::Parser::peekIsDigit):
(JSC::Yarr::Parser::peekDigit):
(JSC::Yarr::Parser::consume):
(JSC::Yarr::Parser::consumeDigit):
(JSC::Yarr::Parser::consumeNumber):
(JSC::Yarr::Parser::consumeOctal):
(JSC::Yarr::Parser::tryConsume):
(JSC::Yarr::Parser::tryConsumeHex):
(JSC::Yarr::parse):
* yarr/YarrPattern.cpp: Renamed from Source/JavaScriptCore/yarr/RegexPattern.cpp.
(JSC::Yarr::CharacterClassConstructor::CharacterClassConstructor):
(JSC::Yarr::CharacterClassConstructor::reset):
(JSC::Yarr::CharacterClassConstructor::append):
(JSC::Yarr::CharacterClassConstructor::putChar):
(JSC::Yarr::CharacterClassConstructor::isUnicodeUpper):
(JSC::Yarr::CharacterClassConstructor::isUnicodeLower):
(JSC::Yarr::CharacterClassConstructor::putRange):
(JSC::Yarr::CharacterClassConstructor::charClass):
(JSC::Yarr::CharacterClassConstructor::addSorted):
(JSC::Yarr::CharacterClassConstructor::addSortedRange):
(JSC::Yarr::BeginCharHelper::BeginCharHelper):
(JSC::Yarr::BeginCharHelper::addBeginChar):
(JSC::Yarr::BeginCharHelper::merge):
(JSC::Yarr::BeginCharHelper::addCharacter):
(JSC::Yarr::BeginCharHelper::linkHotTerms):
(JSC::Yarr::YarrPatternConstructor::YarrPatternConstructor):
(JSC::Yarr::YarrPatternConstructor::~YarrPatternConstructor):
(JSC::Yarr::YarrPatternConstructor::reset):
(JSC::Yarr::YarrPatternConstructor::assertionBOL):
(JSC::Yarr::YarrPatternConstructor::assertionEOL):
(JSC::Yarr::YarrPatternConstructor::assertionWordBoundary):
(JSC::Yarr::YarrPatternConstructor::atomPatternCharacter):
(JSC::Yarr::YarrPatternConstructor::atomBuiltInCharacterClass):
(JSC::Yarr::YarrPatternConstructor::atomCharacterClassBegin):
(JSC::Yarr::YarrPatternConstructor::atomCharacterClassAtom):
(JSC::Yarr::YarrPatternConstructor::atomCharacterClassRange):
(JSC::Yarr::YarrPatternConstructor::atomCharacterClassBuiltIn):
(JSC::Yarr::YarrPatternConstructor::atomCharacterClassEnd):
(JSC::Yarr::YarrPatternConstructor::atomParenthesesSubpatternBegin):
(JSC::Yarr::YarrPatternConstructor::atomParentheticalAssertionBegin):
(JSC::Yarr::YarrPatternConstructor::atomParenthesesEnd):
(JSC::Yarr::YarrPatternConstructor::atomBackReference):
(JSC::Yarr::YarrPatternConstructor::copyDisjunction):
(JSC::Yarr::YarrPatternConstructor::copyTerm):
(JSC::Yarr::YarrPatternConstructor::quantifyAtom):
(JSC::Yarr::YarrPatternConstructor::disjunction):
(JSC::Yarr::YarrPatternConstructor::regexBegin):
(JSC::Yarr::YarrPatternConstructor::regexEnd):
(JSC::Yarr::YarrPatternConstructor::regexError):
(JSC::Yarr::YarrPatternConstructor::setupAlternativeOffsets):
(JSC::Yarr::YarrPatternConstructor::setupDisjunctionOffsets):
(JSC::Yarr::YarrPatternConstructor::setupOffsets):
(JSC::Yarr::YarrPatternConstructor::checkForTerminalParentheses):
(JSC::Yarr::YarrPatternConstructor::optimizeBOL):
(JSC::Yarr::YarrPatternConstructor::addBeginTerm):
(JSC::Yarr::YarrPatternConstructor::setupDisjunctionBeginTerms):
(JSC::Yarr::YarrPatternConstructor::setupAlternativeBeginTerms):
(JSC::Yarr::YarrPatternConstructor::setupBeginChars):
(JSC::Yarr::compile):
(JSC::Yarr::YarrPattern::YarrPattern):
* yarr/YarrPattern.h: Renamed from Source/JavaScriptCore/yarr/RegexPattern.h.
(JSC::Yarr::CharacterRange::CharacterRange):
(JSC::Yarr::CharacterClassTable::create):
(JSC::Yarr::CharacterClassTable::CharacterClassTable):
(JSC::Yarr::CharacterClass::CharacterClass):
(JSC::Yarr::PatternTerm::PatternTerm):
(JSC::Yarr::PatternTerm::ForwardReference):
(JSC::Yarr::PatternTerm::BOL):
(JSC::Yarr::PatternTerm::EOL):
(JSC::Yarr::PatternTerm::WordBoundary):
(JSC::Yarr::PatternTerm::invert):
(JSC::Yarr::PatternTerm::capture):
(JSC::Yarr::PatternTerm::quantify):
(JSC::Yarr::PatternAlternative::PatternAlternative):
(JSC::Yarr::PatternAlternative::lastTerm):
(JSC::Yarr::PatternAlternative::removeLastTerm):
(JSC::Yarr::PatternAlternative::setOnceThrough):
(JSC::Yarr::PatternAlternative::onceThrough):
(JSC::Yarr::PatternDisjunction::PatternDisjunction):
(JSC::Yarr::PatternDisjunction::~PatternDisjunction):
(JSC::Yarr::PatternDisjunction::addNewAlternative):
(JSC::Yarr::TermChain::TermChain):
(JSC::Yarr::BeginChar::BeginChar):
(JSC::Yarr::YarrPattern::~YarrPattern):
(JSC::Yarr::YarrPattern::reset):
(JSC::Yarr::YarrPattern::containsIllegalBackReference):
(JSC::Yarr::YarrPattern::newlineCharacterClass):
(JSC::Yarr::YarrPattern::digitsCharacterClass):
(JSC::Yarr::YarrPattern::spacesCharacterClass):
(JSC::Yarr::YarrPattern::wordcharCharacterClass):
(JSC::Yarr::YarrPattern::nondigitsCharacterClass):
(JSC::Yarr::YarrPattern::nonspacesCharacterClass):
(JSC::Yarr::YarrPattern::nonwordcharCharacterClass):

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

18 files changed:
Source/JavaScriptCore/Android.mk
Source/JavaScriptCore/CMakeLists.txt
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/GNUmakefile.am
Source/JavaScriptCore/JavaScriptCore.gypi
Source/JavaScriptCore/JavaScriptCore.pro
Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj
Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
Source/JavaScriptCore/runtime/JSGlobalData.h
Source/JavaScriptCore/runtime/RegExp.cpp
Source/JavaScriptCore/yarr/YarrInterpreter.cpp [moved from Source/JavaScriptCore/yarr/RegexInterpreter.cpp with 98% similarity]
Source/JavaScriptCore/yarr/YarrInterpreter.h [moved from Source/JavaScriptCore/yarr/RegexInterpreter.h with 95% similarity]
Source/JavaScriptCore/yarr/YarrJIT.cpp [moved from Source/JavaScriptCore/yarr/RegexJIT.cpp with 97% similarity]
Source/JavaScriptCore/yarr/YarrJIT.h [moved from Source/JavaScriptCore/yarr/RegexJIT.h with 79% similarity]
Source/JavaScriptCore/yarr/YarrParser.h [moved from Source/JavaScriptCore/yarr/RegexParser.h with 99% similarity]
Source/JavaScriptCore/yarr/YarrPattern.cpp [moved from Source/JavaScriptCore/yarr/RegexPattern.cpp with 96% similarity]
Source/JavaScriptCore/yarr/YarrPattern.h [moved from Source/JavaScriptCore/yarr/RegexPattern.h with 93% similarity]
Source/JavaScriptCore/yarr/YarrSyntaxChecker.cpp

index be8a9b45ce5d3ecf7e07864cdbbcf4d2f6c93f42..865a7514561f89e9a3451dc372f949bf05cf1e6c 100644 (file)
@@ -190,9 +190,9 @@ LOCAL_SRC_FILES := \
        \
        wtf/unicode/icu/CollatorICU.cpp \
        \
-       yarr/RegexPattern.cpp \
-       yarr/RegexInterpreter.cpp \
-       yarr/RegexJIT.cpp \
+       yarr/YarrPattern.cpp \
+       yarr/YarrInterpreter.cpp \
+       yarr/YarrJIT.cpp \
     yarr/YarrSyntaxChecker.cpp
 
 # generated headers
index 31dc4e11a301d75d417d65de0bc5bbfdb91f8c7c..ef53adbd453d698f6e1204cb9716180e85dfdab3 100644 (file)
@@ -167,9 +167,9 @@ SET(JavaScriptCore_SOURCES
     runtime/TimeoutChecker.cpp
     runtime/UString.cpp
 
-    yarr/RegexPattern.cpp
-    yarr/RegexInterpreter.cpp
-    yarr/RegexJIT.cpp
+    yarr/YarrPattern.cpp
+    yarr/YarrInterpreter.cpp
+    yarr/YarrJIT.cpp
     yarr/YarrSyntaxChecker.cpp
 
     wtf/DateMath.cpp
@@ -221,7 +221,7 @@ ADD_CUSTOM_COMMAND(
     MAIN_DEPENDENCY ${JAVASCRIPTCORE_DIR}/create_regex_tables
     COMMAND ${PYTHON_EXECUTABLE} ${JAVASCRIPTCORE_DIR}/create_regex_tables > ${DERIVED_SOURCES_DIR}/RegExpJitTables.h
     VERBATIM)
-ADD_SOURCE_DEPENDENCIES(${JAVASCRIPTCORE_DIR}/yarr/RegexPattern.cpp ${DERIVED_SOURCES_DIR}/RegExpJitTables.h)
+ADD_SOURCE_DEPENDENCIES(${JAVASCRIPTCORE_DIR}/yarr/YarrPattern.cpp ${DERIVED_SOURCES_DIR}/RegExpJitTables.h)
 
 
 
index e1905af3fba9606287bc895bf6dbb02d33475c23..6986b71c50b7aea6471659126f7d8d1401a5b78f 100644 (file)
@@ -1,3 +1,383 @@
+2011-01-10  Peter Varga  <pvarga@inf.u-szeged.hu>
+
+        Reviewed by Gavin Barraclough.
+
+        Rename the existing YARR files and classes
+        https://bugs.webkit.org/show_bug.cgi?id=51872
+
+        Replace the "Regex" prefix with "Yarr" in the name of YARR files and classes.
+
+        * Android.mk:
+        * CMakeLists.txt:
+        * GNUmakefile.am:
+        * JavaScriptCore.gypi:
+        * JavaScriptCore.pro:
+        * JavaScriptCore.xcodeproj/project.pbxproj:
+        * runtime/RegExp.cpp:
+        (JSC::RegExp::compile):
+        (JSC::RegExp::match):
+        (JSC::RegExp::printTraceData):
+        * yarr/YarrInterpreter.cpp: Renamed from Source/JavaScriptCore/yarr/RegexInterpreter.cpp.
+        (JSC::Yarr::Interpreter::appendParenthesesDisjunctionContext):
+        (JSC::Yarr::Interpreter::popParenthesesDisjunctionContext):
+        (JSC::Yarr::Interpreter::DisjunctionContext::DisjunctionContext):
+        (JSC::Yarr::Interpreter::DisjunctionContext::operator new):
+        (JSC::Yarr::Interpreter::allocDisjunctionContext):
+        (JSC::Yarr::Interpreter::freeDisjunctionContext):
+        (JSC::Yarr::Interpreter::ParenthesesDisjunctionContext::ParenthesesDisjunctionContext):
+        (JSC::Yarr::Interpreter::ParenthesesDisjunctionContext::operator new):
+        (JSC::Yarr::Interpreter::ParenthesesDisjunctionContext::restoreOutput):
+        (JSC::Yarr::Interpreter::ParenthesesDisjunctionContext::getDisjunctionContext):
+        (JSC::Yarr::Interpreter::allocParenthesesDisjunctionContext):
+        (JSC::Yarr::Interpreter::freeParenthesesDisjunctionContext):
+        (JSC::Yarr::Interpreter::InputStream::InputStream):
+        (JSC::Yarr::Interpreter::InputStream::next):
+        (JSC::Yarr::Interpreter::InputStream::rewind):
+        (JSC::Yarr::Interpreter::InputStream::read):
+        (JSC::Yarr::Interpreter::InputStream::readPair):
+        (JSC::Yarr::Interpreter::InputStream::readChecked):
+        (JSC::Yarr::Interpreter::InputStream::reread):
+        (JSC::Yarr::Interpreter::InputStream::prev):
+        (JSC::Yarr::Interpreter::InputStream::getPos):
+        (JSC::Yarr::Interpreter::InputStream::setPos):
+        (JSC::Yarr::Interpreter::InputStream::atStart):
+        (JSC::Yarr::Interpreter::InputStream::atEnd):
+        (JSC::Yarr::Interpreter::InputStream::checkInput):
+        (JSC::Yarr::Interpreter::InputStream::uncheckInput):
+        (JSC::Yarr::Interpreter::InputStream::isNotAvailableInput):
+        (JSC::Yarr::Interpreter::testCharacterClass):
+        (JSC::Yarr::Interpreter::checkCharacter):
+        (JSC::Yarr::Interpreter::checkCasedCharacter):
+        (JSC::Yarr::Interpreter::checkCharacterClass):
+        (JSC::Yarr::Interpreter::tryConsumeBackReference):
+        (JSC::Yarr::Interpreter::matchAssertionBOL):
+        (JSC::Yarr::Interpreter::matchAssertionEOL):
+        (JSC::Yarr::Interpreter::matchAssertionWordBoundary):
+        (JSC::Yarr::Interpreter::backtrackPatternCharacter):
+        (JSC::Yarr::Interpreter::backtrackPatternCasedCharacter):
+        (JSC::Yarr::Interpreter::matchCharacterClass):
+        (JSC::Yarr::Interpreter::backtrackCharacterClass):
+        (JSC::Yarr::Interpreter::matchBackReference):
+        (JSC::Yarr::Interpreter::backtrackBackReference):
+        (JSC::Yarr::Interpreter::recordParenthesesMatch):
+        (JSC::Yarr::Interpreter::resetMatches):
+        (JSC::Yarr::Interpreter::parenthesesDoBacktrack):
+        (JSC::Yarr::Interpreter::matchParenthesesOnceBegin):
+        (JSC::Yarr::Interpreter::matchParenthesesOnceEnd):
+        (JSC::Yarr::Interpreter::backtrackParenthesesOnceBegin):
+        (JSC::Yarr::Interpreter::backtrackParenthesesOnceEnd):
+        (JSC::Yarr::Interpreter::matchParenthesesTerminalBegin):
+        (JSC::Yarr::Interpreter::matchParenthesesTerminalEnd):
+        (JSC::Yarr::Interpreter::backtrackParenthesesTerminalBegin):
+        (JSC::Yarr::Interpreter::backtrackParenthesesTerminalEnd):
+        (JSC::Yarr::Interpreter::matchParentheticalAssertionBegin):
+        (JSC::Yarr::Interpreter::matchParentheticalAssertionEnd):
+        (JSC::Yarr::Interpreter::backtrackParentheticalAssertionBegin):
+        (JSC::Yarr::Interpreter::backtrackParentheticalAssertionEnd):
+        (JSC::Yarr::Interpreter::matchParentheses):
+        (JSC::Yarr::Interpreter::backtrackParentheses):
+        (JSC::Yarr::Interpreter::lookupForBeginChars):
+        (JSC::Yarr::Interpreter::matchDisjunction):
+        (JSC::Yarr::Interpreter::matchNonZeroDisjunction):
+        (JSC::Yarr::Interpreter::interpret):
+        (JSC::Yarr::Interpreter::Interpreter):
+        (JSC::Yarr::ByteCompiler::ParenthesesStackEntry::ParenthesesStackEntry):
+        (JSC::Yarr::ByteCompiler::ByteCompiler):
+        (JSC::Yarr::ByteCompiler::compile):
+        (JSC::Yarr::ByteCompiler::checkInput):
+        (JSC::Yarr::ByteCompiler::assertionBOL):
+        (JSC::Yarr::ByteCompiler::assertionEOL):
+        (JSC::Yarr::ByteCompiler::assertionWordBoundary):
+        (JSC::Yarr::ByteCompiler::atomPatternCharacter):
+        (JSC::Yarr::ByteCompiler::atomCharacterClass):
+        (JSC::Yarr::ByteCompiler::atomBackReference):
+        (JSC::Yarr::ByteCompiler::atomParenthesesOnceBegin):
+        (JSC::Yarr::ByteCompiler::atomParenthesesTerminalBegin):
+        (JSC::Yarr::ByteCompiler::atomParenthesesSubpatternBegin):
+        (JSC::Yarr::ByteCompiler::atomParentheticalAssertionBegin):
+        (JSC::Yarr::ByteCompiler::atomParentheticalAssertionEnd):
+        (JSC::Yarr::ByteCompiler::popParenthesesStack):
+        (JSC::Yarr::ByteCompiler::dumpDisjunction):
+        (JSC::Yarr::ByteCompiler::closeAlternative):
+        (JSC::Yarr::ByteCompiler::closeBodyAlternative):
+        (JSC::Yarr::ByteCompiler::atomParenthesesSubpatternEnd):
+        (JSC::Yarr::ByteCompiler::atomParenthesesOnceEnd):
+        (JSC::Yarr::ByteCompiler::atomParenthesesTerminalEnd):
+        (JSC::Yarr::ByteCompiler::regexBegin):
+        (JSC::Yarr::ByteCompiler::regexEnd):
+        (JSC::Yarr::ByteCompiler::alternativeBodyDisjunction):
+        (JSC::Yarr::ByteCompiler::alternativeDisjunction):
+        (JSC::Yarr::ByteCompiler::emitDisjunction):
+        (JSC::Yarr::byteCompile):
+        (JSC::Yarr::interpret):
+        * yarr/YarrInterpreter.h: Renamed from Source/JavaScriptCore/yarr/RegexInterpreter.h.
+        (JSC::Yarr::ByteTerm::ByteTerm):
+        (JSC::Yarr::ByteTerm::BOL):
+        (JSC::Yarr::ByteTerm::CheckInput):
+        (JSC::Yarr::ByteTerm::EOL):
+        (JSC::Yarr::ByteTerm::WordBoundary):
+        (JSC::Yarr::ByteTerm::BackReference):
+        (JSC::Yarr::ByteTerm::BodyAlternativeBegin):
+        (JSC::Yarr::ByteTerm::BodyAlternativeDisjunction):
+        (JSC::Yarr::ByteTerm::BodyAlternativeEnd):
+        (JSC::Yarr::ByteTerm::AlternativeBegin):
+        (JSC::Yarr::ByteTerm::AlternativeDisjunction):
+        (JSC::Yarr::ByteTerm::AlternativeEnd):
+        (JSC::Yarr::ByteTerm::SubpatternBegin):
+        (JSC::Yarr::ByteTerm::SubpatternEnd):
+        (JSC::Yarr::ByteTerm::invert):
+        (JSC::Yarr::ByteTerm::capture):
+        (JSC::Yarr::ByteDisjunction::ByteDisjunction):
+        (JSC::Yarr::BytecodePattern::BytecodePattern):
+        (JSC::Yarr::BytecodePattern::~BytecodePattern):
+        * yarr/YarrJIT.cpp: Renamed from Source/JavaScriptCore/yarr/RegexJIT.cpp.
+        (JSC::Yarr::YarrGenerator::optimizeAlternative):
+        (JSC::Yarr::YarrGenerator::matchCharacterClassRange):
+        (JSC::Yarr::YarrGenerator::matchCharacterClass):
+        (JSC::Yarr::YarrGenerator::jumpIfNoAvailableInput):
+        (JSC::Yarr::YarrGenerator::jumpIfAvailableInput):
+        (JSC::Yarr::YarrGenerator::checkInput):
+        (JSC::Yarr::YarrGenerator::atEndOfInput):
+        (JSC::Yarr::YarrGenerator::notAtEndOfInput):
+        (JSC::Yarr::YarrGenerator::jumpIfCharEquals):
+        (JSC::Yarr::YarrGenerator::jumpIfCharNotEquals):
+        (JSC::Yarr::YarrGenerator::readCharacter):
+        (JSC::Yarr::YarrGenerator::storeToFrame):
+        (JSC::Yarr::YarrGenerator::storeToFrameWithPatch):
+        (JSC::Yarr::YarrGenerator::loadFromFrame):
+        (JSC::Yarr::YarrGenerator::loadFromFrameAndJump):
+        (JSC::Yarr::YarrGenerator::IndirectJumpEntry::IndirectJumpEntry):
+        (JSC::Yarr::YarrGenerator::IndirectJumpEntry::addJump):
+        (JSC::Yarr::YarrGenerator::AlternativeBacktrackRecord::AlternativeBacktrackRecord):
+        (JSC::Yarr::YarrGenerator::GenerationState::GenerationState):
+        (JSC::Yarr::YarrGenerator::GenerationState::addIndirectJumpEntry):
+        (JSC::Yarr::YarrGenerator::GenerationState::emitIndirectJumpTable):
+        (JSC::Yarr::YarrGenerator::GenerationState::incrementParenNestingLevel):
+        (JSC::Yarr::YarrGenerator::GenerationState::decrementParenNestingLevel):
+        (JSC::Yarr::YarrGenerator::GenerationState::addParenthesesTail):
+        (JSC::Yarr::YarrGenerator::GenerationState::emitParenthesesTail):
+        (JSC::Yarr::YarrGenerator::GenerationState::addJumpToNextInteration):
+        (JSC::Yarr::YarrGenerator::GenerationState::addJumpsToNextInteration):
+        (JSC::Yarr::YarrGenerator::GenerationState::addDataLabelToNextIteration):
+        (JSC::Yarr::YarrGenerator::GenerationState::linkToNextIteration):
+        (JSC::Yarr::YarrGenerator::BacktrackDestination::BacktrackDestination):
+        (JSC::Yarr::YarrGenerator::BacktrackDestination::clear):
+        (JSC::Yarr::YarrGenerator::BacktrackDestination::clearDataLabel):
+        (JSC::Yarr::YarrGenerator::BacktrackDestination::hasDestination):
+        (JSC::Yarr::YarrGenerator::BacktrackDestination::isStackOffset):
+        (JSC::Yarr::YarrGenerator::BacktrackDestination::isLabel):
+        (JSC::Yarr::YarrGenerator::BacktrackDestination::isJumpList):
+        (JSC::Yarr::YarrGenerator::BacktrackDestination::hasDataLabel):
+        (JSC::Yarr::YarrGenerator::BacktrackDestination::copyTarget):
+        (JSC::Yarr::YarrGenerator::BacktrackDestination::copyTo):
+        (JSC::Yarr::YarrGenerator::BacktrackDestination::addBacktrackJump):
+        (JSC::Yarr::YarrGenerator::BacktrackDestination::setStackOffset):
+        (JSC::Yarr::YarrGenerator::BacktrackDestination::setLabel):
+        (JSC::Yarr::YarrGenerator::BacktrackDestination::setNextBacktrackLabel):
+        (JSC::Yarr::YarrGenerator::BacktrackDestination::copyBacktrackToLabel):
+        (JSC::Yarr::YarrGenerator::BacktrackDestination::setBacktrackToLabel):
+        (JSC::Yarr::YarrGenerator::BacktrackDestination::setBacktrackJumpList):
+        (JSC::Yarr::YarrGenerator::BacktrackDestination::setBacktrackSourceLabel):
+        (JSC::Yarr::YarrGenerator::BacktrackDestination::setDataLabel):
+        (JSC::Yarr::YarrGenerator::BacktrackDestination::setSubDataLabelPtr):
+        (JSC::Yarr::YarrGenerator::BacktrackDestination::linkToNextBacktrack):
+        (JSC::Yarr::YarrGenerator::BacktrackDestination::getStackOffset):
+        (JSC::Yarr::YarrGenerator::BacktrackDestination::getLabel):
+        (JSC::Yarr::YarrGenerator::BacktrackDestination::getBacktrackJumps):
+        (JSC::Yarr::YarrGenerator::BacktrackDestination::getDataLabel):
+        (JSC::Yarr::YarrGenerator::BacktrackDestination::jumpToBacktrack):
+        (JSC::Yarr::YarrGenerator::BacktrackDestination::linkDataLabelToHereIfExists):
+        (JSC::Yarr::YarrGenerator::BacktrackDestination::plantJumpToBacktrackIfExists):
+        (JSC::Yarr::YarrGenerator::BacktrackDestination::linkAlternativeBacktracks):
+        (JSC::Yarr::YarrGenerator::BacktrackDestination::linkAlternativeBacktracksTo):
+        (JSC::Yarr::YarrGenerator::TermGenerationState::TermGenerationState):
+        (JSC::Yarr::YarrGenerator::TermGenerationState::resetAlternative):
+        (JSC::Yarr::YarrGenerator::TermGenerationState::alternativeValid):
+        (JSC::Yarr::YarrGenerator::TermGenerationState::nextAlternative):
+        (JSC::Yarr::YarrGenerator::TermGenerationState::alternative):
+        (JSC::Yarr::YarrGenerator::TermGenerationState::isLastAlternative):
+        (JSC::Yarr::YarrGenerator::TermGenerationState::resetTerm):
+        (JSC::Yarr::YarrGenerator::TermGenerationState::termValid):
+        (JSC::Yarr::YarrGenerator::TermGenerationState::nextTerm):
+        (JSC::Yarr::YarrGenerator::TermGenerationState::term):
+        (JSC::Yarr::YarrGenerator::TermGenerationState::isLastTerm):
+        (JSC::Yarr::YarrGenerator::TermGenerationState::getSubParenNum):
+        (JSC::Yarr::YarrGenerator::TermGenerationState::isMainDisjunction):
+        (JSC::Yarr::YarrGenerator::TermGenerationState::setParenthesesTail):
+        (JSC::Yarr::YarrGenerator::TermGenerationState::getParenthesesTail):
+        (JSC::Yarr::YarrGenerator::TermGenerationState::lookaheadTerm):
+        (JSC::Yarr::YarrGenerator::TermGenerationState::isSinglePatternCharacterLookaheadTerm):
+        (JSC::Yarr::YarrGenerator::TermGenerationState::inputOffset):
+        (JSC::Yarr::YarrGenerator::TermGenerationState::clearBacktrack):
+        (JSC::Yarr::YarrGenerator::TermGenerationState::jumpToBacktrack):
+        (JSC::Yarr::YarrGenerator::TermGenerationState::plantJumpToBacktrackIfExists):
+        (JSC::Yarr::YarrGenerator::TermGenerationState::linkDataLabelToBacktrackIfExists):
+        (JSC::Yarr::YarrGenerator::TermGenerationState::addBacktrackJump):
+        (JSC::Yarr::YarrGenerator::TermGenerationState::setBacktrackDataLabel):
+        (JSC::Yarr::YarrGenerator::TermGenerationState::setBackTrackStackOffset):
+        (JSC::Yarr::YarrGenerator::TermGenerationState::setBacktrackLabel):
+        (JSC::Yarr::YarrGenerator::TermGenerationState::linkAlternativeBacktracks):
+        (JSC::Yarr::YarrGenerator::TermGenerationState::linkAlternativeBacktracksTo):
+        (JSC::Yarr::YarrGenerator::TermGenerationState::setBacktrackLink):
+        (JSC::Yarr::YarrGenerator::TermGenerationState::chainBacktracks):
+        (JSC::Yarr::YarrGenerator::TermGenerationState::chainBacktrackJumps):
+        (JSC::Yarr::YarrGenerator::TermGenerationState::getBacktrackDestination):
+        (JSC::Yarr::YarrGenerator::TermGenerationState::propagateBacktrackingFrom):
+        (JSC::Yarr::YarrGenerator::ParenthesesTail::ParenthesesTail):
+        (JSC::Yarr::YarrGenerator::ParenthesesTail::processBacktracks):
+        (JSC::Yarr::YarrGenerator::ParenthesesTail::setNextIteration):
+        (JSC::Yarr::YarrGenerator::ParenthesesTail::addAfterParenJump):
+        (JSC::Yarr::YarrGenerator::ParenthesesTail::generateCode):
+        (JSC::Yarr::YarrGenerator::generateAssertionBOL):
+        (JSC::Yarr::YarrGenerator::generateAssertionEOL):
+        (JSC::Yarr::YarrGenerator::matchAssertionWordchar):
+        (JSC::Yarr::YarrGenerator::generateAssertionWordBoundary):
+        (JSC::Yarr::YarrGenerator::generatePatternCharacterSingle):
+        (JSC::Yarr::YarrGenerator::generatePatternCharacterPair):
+        (JSC::Yarr::YarrGenerator::generatePatternCharacterFixed):
+        (JSC::Yarr::YarrGenerator::generatePatternCharacterGreedy):
+        (JSC::Yarr::YarrGenerator::generatePatternCharacterNonGreedy):
+        (JSC::Yarr::YarrGenerator::generateCharacterClassSingle):
+        (JSC::Yarr::YarrGenerator::generateCharacterClassFixed):
+        (JSC::Yarr::YarrGenerator::generateCharacterClassGreedy):
+        (JSC::Yarr::YarrGenerator::generateCharacterClassNonGreedy):
+        (JSC::Yarr::YarrGenerator::generateParenthesesDisjunction):
+        (JSC::Yarr::YarrGenerator::generateParenthesesSingle):
+        (JSC::Yarr::YarrGenerator::generateParenthesesGreedyNoBacktrack):
+        (JSC::Yarr::YarrGenerator::generateParentheticalAssertion):
+        (JSC::Yarr::YarrGenerator::generateTerm):
+        (JSC::Yarr::YarrGenerator::generateDisjunction):
+        (JSC::Yarr::YarrGenerator::generateEnter):
+        (JSC::Yarr::YarrGenerator::generateReturn):
+        (JSC::Yarr::YarrGenerator::YarrGenerator):
+        (JSC::Yarr::YarrGenerator::generate):
+        (JSC::Yarr::YarrGenerator::compile):
+        (JSC::Yarr::jitCompile):
+        * yarr/YarrJIT.h: Renamed from Source/JavaScriptCore/yarr/RegexJIT.h.
+        (JSC::Yarr::YarrCodeBlock::YarrCodeBlock):
+        (JSC::Yarr::YarrCodeBlock::~YarrCodeBlock):
+        (JSC::Yarr::YarrCodeBlock::setFallBack):
+        (JSC::Yarr::YarrCodeBlock::isFallBack):
+        (JSC::Yarr::YarrCodeBlock::set):
+        (JSC::Yarr::YarrCodeBlock::execute):
+        (JSC::Yarr::YarrCodeBlock::getAddr):
+        (JSC::Yarr::execute):
+        * yarr/YarrParser.h: Renamed from Source/JavaScriptCore/yarr/RegexParser.h.
+        (JSC::Yarr::Parser::CharacterClassParserDelegate::CharacterClassParserDelegate):
+        (JSC::Yarr::Parser::CharacterClassParserDelegate::begin):
+        (JSC::Yarr::Parser::CharacterClassParserDelegate::atomPatternCharacter):
+        (JSC::Yarr::Parser::CharacterClassParserDelegate::atomBuiltInCharacterClass):
+        (JSC::Yarr::Parser::CharacterClassParserDelegate::end):
+        (JSC::Yarr::Parser::CharacterClassParserDelegate::assertionWordBoundary):
+        (JSC::Yarr::Parser::CharacterClassParserDelegate::atomBackReference):
+        (JSC::Yarr::Parser::Parser):
+        (JSC::Yarr::Parser::parseEscape):
+        (JSC::Yarr::Parser::parseAtomEscape):
+        (JSC::Yarr::Parser::parseCharacterClassEscape):
+        (JSC::Yarr::Parser::parseCharacterClass):
+        (JSC::Yarr::Parser::parseParenthesesBegin):
+        (JSC::Yarr::Parser::parseParenthesesEnd):
+        (JSC::Yarr::Parser::parseQuantifier):
+        (JSC::Yarr::Parser::parseTokens):
+        (JSC::Yarr::Parser::parse):
+        (JSC::Yarr::Parser::saveState):
+        (JSC::Yarr::Parser::restoreState):
+        (JSC::Yarr::Parser::atEndOfPattern):
+        (JSC::Yarr::Parser::peek):
+        (JSC::Yarr::Parser::peekIsDigit):
+        (JSC::Yarr::Parser::peekDigit):
+        (JSC::Yarr::Parser::consume):
+        (JSC::Yarr::Parser::consumeDigit):
+        (JSC::Yarr::Parser::consumeNumber):
+        (JSC::Yarr::Parser::consumeOctal):
+        (JSC::Yarr::Parser::tryConsume):
+        (JSC::Yarr::Parser::tryConsumeHex):
+        (JSC::Yarr::parse):
+        * yarr/YarrPattern.cpp: Renamed from Source/JavaScriptCore/yarr/RegexPattern.cpp.
+        (JSC::Yarr::CharacterClassConstructor::CharacterClassConstructor):
+        (JSC::Yarr::CharacterClassConstructor::reset):
+        (JSC::Yarr::CharacterClassConstructor::append):
+        (JSC::Yarr::CharacterClassConstructor::putChar):
+        (JSC::Yarr::CharacterClassConstructor::isUnicodeUpper):
+        (JSC::Yarr::CharacterClassConstructor::isUnicodeLower):
+        (JSC::Yarr::CharacterClassConstructor::putRange):
+        (JSC::Yarr::CharacterClassConstructor::charClass):
+        (JSC::Yarr::CharacterClassConstructor::addSorted):
+        (JSC::Yarr::CharacterClassConstructor::addSortedRange):
+        (JSC::Yarr::BeginCharHelper::BeginCharHelper):
+        (JSC::Yarr::BeginCharHelper::addBeginChar):
+        (JSC::Yarr::BeginCharHelper::merge):
+        (JSC::Yarr::BeginCharHelper::addCharacter):
+        (JSC::Yarr::BeginCharHelper::linkHotTerms):
+        (JSC::Yarr::YarrPatternConstructor::YarrPatternConstructor):
+        (JSC::Yarr::YarrPatternConstructor::~YarrPatternConstructor):
+        (JSC::Yarr::YarrPatternConstructor::reset):
+        (JSC::Yarr::YarrPatternConstructor::assertionBOL):
+        (JSC::Yarr::YarrPatternConstructor::assertionEOL):
+        (JSC::Yarr::YarrPatternConstructor::assertionWordBoundary):
+        (JSC::Yarr::YarrPatternConstructor::atomPatternCharacter):
+        (JSC::Yarr::YarrPatternConstructor::atomBuiltInCharacterClass):
+        (JSC::Yarr::YarrPatternConstructor::atomCharacterClassBegin):
+        (JSC::Yarr::YarrPatternConstructor::atomCharacterClassAtom):
+        (JSC::Yarr::YarrPatternConstructor::atomCharacterClassRange):
+        (JSC::Yarr::YarrPatternConstructor::atomCharacterClassBuiltIn):
+        (JSC::Yarr::YarrPatternConstructor::atomCharacterClassEnd):
+        (JSC::Yarr::YarrPatternConstructor::atomParenthesesSubpatternBegin):
+        (JSC::Yarr::YarrPatternConstructor::atomParentheticalAssertionBegin):
+        (JSC::Yarr::YarrPatternConstructor::atomParenthesesEnd):
+        (JSC::Yarr::YarrPatternConstructor::atomBackReference):
+        (JSC::Yarr::YarrPatternConstructor::copyDisjunction):
+        (JSC::Yarr::YarrPatternConstructor::copyTerm):
+        (JSC::Yarr::YarrPatternConstructor::quantifyAtom):
+        (JSC::Yarr::YarrPatternConstructor::disjunction):
+        (JSC::Yarr::YarrPatternConstructor::regexBegin):
+        (JSC::Yarr::YarrPatternConstructor::regexEnd):
+        (JSC::Yarr::YarrPatternConstructor::regexError):
+        (JSC::Yarr::YarrPatternConstructor::setupAlternativeOffsets):
+        (JSC::Yarr::YarrPatternConstructor::setupDisjunctionOffsets):
+        (JSC::Yarr::YarrPatternConstructor::setupOffsets):
+        (JSC::Yarr::YarrPatternConstructor::checkForTerminalParentheses):
+        (JSC::Yarr::YarrPatternConstructor::optimizeBOL):
+        (JSC::Yarr::YarrPatternConstructor::addBeginTerm):
+        (JSC::Yarr::YarrPatternConstructor::setupDisjunctionBeginTerms):
+        (JSC::Yarr::YarrPatternConstructor::setupAlternativeBeginTerms):
+        (JSC::Yarr::YarrPatternConstructor::setupBeginChars):
+        (JSC::Yarr::compile):
+        (JSC::Yarr::YarrPattern::YarrPattern):
+        * yarr/YarrPattern.h: Renamed from Source/JavaScriptCore/yarr/RegexPattern.h.
+        (JSC::Yarr::CharacterRange::CharacterRange):
+        (JSC::Yarr::CharacterClassTable::create):
+        (JSC::Yarr::CharacterClassTable::CharacterClassTable):
+        (JSC::Yarr::CharacterClass::CharacterClass):
+        (JSC::Yarr::PatternTerm::PatternTerm):
+        (JSC::Yarr::PatternTerm::ForwardReference):
+        (JSC::Yarr::PatternTerm::BOL):
+        (JSC::Yarr::PatternTerm::EOL):
+        (JSC::Yarr::PatternTerm::WordBoundary):
+        (JSC::Yarr::PatternTerm::invert):
+        (JSC::Yarr::PatternTerm::capture):
+        (JSC::Yarr::PatternTerm::quantify):
+        (JSC::Yarr::PatternAlternative::PatternAlternative):
+        (JSC::Yarr::PatternAlternative::lastTerm):
+        (JSC::Yarr::PatternAlternative::removeLastTerm):
+        (JSC::Yarr::PatternAlternative::setOnceThrough):
+        (JSC::Yarr::PatternAlternative::onceThrough):
+        (JSC::Yarr::PatternDisjunction::PatternDisjunction):
+        (JSC::Yarr::PatternDisjunction::~PatternDisjunction):
+        (JSC::Yarr::PatternDisjunction::addNewAlternative):
+        (JSC::Yarr::TermChain::TermChain):
+        (JSC::Yarr::BeginChar::BeginChar):
+        (JSC::Yarr::YarrPattern::~YarrPattern):
+        (JSC::Yarr::YarrPattern::reset):
+        (JSC::Yarr::YarrPattern::containsIllegalBackReference):
+        (JSC::Yarr::YarrPattern::newlineCharacterClass):
+        (JSC::Yarr::YarrPattern::digitsCharacterClass):
+        (JSC::Yarr::YarrPattern::spacesCharacterClass):
+        (JSC::Yarr::YarrPattern::wordcharCharacterClass):
+        (JSC::Yarr::YarrPattern::nondigitsCharacterClass):
+        (JSC::Yarr::YarrPattern::nonspacesCharacterClass):
+        (JSC::Yarr::YarrPattern::nonwordcharCharacterClass):
+
 2011-01-10  Gavin Barraclough  <barraclough@apple.com>
 
         Windows build fix.
index 62ae602a13a75e659cfb3ed3b2c54bc2e9d2223d..bee8ed40d13edd7001fd3483e6f474ebec1c39f0 100644 (file)
@@ -552,13 +552,13 @@ javascriptcore_sources += \
        Source/JavaScriptCore/wtf/VMTags.h \
        Source/JavaScriptCore/wtf/WTFThreadData.cpp \
        Source/JavaScriptCore/wtf/WTFThreadData.h \
-       Source/JavaScriptCore/yarr/RegexInterpreter.cpp \
-       Source/JavaScriptCore/yarr/RegexInterpreter.h \
-       Source/JavaScriptCore/yarr/RegexJIT.cpp \
-       Source/JavaScriptCore/yarr/RegexJIT.h \
-       Source/JavaScriptCore/yarr/RegexParser.h \
-       Source/JavaScriptCore/yarr/RegexPattern.cpp \
-       Source/JavaScriptCore/yarr/RegexPattern.h \
+       Source/JavaScriptCore/yarr/YarrInterpreter.cpp \
+       Source/JavaScriptCore/yarr/YarrInterpreter.h \
+       Source/JavaScriptCore/yarr/YarrJIT.cpp \
+       Source/JavaScriptCore/yarr/YarrJIT.h \
+       Source/JavaScriptCore/yarr/YarrParser.h \
+       Source/JavaScriptCore/yarr/YarrPattern.cpp \
+       Source/JavaScriptCore/yarr/YarrPattern.h \
        Source/JavaScriptCore/yarr/YarrSyntaxChecker.cpp \
        Source/JavaScriptCore/yarr/YarrSyntaxChecker.h
 
index 3d8ae87e53508f210c251bd195958ee56fd2bf60..84428849a204ac7b9ad86cf8d5ec3b63c77e4411 100644 (file)
             'wtf/win/MainThreadWin.cpp',
             'wtf/win/OwnPtrWin.cpp',
             'wtf/wx/MainThreadWx.cpp',
-            'yarr/RegexInterpreter.cpp',
-            'yarr/RegexInterpreter.h',
-            'yarr/RegexJIT.cpp',
-            'yarr/RegexJIT.h',
-            'yarr/RegexParser.h',
-            'yarr/RegexPattern.cpp',
-            'yarr/RegexPattern.h',
+            'yarr/YarrInterpreter.cpp',
+            'yarr/YarrInterpreter.h',
+            'yarr/YarrJIT.cpp',
+            'yarr/YarrJIT.h',
+            'yarr/YarrParser.h',
+            'yarr/YarrPattern.cpp',
+            'yarr/YarrPattern.h',
             'yarr/YarrSyntaxChecker.cpp',
             'yarr/YarrSyntaxChecker.h',
         ]
index 179ef01ed33bd465b39f83bd2112182af9a729b9..ab475b2be263185e156c1f63670da9b4b3872668 100644 (file)
@@ -208,9 +208,9 @@ SOURCES += \
     runtime/Structure.cpp \
     runtime/TimeoutChecker.cpp \
     runtime/UString.cpp \
-    yarr/RegexPattern.cpp \
-    yarr/RegexInterpreter.cpp \
-    yarr/RegexJIT.cpp \
+    yarr/YarrPattern.cpp \
+    yarr/YarrInterpreter.cpp \
+    yarr/YarrJIT.cpp \
     yarr/YarrSyntaxChecker.cpp
 
 # Generated files, simply list them for JavaScriptCore
index 2478ea57a43f56a767f15ff24c782b138adc3b1d..deaba100269706cb92effe728af90db9ee8ff6d5 100644 (file)
                        Name="yarr"
                        >
                        <File
-                               RelativePath="..\..\yarr\RegexInterpreter.cpp"
+                               RelativePath="..\..\yarr\YarrInterpreter.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\..\yarr\RegexInterpreter.h"
+                               RelativePath="..\..\yarr\YarrInterpreter.h"
                                >
                        </File>
                        <File
-                               RelativePath="..\..\yarr\RegexJIT.cpp"
+                               RelativePath="..\..\yarr\YarrJIT.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\..\yarr\RegexJIT.h"
+                               RelativePath="..\..\yarr\YarrJIT.h"
                                >
                        </File>
                        <File
-                               RelativePath="..\..\yarr\RegexParser.h"
+                               RelativePath="..\..\yarr\YarrParser.h"
                                >
                        </File>
                        <File
-                               RelativePath="..\..\yarr\RegexPattern.cpp"
+                               RelativePath="..\..\yarr\YarrPattern.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\..\yarr\RegexPattern.h"
+                               RelativePath="..\..\yarr\YarrPattern.h"
                                >
                        </File>
                        <File
index 7a96e454d4b6061dd524c58db0f711b51c0a4800..f2e6d66f15f648974f0fa34042cb40565ef7029d 100644 (file)
                86676D5211FED9BC004B6863 /* BumpPointerAllocator.h in Headers */ = {isa = PBXBuildFile; fileRef = 86676D4D11FED55D004B6863 /* BumpPointerAllocator.h */; settings = {ATTRIBUTES = (Private, ); }; };
                86704B4212DB8A8100A9FE7B /* YarrSyntaxChecker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 86704B4012DB8A8100A9FE7B /* YarrSyntaxChecker.cpp */; };
                86704B4312DB8A8100A9FE7B /* YarrSyntaxChecker.h in Headers */ = {isa = PBXBuildFile; fileRef = 86704B4112DB8A8100A9FE7B /* YarrSyntaxChecker.h */; };
+               86704B8412DBA33700A9FE7B /* YarrInterpreter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 86704B7D12DBA33700A9FE7B /* YarrInterpreter.cpp */; };
+               86704B8512DBA33700A9FE7B /* YarrInterpreter.h in Headers */ = {isa = PBXBuildFile; fileRef = 86704B7E12DBA33700A9FE7B /* YarrInterpreter.h */; };
+               86704B8612DBA33700A9FE7B /* YarrJIT.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 86704B7F12DBA33700A9FE7B /* YarrJIT.cpp */; };
+               86704B8712DBA33700A9FE7B /* YarrJIT.h in Headers */ = {isa = PBXBuildFile; fileRef = 86704B8012DBA33700A9FE7B /* YarrJIT.h */; };
+               86704B8812DBA33700A9FE7B /* YarrParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 86704B8112DBA33700A9FE7B /* YarrParser.h */; };
+               86704B8912DBA33700A9FE7B /* YarrPattern.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 86704B8212DBA33700A9FE7B /* YarrPattern.cpp */; };
+               86704B8A12DBA33700A9FE7B /* YarrPattern.h in Headers */ = {isa = PBXBuildFile; fileRef = 86704B8312DBA33700A9FE7B /* YarrPattern.h */; };
                868BFA08117CEFD100B908B1 /* AtomicString.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 868BFA00117CEFD100B908B1 /* AtomicString.cpp */; };
                868BFA09117CEFD100B908B1 /* AtomicString.h in Headers */ = {isa = PBXBuildFile; fileRef = 868BFA01117CEFD100B908B1 /* AtomicString.h */; settings = {ATTRIBUTES = (Private, ); }; };
                868BFA0A117CEFD100B908B1 /* AtomicStringImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = 868BFA02117CEFD100B908B1 /* AtomicStringImpl.h */; settings = {ATTRIBUTES = (Private, ); }; };
                868BFA17117CF19900B908B1 /* WTFString.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 868BFA15117CF19900B908B1 /* WTFString.cpp */; };
                868BFA18117CF19900B908B1 /* WTFString.h in Headers */ = {isa = PBXBuildFile; fileRef = 868BFA16117CF19900B908B1 /* WTFString.h */; settings = {ATTRIBUTES = (Private, ); }; };
                868BFA60117D048200B908B1 /* StaticConstructors.h in Headers */ = {isa = PBXBuildFile; fileRef = 868BFA5F117D048200B908B1 /* StaticConstructors.h */; settings = {ATTRIBUTES = (Private, ); }; };
-               868D81A212C428CE0093DC84 /* RegexPattern.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 868D81A112C428CE0093DC84 /* RegexPattern.cpp */; };
                8690231512092D5C00630AF9 /* PageReservation.h in Headers */ = {isa = PBXBuildFile; fileRef = 8690231412092D5C00630AF9 /* PageReservation.h */; settings = {ATTRIBUTES = (Private, ); }; };
                869D04AF1193B54D00803475 /* CachedTranscendentalFunction.h in Headers */ = {isa = PBXBuildFile; fileRef = 869D04AE1193B54D00803475 /* CachedTranscendentalFunction.h */; settings = {ATTRIBUTES = (Private, ); }; };
                869EBCB70E8C6D4A008722CC /* ResultType.h in Headers */ = {isa = PBXBuildFile; fileRef = 869EBCB60E8C6D4A008722CC /* ResultType.h */; settings = {ATTRIBUTES = (Private, ); }; };
                86DB64640F95C6FC00D7D921 /* ExecutableAllocatorFixedVMPool.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 86DB64630F95C6FC00D7D921 /* ExecutableAllocatorFixedVMPool.cpp */; };
                86E116B10FE75AC800B512BC /* CodeLocation.h in Headers */ = {isa = PBXBuildFile; fileRef = 86E116B00FE75AC800B512BC /* CodeLocation.h */; };
                86E85539111B9968001AF51E /* JSStringBuilder.h in Headers */ = {isa = PBXBuildFile; fileRef = 86E85538111B9968001AF51E /* JSStringBuilder.h */; };
-               86EAC4970F93E8D1008EC948 /* RegexInterpreter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 86EAC48F0F93E8D1008EC948 /* RegexInterpreter.cpp */; };
-               86EAC4980F93E8D1008EC948 /* RegexInterpreter.h in Headers */ = {isa = PBXBuildFile; fileRef = 86EAC4900F93E8D1008EC948 /* RegexInterpreter.h */; };
-               86EAC4990F93E8D1008EC948 /* RegexJIT.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 86EAC4910F93E8D1008EC948 /* RegexJIT.cpp */; };
-               86EAC49A0F93E8D1008EC948 /* RegexJIT.h in Headers */ = {isa = PBXBuildFile; fileRef = 86EAC4920F93E8D1008EC948 /* RegexJIT.h */; };
-               86EAC49B0F93E8D1008EC948 /* RegexParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 86EAC4930F93E8D1008EC948 /* RegexParser.h */; };
-               86EAC49C0F93E8D1008EC948 /* RegexPattern.h in Headers */ = {isa = PBXBuildFile; fileRef = 86EAC4940F93E8D1008EC948 /* RegexPattern.h */; };
                86F38859121130CA007A7CE3 /* AtomicStringHash.h in Headers */ = {isa = PBXBuildFile; fileRef = 86F38858121130CA007A7CE3 /* AtomicStringHash.h */; settings = {ATTRIBUTES = (Private, ); }; };
                90213E3D123A40C200D422F3 /* MemoryStatistics.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 90213E3B123A40C200D422F3 /* MemoryStatistics.cpp */; };
                90213E3E123A40C200D422F3 /* MemoryStatistics.h in Headers */ = {isa = PBXBuildFile; fileRef = 90213E3C123A40C200D422F3 /* MemoryStatistics.h */; settings = {ATTRIBUTES = (Private, ); }; };
                86676D4D11FED55D004B6863 /* BumpPointerAllocator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BumpPointerAllocator.h; sourceTree = "<group>"; };
                86704B4012DB8A8100A9FE7B /* YarrSyntaxChecker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = YarrSyntaxChecker.cpp; path = yarr/YarrSyntaxChecker.cpp; sourceTree = "<group>"; };
                86704B4112DB8A8100A9FE7B /* YarrSyntaxChecker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = YarrSyntaxChecker.h; path = yarr/YarrSyntaxChecker.h; sourceTree = "<group>"; };
+               86704B7D12DBA33700A9FE7B /* YarrInterpreter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = YarrInterpreter.cpp; path = yarr/YarrInterpreter.cpp; sourceTree = "<group>"; };
+               86704B7E12DBA33700A9FE7B /* YarrInterpreter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = YarrInterpreter.h; path = yarr/YarrInterpreter.h; sourceTree = "<group>"; };
+               86704B7F12DBA33700A9FE7B /* YarrJIT.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = YarrJIT.cpp; path = yarr/YarrJIT.cpp; sourceTree = "<group>"; };
+               86704B8012DBA33700A9FE7B /* YarrJIT.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = YarrJIT.h; path = yarr/YarrJIT.h; sourceTree = "<group>"; };
+               86704B8112DBA33700A9FE7B /* YarrParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = YarrParser.h; path = yarr/YarrParser.h; sourceTree = "<group>"; };
+               86704B8212DBA33700A9FE7B /* YarrPattern.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = YarrPattern.cpp; path = yarr/YarrPattern.cpp; sourceTree = "<group>"; };
+               86704B8312DBA33700A9FE7B /* YarrPattern.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = YarrPattern.h; path = yarr/YarrPattern.h; sourceTree = "<group>"; };
                867FC35F11B763950025105E /* JavaScriptCore.JSVALUE32_64only.exp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.exports; path = JavaScriptCore.JSVALUE32_64only.exp; sourceTree = "<group>"; };
                867FC36011B763950025105E /* JavaScriptCore.JSVALUE32only.exp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.exports; path = JavaScriptCore.JSVALUE32only.exp; sourceTree = "<group>"; };
                867FC36111B763950025105E /* JavaScriptCore.JSVALUE64only.exp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.exports; path = JavaScriptCore.JSVALUE64only.exp; sourceTree = "<group>"; };
                868BFA15117CF19900B908B1 /* WTFString.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WTFString.cpp; path = text/WTFString.cpp; sourceTree = "<group>"; };
                868BFA16117CF19900B908B1 /* WTFString.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WTFString.h; path = text/WTFString.h; sourceTree = "<group>"; };
                868BFA5F117D048200B908B1 /* StaticConstructors.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StaticConstructors.h; sourceTree = "<group>"; };
-               868D81A112C428CE0093DC84 /* RegexPattern.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegexPattern.cpp; path = yarr/RegexPattern.cpp; sourceTree = "<group>"; };
                8690231412092D5C00630AF9 /* PageReservation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PageReservation.h; sourceTree = "<group>"; };
                869D04AE1193B54D00803475 /* CachedTranscendentalFunction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CachedTranscendentalFunction.h; sourceTree = "<group>"; };
                869EBCB60E8C6D4A008722CC /* ResultType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ResultType.h; sourceTree = "<group>"; };
                86DB64630F95C6FC00D7D921 /* ExecutableAllocatorFixedVMPool.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ExecutableAllocatorFixedVMPool.cpp; sourceTree = "<group>"; };
                86E116B00FE75AC800B512BC /* CodeLocation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CodeLocation.h; sourceTree = "<group>"; };
                86E85538111B9968001AF51E /* JSStringBuilder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSStringBuilder.h; sourceTree = "<group>"; };
-               86EAC48F0F93E8D1008EC948 /* RegexInterpreter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegexInterpreter.cpp; path = yarr/RegexInterpreter.cpp; sourceTree = "<group>"; };
-               86EAC4900F93E8D1008EC948 /* RegexInterpreter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegexInterpreter.h; path = yarr/RegexInterpreter.h; sourceTree = "<group>"; };
-               86EAC4910F93E8D1008EC948 /* RegexJIT.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegexJIT.cpp; path = yarr/RegexJIT.cpp; sourceTree = "<group>"; };
-               86EAC4920F93E8D1008EC948 /* RegexJIT.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegexJIT.h; path = yarr/RegexJIT.h; sourceTree = "<group>"; };
-               86EAC4930F93E8D1008EC948 /* RegexParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegexParser.h; path = yarr/RegexParser.h; sourceTree = "<group>"; };
-               86EAC4940F93E8D1008EC948 /* RegexPattern.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegexPattern.h; path = yarr/RegexPattern.h; sourceTree = "<group>"; };
                86F38858121130CA007A7CE3 /* AtomicStringHash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AtomicStringHash.h; path = text/AtomicStringHash.h; sourceTree = "<group>"; };
                90213E3B123A40C200D422F3 /* MemoryStatistics.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MemoryStatistics.cpp; sourceTree = "<group>"; };
                90213E3C123A40C200D422F3 /* MemoryStatistics.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MemoryStatistics.h; sourceTree = "<group>"; };
                86EAC48C0F93E8B9008EC948 /* yarr */ = {
                        isa = PBXGroup;
                        children = (
+                               86704B7D12DBA33700A9FE7B /* YarrInterpreter.cpp */,
+                               86704B7E12DBA33700A9FE7B /* YarrInterpreter.h */,
+                               86704B7F12DBA33700A9FE7B /* YarrJIT.cpp */,
+                               86704B8012DBA33700A9FE7B /* YarrJIT.h */,
+                               86704B8112DBA33700A9FE7B /* YarrParser.h */,
+                               86704B8212DBA33700A9FE7B /* YarrPattern.cpp */,
+                               86704B8312DBA33700A9FE7B /* YarrPattern.h */,
                                86704B4012DB8A8100A9FE7B /* YarrSyntaxChecker.cpp */,
                                86704B4112DB8A8100A9FE7B /* YarrSyntaxChecker.h */,
-                               86EAC48F0F93E8D1008EC948 /* RegexInterpreter.cpp */,
-                               86EAC4900F93E8D1008EC948 /* RegexInterpreter.h */,
-                               86EAC4910F93E8D1008EC948 /* RegexJIT.cpp */,
-                               86EAC4920F93E8D1008EC948 /* RegexJIT.h */,
-                               86EAC4930F93E8D1008EC948 /* RegexParser.h */,
-                               86EAC4940F93E8D1008EC948 /* RegexPattern.h */,
-                               868D81A112C428CE0093DC84 /* RegexPattern.cpp */,
                        );
                        name = yarr;
                        sourceTree = "<group>";
                                90D3469C0E285280009492EE /* RefCountedLeakCounter.h in Headers */,
                                BC18C4580E16F5CD00B34460 /* RefPtr.h in Headers */,
                                BC18C4590E16F5CD00B34460 /* RefPtrHashMap.h in Headers */,
-                               86EAC4980F93E8D1008EC948 /* RegexInterpreter.h in Headers */,
-                               86EAC49A0F93E8D1008EC948 /* RegexJIT.h in Headers */,
                                BC18C45A0E16F5CD00B34460 /* RegExp.h in Headers */,
-                               86EAC49B0F93E8D1008EC948 /* RegexParser.h in Headers */,
-                               86EAC49C0F93E8D1008EC948 /* RegexPattern.h in Headers */,
                                A1712B3F11C7B228007A5315 /* RegExpCache.h in Headers */,
                                BCD202C20E1706A7002C7E82 /* RegExpConstructor.h in Headers */,
                                BCD202D60E170708002C7E82 /* RegExpConstructor.lut.h in Headers */,
                                5135FAF212D26ACE003C083B /* Decoder.h in Headers */,
                                5135FAF312D26AD1003C083B /* Encoder.h in Headers */,
                                86704B4312DB8A8100A9FE7B /* YarrSyntaxChecker.h in Headers */,
+                               86704B8512DBA33700A9FE7B /* YarrInterpreter.h in Headers */,
+                               86704B8712DBA33700A9FE7B /* YarrJIT.h in Headers */,
+                               86704B8812DBA33700A9FE7B /* YarrParser.h in Headers */,
+                               86704B8A12DBA33700A9FE7B /* YarrPattern.h in Headers */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
                                14469DE9107EC7E700650446 /* PrototypeFunction.cpp in Sources */,
                                088FA5BB0EF76D4300578E6F /* RandomNumber.cpp in Sources */,
                                905B02AE0E28640F006DF882 /* RefCountedLeakCounter.cpp in Sources */,
-                               86EAC4970F93E8D1008EC948 /* RegexInterpreter.cpp in Sources */,
-                               86EAC4990F93E8D1008EC948 /* RegexJIT.cpp in Sources */,
                                14280841107EC0930013E7B2 /* RegExp.cpp in Sources */,
-                               868D81A212C428CE0093DC84 /* RegexPattern.cpp in Sources */,
                                A1712B3B11C7B212007A5315 /* RegExpCache.cpp in Sources */,
                                14280842107EC0930013E7B2 /* RegExpConstructor.cpp in Sources */,
                                14280843107EC0930013E7B2 /* RegExpObject.cpp in Sources */,
                                868BFA17117CF19900B908B1 /* WTFString.cpp in Sources */,
                                86D08D5311793613006E5ED0 /* WTFThreadData.cpp in Sources */,
                                86704B4212DB8A8100A9FE7B /* YarrSyntaxChecker.cpp in Sources */,
+                               86704B8412DBA33700A9FE7B /* YarrInterpreter.cpp in Sources */,
+                               86704B8612DBA33700A9FE7B /* YarrJIT.cpp in Sources */,
+                               86704B8912DBA33700A9FE7B /* YarrPattern.cpp in Sources */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
index b4a6440dbcf2adc53d3491fe61530bf99de30afe..6fb202f42965f7ddc03c97ba130849d7a8f2ae89 100644 (file)
@@ -229,8 +229,7 @@ namespace JSC {
         int maxReentryDepth;
 
         RegExpCache* m_regExpCache;
-
-        BumpPointerAllocator m_regexAllocator;
+        BumpPointerAllocator m_regExpAllocator;
 
 #if ENABLE(REGEXP_TRACING)
         typedef ListHashSet<RefPtr<RegExp> > RTTraceList;
index 664a7fb3318009eee9d27c36826a2bdff7dadb75..4ab59bda05fa9c0550f34b73a487c25bc89b35e8 100644 (file)
 
 #include "config.h"
 #include "RegExp.h"
+
 #include "Lexer.h"
+#include "yarr/YarrInterpreter.h"
+#include "yarr/YarrJIT.h"
+#include "yarr/YarrPattern.h"
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <wtf/Assertions.h>
 #include <wtf/OwnArrayPtr.h>
 
-#include "yarr/RegexJIT.h"
-#include "yarr/RegexInterpreter.h"
-#include "yarr/RegexPattern.h"
 
 namespace JSC {
 
 struct RegExpRepresentation {
 #if ENABLE(YARR_JIT)
-    Yarr::RegexCodeBlock m_regExpJITCode;
+    Yarr::YarrCodeBlock m_regExpJITCode;
 #endif
     OwnPtr<Yarr::BytecodePattern> m_regExpBytecode;
 };
@@ -82,7 +83,7 @@ PassRefPtr<RegExp> RegExp::create(JSGlobalData* globalData, const UString& patte
 
 RegExp::RegExpState RegExp::compile(JSGlobalData* globalData)
 {
-    Yarr::RegexPattern pattern(m_patternString, ignoreCase(), multiline(), &m_constructionError);
+    Yarr::YarrPattern pattern(m_patternString, ignoreCase(), multiline(), &m_constructionError);
     if (m_constructionError)
         return ParseError;
 
@@ -92,7 +93,7 @@ RegExp::RegExpState RegExp::compile(JSGlobalData* globalData)
 
 #if ENABLE(YARR_JIT)
     if (!pattern.m_containsBackreferences && globalData->canUseJIT()) {
-        Yarr::jitCompileRegex(pattern, globalData, m_representation->m_regExpJITCode);
+        Yarr::jitCompile(pattern, globalData, m_representation->m_regExpJITCode);
 #if ENABLE(YARR_JIT_DEBUG)
         if (!m_representation->m_regExpJITCode.isFallBack())
             res = JITCode;
@@ -105,7 +106,7 @@ RegExp::RegExpState RegExp::compile(JSGlobalData* globalData)
     }
 #endif
 
-    m_representation->m_regExpBytecode = Yarr::byteCompileRegex(pattern, &globalData->m_regexAllocator);
+    m_representation->m_regExpBytecode = Yarr::byteCompile(pattern, &globalData->m_regExpAllocator);
 
     return res;
 }
@@ -144,13 +145,13 @@ int RegExp::match(const UString& s, int startOffset, Vector<int, 32>* ovector)
         int result;
 #if ENABLE(YARR_JIT)
         if (m_state == JITCode) {
-            result = Yarr::executeRegex(m_representation->m_regExpJITCode, s.characters(), startOffset, s.length(), offsetVector);
+            result = Yarr::execute(m_representation->m_regExpJITCode, s.characters(), startOffset, s.length(), offsetVector);
 #if ENABLE(YARR_JIT_DEBUG)
             matchCompareWithInterpreter(s, startOffset, offsetVector, result);
 #endif
         } else
 #endif
-            result = Yarr::interpretRegex(m_representation->m_regExpBytecode.get(), s.characters(), startOffset, s.length(), offsetVector);
+            result = Yarr::interpret(m_representation->m_regExpBytecode.get(), s.characters(), startOffset, s.length(), offsetVector);
         ASSERT(result >= -1);
 
 #if ENABLE(REGEXP_TRACING)
@@ -181,7 +182,7 @@ void RegExp::matchCompareWithInterpreter(const UString& s, int startOffset, int*
     for (unsigned j = 0, i = 0; i < m_numSubpatterns + 1; j += 2, i++)
         interpreterOffsetVector[j] = -1;
 
-    interpreterResult = Yarr::interpretRegex(m_representation->m_regExpBytecode.get(), s.characters(), startOffset, s.length(), interpreterOffsetVector);
+    interpreterResult = Yarr::interpret(m_representation->m_regExpBytecode.get(), s.characters(), startOffset, s.length(), interpreterOffsetVector);
 
     if (jitResult != interpreterResult)
         differences++;
@@ -230,7 +231,7 @@ void RegExp::matchCompareWithInterpreter(const UString& s, int startOffset, int*
         snprintf(formattedPattern, 41, (pattLen <= 38) ? "/%.38s/" : "/%.36s...", rawPattern);
 
 #if ENABLE(YARR_JIT)
-        Yarr::RegexCodeBlock& codeBlock = m_representation->m_regExpJITCode;
+        Yarr::YarrCodeBlock& codeBlock = m_representation->m_regExpJITCode;
 
         char jitAddr[20];
         if (m_state == JITCode)
similarity index 98%
rename from Source/JavaScriptCore/yarr/RegexInterpreter.cpp
rename to Source/JavaScriptCore/yarr/YarrInterpreter.cpp
index 7769922c57a013ea73195b825b0fdaeb5fea4a6a..a4ae88f0b8b6a31dfe55c873dc8d783ac31411a2 100644 (file)
@@ -25,9 +25,9 @@
  */
 
 #include "config.h"
-#include "RegexInterpreter.h"
+#include "YarrInterpreter.h"
 
-#include "RegexPattern.h"
+#include "YarrPattern.h"
 #include <wtf/BumpPointerAllocator.h>
 
 #ifndef NDEBUG
@@ -1433,7 +1433,7 @@ class ByteCompiler {
     };
 
 public:
-    ByteCompiler(RegexPattern& pattern)
+    ByteCompiler(YarrPattern& pattern)
         : m_pattern(pattern)
     {
         m_currentAlternativeIndex = 0;
@@ -1825,14 +1825,14 @@ public:
                         if (term.quantityType == QuantifierFixedCount)
                             disjunctionAlreadyCheckedCount = term.parentheses.disjunction->m_minimumSize;
                         else
-                            alternativeFrameLocation += RegexStackSpaceForBackTrackInfoParenthesesOnce;
+                            alternativeFrameLocation += YarrStackSpaceForBackTrackInfoParenthesesOnce;
                         unsigned delegateEndInputOffset = term.inputPosition - currentCountAlreadyChecked;
                         atomParenthesesOnceBegin(term.parentheses.subpatternId, term.capture(), delegateEndInputOffset - disjunctionAlreadyCheckedCount, term.frameLocation, alternativeFrameLocation);
                         emitDisjunction(term.parentheses.disjunction, currentCountAlreadyChecked, disjunctionAlreadyCheckedCount);
                         atomParenthesesOnceEnd(delegateEndInputOffset, term.frameLocation, term.quantityCount, term.quantityType);
                     } else if (term.parentheses.isTerminal) {
                         unsigned delegateEndInputOffset = term.inputPosition - currentCountAlreadyChecked;
-                        atomParenthesesTerminalBegin(term.parentheses.subpatternId, term.capture(), delegateEndInputOffset - disjunctionAlreadyCheckedCount, term.frameLocation, term.frameLocation + RegexStackSpaceForBackTrackInfoParenthesesOnce);
+                        atomParenthesesTerminalBegin(term.parentheses.subpatternId, term.capture(), delegateEndInputOffset - disjunctionAlreadyCheckedCount, term.frameLocation, term.frameLocation + YarrStackSpaceForBackTrackInfoParenthesesOnce);
                         emitDisjunction(term.parentheses.disjunction, currentCountAlreadyChecked, disjunctionAlreadyCheckedCount);
                         atomParenthesesTerminalEnd(delegateEndInputOffset, term.frameLocation, term.quantityCount, term.quantityType);
                     } else {
@@ -1845,7 +1845,7 @@ public:
                 }
 
                 case PatternTerm::TypeParentheticalAssertion: {
-                    unsigned alternativeFrameLocation = term.frameLocation + RegexStackSpaceForBackTrackInfoParentheticalAssertion;
+                    unsigned alternativeFrameLocation = term.frameLocation + YarrStackSpaceForBackTrackInfoParentheticalAssertion;
 
                     ASSERT(currentCountAlreadyChecked >= (unsigned)term.inputPosition);
                     int positiveInputOffset = currentCountAlreadyChecked - term.inputPosition;
@@ -1861,31 +1861,31 @@ public:
     }
 
 private:
-    RegexPattern& m_pattern;
+    YarrPattern& m_pattern;
     OwnPtr<ByteDisjunction> m_bodyDisjunction;
     unsigned m_currentAlternativeIndex;
     Vector<ParenthesesStackEntry> m_parenthesesStack;
     Vector<ByteDisjunction*> m_allParenthesesInfo;
 };
 
-PassOwnPtr<BytecodePattern> byteCompileRegex(RegexPattern& pattern, BumpPointerAllocator* allocator)
+PassOwnPtr<BytecodePattern> byteCompile(YarrPattern& pattern, BumpPointerAllocator* allocator)
 {
     return ByteCompiler(pattern).compile(allocator);
 }
 
-int interpretRegex(BytecodePattern* regex, const UChar* input, unsigned start, unsigned length, int* output)
+int interpret(BytecodePattern* bytecode, const UChar* input, unsigned start, unsigned length, int* output)
 {
-    return Interpreter(regex, output, input, start, length).interpret();
+    return Interpreter(bytecode, output, input, start, length).interpret();
 }
 
 
-COMPILE_ASSERT(sizeof(Interpreter::BackTrackInfoPatternCharacter) == (RegexStackSpaceForBackTrackInfoPatternCharacter * sizeof(uintptr_t)), CheckRegexStackSpaceForBackTrackInfoPatternCharacter);
-COMPILE_ASSERT(sizeof(Interpreter::BackTrackInfoCharacterClass) == (RegexStackSpaceForBackTrackInfoCharacterClass * sizeof(uintptr_t)), CheckRegexStackSpaceForBackTrackInfoCharacterClass);
-COMPILE_ASSERT(sizeof(Interpreter::BackTrackInfoBackReference) == (RegexStackSpaceForBackTrackInfoBackReference * sizeof(uintptr_t)), CheckRegexStackSpaceForBackTrackInfoBackReference);
-COMPILE_ASSERT(sizeof(Interpreter::BackTrackInfoAlternative) == (RegexStackSpaceForBackTrackInfoAlternative * sizeof(uintptr_t)), CheckRegexStackSpaceForBackTrackInfoAlternative);
-COMPILE_ASSERT(sizeof(Interpreter::BackTrackInfoParentheticalAssertion) == (RegexStackSpaceForBackTrackInfoParentheticalAssertion * sizeof(uintptr_t)), CheckRegexStackSpaceForBackTrackInfoParentheticalAssertion);
-COMPILE_ASSERT(sizeof(Interpreter::BackTrackInfoParenthesesOnce) == (RegexStackSpaceForBackTrackInfoParenthesesOnce * sizeof(uintptr_t)), CheckRegexStackSpaceForBackTrackInfoParenthesesOnce);
-COMPILE_ASSERT(sizeof(Interpreter::BackTrackInfoParentheses) == (RegexStackSpaceForBackTrackInfoParentheses * sizeof(uintptr_t)), CheckRegexStackSpaceForBackTrackInfoParentheses);
+COMPILE_ASSERT(sizeof(Interpreter::BackTrackInfoPatternCharacter) == (YarrStackSpaceForBackTrackInfoPatternCharacter * sizeof(uintptr_t)), CheckYarrStackSpaceForBackTrackInfoPatternCharacter);
+COMPILE_ASSERT(sizeof(Interpreter::BackTrackInfoCharacterClass) == (YarrStackSpaceForBackTrackInfoCharacterClass * sizeof(uintptr_t)), CheckYarrStackSpaceForBackTrackInfoCharacterClass);
+COMPILE_ASSERT(sizeof(Interpreter::BackTrackInfoBackReference) == (YarrStackSpaceForBackTrackInfoBackReference * sizeof(uintptr_t)), CheckYarrStackSpaceForBackTrackInfoBackReference);
+COMPILE_ASSERT(sizeof(Interpreter::BackTrackInfoAlternative) == (YarrStackSpaceForBackTrackInfoAlternative * sizeof(uintptr_t)), CheckYarrStackSpaceForBackTrackInfoAlternative);
+COMPILE_ASSERT(sizeof(Interpreter::BackTrackInfoParentheticalAssertion) == (YarrStackSpaceForBackTrackInfoParentheticalAssertion * sizeof(uintptr_t)), CheckYarrStackSpaceForBackTrackInfoParentheticalAssertion);
+COMPILE_ASSERT(sizeof(Interpreter::BackTrackInfoParenthesesOnce) == (YarrStackSpaceForBackTrackInfoParenthesesOnce * sizeof(uintptr_t)), CheckYarrStackSpaceForBackTrackInfoParenthesesOnce);
+COMPILE_ASSERT(sizeof(Interpreter::BackTrackInfoParentheses) == (YarrStackSpaceForBackTrackInfoParentheses * sizeof(uintptr_t)), CheckYarrStackSpaceForBackTrackInfoParentheses);
 
 
 } }
similarity index 95%
rename from Source/JavaScriptCore/yarr/RegexInterpreter.h
rename to Source/JavaScriptCore/yarr/YarrInterpreter.h
index 0fd8a57ab1e446ea08c700163b69143b547b67d8..6ffe9b72aace3b627b65c1682877592552ca739d 100644 (file)
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
  */
 
-#ifndef RegexInterpreter_h
-#define RegexInterpreter_h
+#ifndef YarrInterpreter_h
+#define YarrInterpreter_h
 
-#include "RegexParser.h"
-#include "RegexPattern.h"
+#include "YarrParser.h"
+#include "YarrPattern.h"
 #include <wtf/PassOwnPtr.h>
 #include <wtf/unicode/Unicode.h>
 
@@ -329,7 +329,7 @@ public:
 };
 
 struct BytecodePattern : FastAllocBase {
-    BytecodePattern(PassOwnPtr<ByteDisjunction> body, Vector<ByteDisjunction*> allParenthesesInfo, RegexPattern& pattern, BumpPointerAllocator* allocator)
+    BytecodePattern(PassOwnPtr<ByteDisjunction> body, Vector<ByteDisjunction*> allParenthesesInfo, YarrPattern& pattern, BumpPointerAllocator* allocator)
         : m_body(body)
         , m_ignoreCase(pattern.m_ignoreCase)
         , m_multiline(pattern.m_multiline)
@@ -341,7 +341,7 @@ struct BytecodePattern : FastAllocBase {
 
         m_allParenthesesInfo.append(allParenthesesInfo);
         m_userCharacterClasses.append(pattern.m_userCharacterClasses);
-        // 'Steal' the RegexPattern's CharacterClasses!  We clear its
+        // 'Steal' the YarrPattern's CharacterClasses!  We clear its
         // array, so that it won't delete them on destruction.  We'll
         // take responsibility for that.
         pattern.m_userCharacterClasses.clear();
@@ -360,7 +360,7 @@ struct BytecodePattern : FastAllocBase {
     bool m_multiline;
     bool m_containsBeginChars;
     // Each BytecodePattern is associated with a RegExp, each RegExp is associated
-    // with a JSGlobalData.  Cache a pointer to out JSGlobalData's m_regexAllocator.
+    // with a JSGlobalData.  Cache a pointer to out JSGlobalData's m_regExpAllocator.
     BumpPointerAllocator* m_allocator;
 
     CharacterClass* newlineCharacterClass;
@@ -373,9 +373,9 @@ private:
     Vector<CharacterClass*> m_userCharacterClasses;
 };
 
-PassOwnPtr<BytecodePattern> byteCompileRegex(RegexPattern& pattern, BumpPointerAllocator*);
-int interpretRegex(BytecodePattern* v_regex, const UChar* input, unsigned start, unsigned length, int* output);
+PassOwnPtr<BytecodePattern> byteCompile(YarrPattern&, BumpPointerAllocator*);
+int interpret(BytecodePattern*, const UChar* input, unsigned start, unsigned length, int* output);
 
 } } // namespace JSC::Yarr
 
-#endif // RegexInterpreter_h
+#endif // YarrInterpreter_h
similarity index 97%
rename from Source/JavaScriptCore/yarr/RegexJIT.cpp
rename to Source/JavaScriptCore/yarr/YarrJIT.cpp
index 50fe6db5c1f11221c8e21b4b57235e39839969e7..545fcf5fd90b07e15f1c36a0f13dea2cc73c77fd 100644 (file)
  */
 
 #include "config.h"
-#include "RegexJIT.h"
+#include "YarrJIT.h"
 
 #include "ASCIICType.h"
 #include "JSGlobalData.h"
 #include "LinkBuffer.h"
 #include "MacroAssembler.h"
-#include "RegexParser.h"
+#include "YarrParser.h"
 
 #if ENABLE(YARR_JIT)
 
@@ -38,8 +38,8 @@ using namespace WTF;
 
 namespace JSC { namespace Yarr {
 
-class RegexGenerator : private MacroAssembler {
-    friend void jitCompileRegex(JSGlobalData* globalData, RegexCodeBlock& jitObject, const UString& pattern, unsigned& numSubpatterns, const char*& error, bool ignoreCase, bool multiline);
+class YarrGenerator : private MacroAssembler {
+    friend void jitCompile(JSGlobalData*, YarrCodeBlock& jitObject, const UString& pattern, unsigned& numSubpatterns, const char*& error, bool ignoreCase, bool multiline);
 
 #if CPU(ARM)
     static const RegisterID input = ARMRegisters::r0;
@@ -383,7 +383,7 @@ class RegexGenerator : private MacroAssembler {
             return parenthesesTail;
         }
 
-        void emitParenthesesTail(RegexGenerator* generator)
+        void emitParenthesesTail(YarrGenerator* generator)
         {
             unsigned vectorSize = m_parenTails.size();
             bool priorBacktrackFallThrough = false;
@@ -430,7 +430,7 @@ class RegexGenerator : private MacroAssembler {
             m_parenTailsForIteration.clear();
         }
 
-        void linkToNextIteration(RegexGenerator* generator)
+        void linkToNextIteration(YarrGenerator* generator)
         {
             m_jumpsToNextInteration.linkTo(m_nextIteration, generator);
         }
@@ -652,7 +652,7 @@ class RegexGenerator : private MacroAssembler {
                 m_backTrackJumps.append(masm->jump());
         }
 
-        void jumpToBacktrack(RegexGenerator* generator, Jump jump)
+        void jumpToBacktrack(YarrGenerator* generator, Jump jump)
         {
             if (isJumpList()) {
                 if (m_backtrackSourceLabel && (m_backtrackSourceLabel->isSet()))
@@ -667,7 +667,7 @@ class RegexGenerator : private MacroAssembler {
                 m_backTrackJumps.append(jump);
         }
 
-        void jumpToBacktrack(RegexGenerator* generator, JumpList& jumps)
+        void jumpToBacktrack(YarrGenerator* generator, JumpList& jumps)
         {
             if (isJumpList()) {
                 if (m_backtrackSourceLabel && (m_backtrackSourceLabel->isSet()))
@@ -682,7 +682,7 @@ class RegexGenerator : private MacroAssembler {
                 m_backTrackJumps.append(jumps);
         }
 
-        bool linkDataLabelToHereIfExists(RegexGenerator* generator)
+        bool linkDataLabelToHereIfExists(YarrGenerator* generator)
         {
             if (hasDataLabel()) {
                 generator->m_expressionState.m_backtrackRecords.append(AlternativeBacktrackRecord(getDataLabel(), generator->label()));
@@ -693,7 +693,7 @@ class RegexGenerator : private MacroAssembler {
             return false;
         }
 
-        bool plantJumpToBacktrackIfExists(RegexGenerator* generator)
+        bool plantJumpToBacktrackIfExists(YarrGenerator* generator)
         {
             if (isJumpList()) {
                 if (m_backtrackSourceLabel && (m_backtrackSourceLabel->isSet()))
@@ -721,7 +721,7 @@ class RegexGenerator : private MacroAssembler {
             return false;
         }
 
-        void linkAlternativeBacktracks(RegexGenerator* generator, bool nextIteration = false)
+        void linkAlternativeBacktracks(YarrGenerator* generator, bool nextIteration = false)
         {
             Label hereLabel = generator->label();
 
@@ -743,7 +743,7 @@ class RegexGenerator : private MacroAssembler {
             clear();
         }
 
-        void linkAlternativeBacktracksTo(RegexGenerator* generator, Label label, bool nextIteration = false)
+        void linkAlternativeBacktracksTo(YarrGenerator* generator, Label label, bool nextIteration = false)
         {
             m_backTrackJumps.linkTo(label, generator);
 
@@ -877,22 +877,22 @@ class RegexGenerator : private MacroAssembler {
             m_backtrack.jumpToBacktrack(masm);
         }
 
-        void jumpToBacktrack(RegexGenerator* generator, Jump jump)
+        void jumpToBacktrack(YarrGenerator* generator, Jump jump)
         {
             m_backtrack.jumpToBacktrack(generator, jump);
         }
 
-        void jumpToBacktrack(RegexGenerator* generator, JumpList& jumps)
+        void jumpToBacktrack(YarrGenerator* generator, JumpList& jumps)
         {
             m_backtrack.jumpToBacktrack(generator, jumps);
         }
 
-        bool plantJumpToBacktrackIfExists(RegexGenerator* generator)
+        bool plantJumpToBacktrackIfExists(YarrGenerator* generator)
         {
             return m_backtrack.plantJumpToBacktrackIfExists(generator);
         }
 
-        bool linkDataLabelToBacktrackIfExists(RegexGenerator* generator)
+        bool linkDataLabelToBacktrackIfExists(YarrGenerator* generator)
         {
             if ((m_backtrack.isLabel()) && (m_backtrack.hasDataLabel())) {
                 generator->m_expressionState.m_backtrackRecords.append(AlternativeBacktrackRecord(m_backtrack.getDataLabel(), m_backtrack.getLabel()));
@@ -923,13 +923,13 @@ class RegexGenerator : private MacroAssembler {
             m_backtrack.setLabel(label);
         }
 
-        void linkAlternativeBacktracks(RegexGenerator* generator, bool nextIteration = false)
+        void linkAlternativeBacktracks(YarrGenerator* generator, bool nextIteration = false)
         {
             m_backtrack.linkAlternativeBacktracks(generator, nextIteration);
             m_linkedBacktrack = 0;
         }
 
-        void linkAlternativeBacktracksTo(RegexGenerator* generator, Label label, bool nextIteration = false)
+        void linkAlternativeBacktracksTo(YarrGenerator* generator, Label label, bool nextIteration = false)
         {
             m_backtrack.linkAlternativeBacktracksTo(generator, label, nextIteration);
         }
@@ -956,7 +956,7 @@ class RegexGenerator : private MacroAssembler {
             return m_backtrack;
         }
 
-        void propagateBacktrackingFrom(RegexGenerator* generator, BacktrackDestination& backtrack, bool doJump = true)
+        void propagateBacktrackingFrom(YarrGenerator* generator, BacktrackDestination& backtrack, bool doJump = true)
         {
             if (doJump)
                 m_backtrack.jumpToBacktrack(generator, backtrack.getBacktrackJumps());
@@ -989,7 +989,7 @@ class RegexGenerator : private MacroAssembler {
         {
         }
 
-        void processBacktracks(RegexGenerator* generator, TermGenerationState& state, TermGenerationState& parenthesesState, Label nonGreedyTryParentheses, Label fallThrough)
+        void processBacktracks(YarrGenerator* generator, TermGenerationState& state, TermGenerationState& parenthesesState, Label nonGreedyTryParentheses, Label fallThrough)
         {
             m_nonGreedyTryParentheses = nonGreedyTryParentheses;
             m_fallThrough = fallThrough;
@@ -1029,7 +1029,7 @@ class RegexGenerator : private MacroAssembler {
             m_pattBacktrackJumps.append(jump);
         }
 
-        bool generateCode(RegexGenerator* generator, JumpList& jumpsToNext, bool priorBackTrackFallThrough, bool nextBacktrackFallThrough)
+        bool generateCode(YarrGenerator* generator, JumpList& jumpsToNext, bool priorBackTrackFallThrough, bool nextBacktrackFallThrough)
         {
             const RegisterID indexTemporary = regT0;
             unsigned parenthesesFrameLocation = m_term.frameLocation;
@@ -1605,7 +1605,7 @@ class RegexGenerator : private MacroAssembler {
         unsigned parenthesesFrameLocation = term.frameLocation;
         unsigned alternativeFrameLocation = parenthesesFrameLocation;
         if (term.quantityType != QuantifierFixedCount)
-            alternativeFrameLocation += RegexStackSpaceForBackTrackInfoParenthesesOnce;
+            alternativeFrameLocation += YarrStackSpaceForBackTrackInfoParenthesesOnce;
 
         // optimized case - no capture & no quantifier can be handled in a light-weight manner.
         if (!term.capture() && (term.quantityType == QuantifierFixedCount)) {
@@ -1738,7 +1738,7 @@ class RegexGenerator : private MacroAssembler {
         ASSERT(term.quantityType == QuantifierFixedCount);
 
         unsigned parenthesesFrameLocation = term.frameLocation;
-        unsigned alternativeFrameLocation = parenthesesFrameLocation + RegexStackSpaceForBackTrackInfoParentheticalAssertion;
+        unsigned alternativeFrameLocation = parenthesesFrameLocation + YarrStackSpaceForBackTrackInfoParentheticalAssertion;
 
         int countCheckedAfterAssertion = state.checkedTotal - term.inputPosition;
 
@@ -2163,7 +2163,7 @@ class RegexGenerator : private MacroAssembler {
     }
 
 public:
-    RegexGenerator(RegexPattern& pattern)
+    YarrGenerator(YarrPattern& pattern)
         : m_pattern(pattern)
         , m_shouldFallBack(false)
     {
@@ -2182,7 +2182,7 @@ public:
         generateDisjunction(m_pattern.m_body);
     }
 
-    void compile(JSGlobalData* globalData, RegexCodeBlock& jitObject)
+    void compile(JSGlobalData* globalData, YarrCodeBlock& jitObject)
     {
         generate();
 
@@ -2196,14 +2196,14 @@ public:
     }
 
 private:
-    RegexPattern& m_pattern;
+    YarrPattern& m_pattern;
     bool m_shouldFallBack;
     GenerationState m_expressionState;
 };
 
-void jitCompileRegex(RegexPattern& pattern, JSGlobalData* globalData, RegexCodeBlock& jitObject)
+void jitCompile(YarrPattern& pattern, JSGlobalData* globalData, YarrCodeBlock& jitObject)
 {
-    RegexGenerator generator(pattern);
+    YarrGenerator generator(pattern);
     generator.compile(globalData, jitObject);
 }
 
similarity index 79%
rename from Source/JavaScriptCore/yarr/RegexJIT.h
rename to Source/JavaScriptCore/yarr/YarrJIT.h
index 5e3dca151755aa1bd12be1bfb20d4c804def4d6b..dfdc777c06b4c72f404620c07d489c012f8f203d 100644 (file)
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
  */
 
-#ifndef RegexJIT_h
-#define RegexJIT_h
+#ifndef YarrJIT_h
+#define YarrJIT_h
 
 #if ENABLE(YARR_JIT)
 
 #include "MacroAssembler.h"
-#include "RegexPattern.h"
+#include "YarrPattern.h"
 #include "UString.h"
 
 #if CPU(X86) && !COMPILER(MSVC)
@@ -45,16 +45,16 @@ class ExecutablePool;
 
 namespace Yarr {
 
-class RegexCodeBlock {
-    typedef int (*RegexJITCode)(const UChar* input, unsigned start, unsigned length, int* output) YARR_CALL;
+class YarrCodeBlock {
+    typedef int (*YarrJITCode)(const UChar* input, unsigned start, unsigned length, int* output) YARR_CALL;
 
 public:
-    RegexCodeBlock()
+    YarrCodeBlock()
         : m_needFallBack(false)
     {
     }
 
-    ~RegexCodeBlock()
+    ~YarrCodeBlock()
     {
     }
 
@@ -64,7 +64,7 @@ public:
 
     int execute(const UChar* input, unsigned start, unsigned length, int* output)
     {
-        return reinterpret_cast<RegexJITCode>(m_ref.m_code.executableAddress())(input, start, length, output);
+        return reinterpret_cast<YarrJITCode>(m_ref.m_code.executableAddress())(input, start, length, output);
     }
 
 #if ENABLE(REGEXP_TRACING)
@@ -76,9 +76,9 @@ private:
     bool m_needFallBack;
 };
 
-void jitCompileRegex(RegexPattern& pattern, JSGlobalData* globalData, RegexCodeBlock& jitObject);
+void jitCompile(YarrPattern&, JSGlobalData*, YarrCodeBlock& jitObject);
 
-inline int executeRegex(RegexCodeBlock& jitObject, const UChar* input, unsigned start, unsigned length, int* output)
+inline int execute(YarrCodeBlock& jitObject, const UChar* input, unsigned start, unsigned length, int* output)
 {
     return jitObject.execute(input, start, length, output);
 }
@@ -87,4 +87,4 @@ inline int executeRegex(RegexCodeBlock& jitObject, const UChar* input, unsigned
 
 #endif
 
-#endif // RegexJIT_h
+#endif // YarrJIT_h
similarity index 99%
rename from Source/JavaScriptCore/yarr/RegexParser.h
rename to Source/JavaScriptCore/yarr/YarrParser.h
index 2e42f8ac9f21e2da28d9418acb1163ba2a1a50a6..6c3fba55bdc5f33ed457944426a8debc804d088a 100644 (file)
@@ -23,8 +23,8 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
  */
 
-#ifndef RegexParser_h
-#define RegexParser_h
+#ifndef YarrParser_h
+#define YarrParser_h
 
 #include "UString.h"
 #include <limits.h>
@@ -668,8 +668,7 @@ private:
     /*
      * parse():
      *
-     * This method calls regexBegin(), calls parseTokens() to parse over the input
-     * patterns, calls regexEnd() or regexError() as appropriate, and converts any
+     * This method calls parseTokens() to parse over the input and converts any
      * error code to a const char* for a result.
      */
     const char* parse()
@@ -870,4 +869,4 @@ const char* parse(Delegate& delegate, const UString& pattern, unsigned backRefer
 
 } } // namespace JSC::Yarr
 
-#endif // RegexParser_h
+#endif // YarrParser_h
similarity index 96%
rename from Source/JavaScriptCore/yarr/RegexPattern.cpp
rename to Source/JavaScriptCore/yarr/YarrPattern.cpp
index f9aa92d488a97d4468f44d3d96fb53caab41effb..9ca04cba103f6aa7a017a18317f2c7a41efb478a 100644 (file)
@@ -25,9 +25,9 @@
  */
 
 #include "config.h"
+#include "YarrPattern.h"
 
-#include "RegexInterpreter.h"
-#include "RegexPattern.h"
+#include "YarrInterpreter.h"
 #include <wtf/Vector.h>
 
 using namespace WTF;
@@ -338,17 +338,20 @@ private:
     bool m_isCaseInsensitive;
 };
 
-class RegexPatternConstructor {
+class YarrPatternConstructor {
 public:
-    RegexPatternConstructor(RegexPattern& pattern)
+    YarrPatternConstructor(YarrPattern& pattern)
         : m_pattern(pattern)
         , m_characterClassConstructor(pattern.m_ignoreCase)
         , m_beginCharHelper(&pattern.m_beginChars, pattern.m_ignoreCase)
         , m_invertParentheticalAssertion(false)
     {
+        m_pattern.m_body = new PatternDisjunction();
+        m_alternative = m_pattern.m_body->addNewAlternative();
+        m_pattern.m_disjunctions.append(m_pattern.m_body);
     }
 
-    ~RegexPatternConstructor()
+    ~YarrPatternConstructor()
     {
     }
 
@@ -356,6 +359,10 @@ public:
     {
         m_pattern.reset();
         m_characterClassConstructor.reset();
+
+        m_pattern.m_body = new PatternDisjunction();
+        m_alternative = m_pattern.m_body->addNewAlternative();
+        m_pattern.m_disjunctions.append(m_pattern.m_body);
     }
     
     void assertionBOL()
@@ -605,13 +612,6 @@ public:
         m_alternative = m_alternative->m_parent->addNewAlternative();
     }
 
-    void regexBegin()
-    {
-        m_pattern.m_body = new PatternDisjunction();
-        m_alternative = m_pattern.m_body->addNewAlternative();
-        m_pattern.m_disjunctions.append(m_pattern.m_body);
-    }
-
     unsigned setupAlternativeOffsets(PatternAlternative* alternative, unsigned currentCallFrameSize, unsigned initialInputPosition)
     {
         alternative->m_hasFixedSize = true;
@@ -630,7 +630,7 @@ public:
             case PatternTerm::TypeBackReference:
                 term.inputPosition = currentInputPosition;
                 term.frameLocation = currentCallFrameSize;
-                currentCallFrameSize += RegexStackSpaceForBackTrackInfoBackReference;
+                currentCallFrameSize += YarrStackSpaceForBackTrackInfoBackReference;
                 alternative->m_hasFixedSize = false;
                 break;
 
@@ -641,7 +641,7 @@ public:
                 term.inputPosition = currentInputPosition;
                 if (term.quantityType != QuantifierFixedCount) {
                     term.frameLocation = currentCallFrameSize;
-                    currentCallFrameSize += RegexStackSpaceForBackTrackInfoPatternCharacter;
+                    currentCallFrameSize += YarrStackSpaceForBackTrackInfoPatternCharacter;
                     alternative->m_hasFixedSize = false;
                 } else
                     currentInputPosition += term.quantityCount;
@@ -651,7 +651,7 @@ public:
                 term.inputPosition = currentInputPosition;
                 if (term.quantityType != QuantifierFixedCount) {
                     term.frameLocation = currentCallFrameSize;
-                    currentCallFrameSize += RegexStackSpaceForBackTrackInfoCharacterClass;
+                    currentCallFrameSize += YarrStackSpaceForBackTrackInfoCharacterClass;
                     alternative->m_hasFixedSize = false;
                 } else
                     currentInputPosition += term.quantityCount;
@@ -662,20 +662,20 @@ public:
                 term.frameLocation = currentCallFrameSize;
                 if (term.quantityCount == 1 && !term.parentheses.isCopy) {
                     if (term.quantityType != QuantifierFixedCount)
-                        currentCallFrameSize += RegexStackSpaceForBackTrackInfoParenthesesOnce;
+                        currentCallFrameSize += YarrStackSpaceForBackTrackInfoParenthesesOnce;
                     currentCallFrameSize = setupDisjunctionOffsets(term.parentheses.disjunction, currentCallFrameSize, currentInputPosition);
                     // If quantity is fixed, then pre-check its minimum size.
                     if (term.quantityType == QuantifierFixedCount)
                         currentInputPosition += term.parentheses.disjunction->m_minimumSize;
                     term.inputPosition = currentInputPosition;
                 } else if (term.parentheses.isTerminal) {
-                    currentCallFrameSize += RegexStackSpaceForBackTrackInfoParenthesesTerminal;
+                    currentCallFrameSize += YarrStackSpaceForBackTrackInfoParenthesesTerminal;
                     currentCallFrameSize = setupDisjunctionOffsets(term.parentheses.disjunction, currentCallFrameSize, currentInputPosition);
                     term.inputPosition = currentInputPosition;
                 } else {
                     term.inputPosition = currentInputPosition;
                     setupDisjunctionOffsets(term.parentheses.disjunction, 0, currentInputPosition);
-                    currentCallFrameSize += RegexStackSpaceForBackTrackInfoParentheses;
+                    currentCallFrameSize += YarrStackSpaceForBackTrackInfoParentheses;
                 }
                 // Fixed count of 1 could be accepted, if they have a fixed size *AND* if all alternatives are of the same length.
                 alternative->m_hasFixedSize = false;
@@ -684,7 +684,7 @@ public:
             case PatternTerm::TypeParentheticalAssertion:
                 term.inputPosition = currentInputPosition;
                 term.frameLocation = currentCallFrameSize;
-                currentCallFrameSize = setupDisjunctionOffsets(term.parentheses.disjunction, currentCallFrameSize + RegexStackSpaceForBackTrackInfoParentheticalAssertion, currentInputPosition);
+                currentCallFrameSize = setupDisjunctionOffsets(term.parentheses.disjunction, currentCallFrameSize + YarrStackSpaceForBackTrackInfoParentheticalAssertion, currentInputPosition);
                 break;
             }
         }
@@ -696,7 +696,7 @@ public:
     unsigned setupDisjunctionOffsets(PatternDisjunction* disjunction, unsigned initialCallFrameSize, unsigned initialInputPosition)
     {
         if ((disjunction != m_pattern.m_body) && (disjunction->m_alternatives.size() > 1))
-            initialCallFrameSize += RegexStackSpaceForBackTrackInfoAlternative;
+            initialCallFrameSize += YarrStackSpaceForBackTrackInfoAlternative;
 
         unsigned minimumInputSize = UINT_MAX;
         unsigned maximumCallFrameSize = 0;
@@ -921,7 +921,7 @@ public:
     }
 
 private:
-    RegexPattern& m_pattern;
+    YarrPattern& m_pattern;
     PatternAlternative* m_alternative;
     CharacterClassConstructor m_characterClassConstructor;
     BeginCharHelper m_beginCharHelper;
@@ -930,11 +930,10 @@ private:
 };
 
 
-static const char* compileRegex(const UString& patternString, RegexPattern& pattern)
+static const char* compile(const UString& patternString, YarrPattern& pattern)
 {
-    RegexPatternConstructor constructor(pattern);
+    YarrPatternConstructor constructor(pattern);
 
-    constructor.regexBegin();
     if (const char* error = parse(constructor, patternString))
         return error;
     
@@ -946,7 +945,6 @@ static const char* compileRegex(const UString& patternString, RegexPattern& patt
         unsigned numSubpatterns = pattern.m_numSubpatterns;
 
         constructor.reset();
-        constructor.regexBegin();
 #if !ASSERT_DISABLED
         const char* error =
 #endif
@@ -965,7 +963,7 @@ static const char* compileRegex(const UString& patternString, RegexPattern& patt
     return 0;
 };
 
-RegexPattern::RegexPattern(const UString& pattern, bool ignoreCase, bool multiline, const char** error)
+YarrPattern::YarrPattern(const UString& pattern, bool ignoreCase, bool multiline, const char** error)
     : m_ignoreCase(ignoreCase)
     , m_multiline(multiline)
     , m_containsBackreferences(false)
@@ -981,7 +979,7 @@ RegexPattern::RegexPattern(const UString& pattern, bool ignoreCase, bool multili
     , nonspacesCached(0)
     , nonwordcharCached(0)
 {
-    *error = compileRegex(pattern, *this);
+    *error = compile(pattern, *this);
 }
 
 } }
similarity index 93%
rename from Source/JavaScriptCore/yarr/RegexPattern.h
rename to Source/JavaScriptCore/yarr/YarrPattern.h
index 6833dd6c3347462bec4fa697c1c8f0851c6c99ad..14810c64bbf98bed57e6acf8003d0659eda7a6ca 100644 (file)
@@ -24,8 +24,8 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
  */
 
-#ifndef RegexPattern_h
-#define RegexPattern_h
+#ifndef YarrPattern_h
+#define YarrPattern_h
 
 #include <wtf/Vector.h>
 #include <wtf/unicode/Unicode.h>
 
 namespace JSC { namespace Yarr {
 
-#define RegexStackSpaceForBackTrackInfoPatternCharacter 1 // Only for !fixed quantifiers.
-#define RegexStackSpaceForBackTrackInfoCharacterClass 1 // Only for !fixed quantifiers.
-#define RegexStackSpaceForBackTrackInfoBackReference 2
-#define RegexStackSpaceForBackTrackInfoAlternative 1 // One per alternative.
-#define RegexStackSpaceForBackTrackInfoParentheticalAssertion 1
-#define RegexStackSpaceForBackTrackInfoParenthesesOnce 1 // Only for !fixed quantifiers.
-#define RegexStackSpaceForBackTrackInfoParenthesesTerminal 1
-#define RegexStackSpaceForBackTrackInfoParentheses 2
+#define YarrStackSpaceForBackTrackInfoPatternCharacter 1 // Only for !fixed quantifiers.
+#define YarrStackSpaceForBackTrackInfoCharacterClass 1 // Only for !fixed quantifiers.
+#define YarrStackSpaceForBackTrackInfoBackReference 2
+#define YarrStackSpaceForBackTrackInfoAlternative 1 // One per alternative.
+#define YarrStackSpaceForBackTrackInfoParentheticalAssertion 1
+#define YarrStackSpaceForBackTrackInfoParenthesesOnce 1 // Only for !fixed quantifiers.
+#define YarrStackSpaceForBackTrackInfoParenthesesTerminal 1
+#define YarrStackSpaceForBackTrackInfoParentheses 2
 
 struct PatternDisjunction;
 
@@ -282,7 +282,7 @@ struct PatternDisjunction : FastAllocBase {
 
 // You probably don't want to be calling these functions directly
 // (please to be calling newlineCharacterClass() et al on your
-// friendly neighborhood RegexPattern instance to get nicely
+// friendly neighborhood YarrPattern instance to get nicely
 // cached copies).
 CharacterClass* newlineCreate();
 CharacterClass* digitsCreate();
@@ -316,10 +316,10 @@ struct BeginChar {
     unsigned mask;
 };
 
-struct RegexPattern {
-    RegexPattern(const UString& pattern, bool ignoreCase, bool multiline, const char** error);
+struct YarrPattern {
+    YarrPattern(const UString& pattern, bool ignoreCase, bool multiline, const char** error);
 
-    ~RegexPattern()
+    ~YarrPattern()
     {
         deleteAllValues(m_disjunctions);
         deleteAllValues(m_userCharacterClasses);
@@ -421,4 +421,4 @@ private:
 
 } } // namespace JSC::Yarr
 
-#endif // RegexPattern_h
+#endif // YarrPattern_h
index a0230828e5be2e24ee7c8bb6368afed71f762d4b..51fda94d8a3d76fc5a2d76b563fb5f6ba929ff31 100644 (file)
@@ -26,7 +26,7 @@
 #include "config.h"
 #include "YarrSyntaxChecker.h"
 
-#include "RegexParser.h"
+#include "YarrParser.h"
 
 namespace JSC { namespace Yarr {