| OLD | NEW |
| 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 806 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 817 virtual int GreedyLoopTextLength(); | 817 virtual int GreedyLoopTextLength(); |
| 818 virtual TextNode* Clone() { | 818 virtual TextNode* Clone() { |
| 819 TextNode* result = new TextNode(*this); | 819 TextNode* result = new TextNode(*this); |
| 820 result->CalculateOffsets(); | 820 result->CalculateOffsets(); |
| 821 return result; | 821 return result; |
| 822 } | 822 } |
| 823 void CalculateOffsets(); | 823 void CalculateOffsets(); |
| 824 | 824 |
| 825 private: | 825 private: |
| 826 enum TextEmitPassType { | 826 enum TextEmitPassType { |
| 827 NON_ASCII_MATCH, | 827 NON_ASCII_MATCH, // Check for characters that can't match. |
| 828 CHARACTER_MATCH, | 828 SIMPLE_CHARACTER_MATCH, // Case-dependent single character check. |
| 829 CASE_CHARACTER_MATCH, | 829 NON_LETTER_CHARACTER_MATCH, // Check characters that have no case equivs. |
| 830 CHARACTER_CLASS_MATCH | 830 CASE_CHARACTER_MATCH, // Case-independent single character check. |
| 831 CHARACTER_CLASS_MATCH // Character class. |
| 831 }; | 832 }; |
| 833 static bool SkipPass(int pass, bool ignore_case); |
| 834 static const int kFirstRealPass = SIMPLE_CHARACTER_MATCH; |
| 835 static const int kLastPass = CHARACTER_CLASS_MATCH; |
| 832 void TextEmitPass(RegExpCompiler* compiler, | 836 void TextEmitPass(RegExpCompiler* compiler, |
| 833 TextEmitPassType pass, | 837 TextEmitPassType pass, |
| 834 bool preloaded, | 838 bool preloaded, |
| 835 Trace* trace, | 839 Trace* trace, |
| 836 bool first_element_checked, | 840 bool first_element_checked, |
| 837 int* checked_up_to); | 841 int* checked_up_to); |
| 838 int Length(); | 842 int Length(); |
| 839 ZoneList<TextElement>* elms_; | 843 ZoneList<TextElement>* elms_; |
| 840 }; | 844 }; |
| 841 | 845 |
| (...skipping 513 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1355 Handle<String> pattern, | 1359 Handle<String> pattern, |
| 1356 bool is_ascii); | 1360 bool is_ascii); |
| 1357 | 1361 |
| 1358 static void DotPrint(const char* label, RegExpNode* node, bool ignore_case); | 1362 static void DotPrint(const char* label, RegExpNode* node, bool ignore_case); |
| 1359 }; | 1363 }; |
| 1360 | 1364 |
| 1361 | 1365 |
| 1362 } } // namespace v8::internal | 1366 } } // namespace v8::internal |
| 1363 | 1367 |
| 1364 #endif // V8_JSREGEXP_H_ | 1368 #endif // V8_JSREGEXP_H_ |
| OLD | NEW |