Ignore:
Timestamp:
Dec 1, 2008, 7:25:20 PM (16 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/JavaScriptCore.xcodeproj/project.pbxproj

    r38839 r38891  
    145145                969A079A0ED1D3AE00F1F681 /* Opcode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 969A07940ED1D3AE00F1F681 /* Opcode.cpp */; };
    146146                969A079B0ED1D3AE00F1F681 /* Opcode.h in Headers */ = {isa = PBXBuildFile; fileRef = 969A07950ED1D3AE00F1F681 /* Opcode.h */; settings = {ATTRIBUTES = (Private, ); }; };
     147                96A746410EDDF70600904779 /* Escapes.h in Headers */ = {isa = PBXBuildFile; fileRef = 96A7463F0EDDF70600904779 /* Escapes.h */; };
    147148                A72700900DAC6BBC00E548D7 /* JSNotAnObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A72700780DAC605600E548D7 /* JSNotAnObject.cpp */; };
    148149                A72701B90DADE94900E548D7 /* ExceptionHelpers.h in Headers */ = {isa = PBXBuildFile; fileRef = A72701B30DADE94900E548D7 /* ExceptionHelpers.h */; };
     
    615616                969A07950ED1D3AE00F1F681 /* Opcode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Opcode.h; sourceTree = "<group>"; };
    616617                969A09220ED1E09C00F1F681 /* Completion.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Completion.cpp; sourceTree = "<group>"; };
     618                96A7463F0EDDF70600904779 /* Escapes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Escapes.h; sourceTree = "<group>"; };
    617619                A72700770DAC605600E548D7 /* JSNotAnObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSNotAnObject.h; sourceTree = "<group>"; };
    618620                A72700780DAC605600E548D7 /* JSNotAnObject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSNotAnObject.cpp; sourceTree = "<group>"; };
     
    13151317                                1429DABE0ED263E700B89619 /* WRECParser.cpp */,
    13161318                                1429DABD0ED263E700B89619 /* WRECParser.h */,
     1319                                96A7463F0EDDF70600904779 /* Escapes.h */,
    13171320                        );
    13181321                        path = wrec;
     
    16201623                                1429DABF0ED263E700B89619 /* WRECParser.h in Headers */,
    16211624                                1429DAE00ED2645B00B89619 /* WRECGenerator.h in Headers */,
     1625                                96A746410EDDF70600904779 /* Escapes.h in Headers */,
    16221626                                86C36EEA0EE1289D00B3DF59 /* MacroAssembler.h in Headers */,
    16231627                        );
Note: See TracChangeset for help on using the changeset viewer.