Ignore:
Timestamp:
Dec 1, 2008, 7:25:20 PM (17 years ago)
Author:
[email protected]
Message:

2008-12-01 Geoffrey Garen <[email protected]>

Reviewed by Cameron Zwarich, with help from Gavin Barraclough.


Fixed https://bugs.webkit.org/show_bug.cgi?id=22583.

Refactored regular expression parsing to parse sequences of characters
as a single unit, in preparation for optimizing sequences of characters.


SunSpider reports no change.

  • JavaScriptCore.xcodeproj/project.pbxproj:
  • wrec/Escapes.h: Added. Set of classes for representing an escaped token in a pattern.
  • wrec/Quantifier.h: (JSC::WREC::Quantifier::Quantifier): Simplified this constructor slightly, to match the new Escape constructor.
  • wrec/WRECGenerator.cpp: (JSC::WREC::Generator::generatePatternCharacterSequence):
  • wrec/WRECGenerator.h: Added an interface for generating a sequence of pattern characters at a time. It doesn't do anything special yet.
  • wrec/WRECParser.cpp: (JSC::WREC::Parser::consumeGreedyQuantifier): (JSC::WREC::Parser::consumeQuantifier): Renamed "parse" to "consume" in these functions, to match "consumeEscape."

(JSC::WREC::Parser::parsePatternCharacterSequence): New function for
iteratively aggregating a sequence of characters in a pattern.

(JSC::WREC::Parser::parseCharacterClassQuantifier):
(JSC::WREC::Parser::parseBackreferenceQuantifier): Renamed "parse" to
"consume" in these functions, to match "consumeEscape."

(JSC::WREC::Parser::parseCharacterClass): Refactored to use the common
escape processing code in consumeEscape.

(JSC::WREC::Parser::parseEscape): Refactored to use the common
escape processing code in consumeEscape.

(JSC::WREC::Parser::consumeEscape): Factored escaped token processing
into a common function, since we were doing this in a few places.

(JSC::WREC::Parser::parseTerm): Refactored to use the common
escape processing code in consumeEscape.

  • wrec/WRECParser.h: (JSC::WREC::Parser::consumeOctal): Refactored to use a helper function for reading a digit.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/wrec/WRECGenerator.cpp

    r38857 r38891  
    291291}
    292292
     293void Generator::generatePatternCharacterSequence(JumpList& failures, int* sequence, size_t count)
     294{
     295    for (size_t i = 0; i < count; ++i)
     296        generatePatternCharacter(failures, sequence[i]);
     297}
     298
    293299void Generator::generatePatternCharacter(JumpList& failures, int ch)
    294300{
Note: See TracChangeset for help on using the changeset viewer.