OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_JSREGEXP_H_ | 5 #ifndef V8_JSREGEXP_H_ |
6 #define V8_JSREGEXP_H_ | 6 #define V8_JSREGEXP_H_ |
7 | 7 |
8 #include "src/allocation.h" | 8 #include "src/allocation.h" |
9 #include "src/assembler.h" | 9 #include "src/assembler.h" |
10 #include "src/zone-inl.h" | 10 #include "src/zone-inl.h" |
(...skipping 572 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
583 // must be consumed there is no need to ask any following nodes whether | 583 // must be consumed there is no need to ask any following nodes whether |
584 // they are sure to eat any more characters. The not_at_start argument is | 584 // they are sure to eat any more characters. The not_at_start argument is |
585 // used to indicate that we know we are not at the start of the input. In | 585 // used to indicate that we know we are not at the start of the input. In |
586 // this case anchored branches will always fail and can be ignored when | 586 // this case anchored branches will always fail and can be ignored when |
587 // determining how many characters are consumed on success. | 587 // determining how many characters are consumed on success. |
588 virtual int EatsAtLeast(int still_to_find, int budget, bool not_at_start) = 0; | 588 virtual int EatsAtLeast(int still_to_find, int budget, bool not_at_start) = 0; |
589 // Emits some quick code that checks whether the preloaded characters match. | 589 // Emits some quick code that checks whether the preloaded characters match. |
590 // Falls through on certain failure, jumps to the label on possible success. | 590 // Falls through on certain failure, jumps to the label on possible success. |
591 // If the node cannot make a quick check it does nothing and returns false. | 591 // If the node cannot make a quick check it does nothing and returns false. |
592 bool EmitQuickCheck(RegExpCompiler* compiler, | 592 bool EmitQuickCheck(RegExpCompiler* compiler, |
| 593 Trace* bounds_check_trace, |
593 Trace* trace, | 594 Trace* trace, |
594 bool preload_has_checked_bounds, | 595 bool preload_has_checked_bounds, |
595 Label* on_possible_success, | 596 Label* on_possible_success, |
596 QuickCheckDetails* details_return, | 597 QuickCheckDetails* details_return, |
597 bool fall_through_on_failure); | 598 bool fall_through_on_failure); |
598 // For a given number of characters this returns a mask and a value. The | 599 // For a given number of characters this returns a mask and a value. The |
599 // next n characters are anded with the mask and compared with the value. | 600 // next n characters are anded with the mask and compared with the value. |
600 // A comparison failure indicates the node cannot match the next n characters. | 601 // A comparison failure indicates the node cannot match the next n characters. |
601 // A comparison success indicates the node may match. | 602 // A comparison success indicates the node may match. |
602 virtual void GetQuickCheckDetails(QuickCheckDetails* details, | 603 virtual void GetQuickCheckDetails(QuickCheckDetails* details, |
(...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1111 Trace* EmitGreedyLoop(RegExpCompiler* compiler, | 1112 Trace* EmitGreedyLoop(RegExpCompiler* compiler, |
1112 Trace* trace, | 1113 Trace* trace, |
1113 AlternativeGenerationList* alt_gens, | 1114 AlternativeGenerationList* alt_gens, |
1114 PreloadState* preloads, | 1115 PreloadState* preloads, |
1115 GreedyLoopState* greedy_loop_state, | 1116 GreedyLoopState* greedy_loop_state, |
1116 int text_length); | 1117 int text_length); |
1117 void EmitChoices(RegExpCompiler* compiler, | 1118 void EmitChoices(RegExpCompiler* compiler, |
1118 AlternativeGenerationList* alt_gens, | 1119 AlternativeGenerationList* alt_gens, |
1119 int first_choice, | 1120 int first_choice, |
1120 Trace* trace, | 1121 Trace* trace, |
1121 bool is_greedy_loop, | |
1122 PreloadState* preloads); | 1122 PreloadState* preloads); |
1123 DispatchTable* table_; | 1123 DispatchTable* table_; |
1124 // If true, this node is never checked at the start of the input. | 1124 // If true, this node is never checked at the start of the input. |
1125 // Allows a new trace to start with at_start() set to false. | 1125 // Allows a new trace to start with at_start() set to false. |
1126 bool not_at_start_; | 1126 bool not_at_start_; |
1127 bool being_calculated_; | 1127 bool being_calculated_; |
1128 }; | 1128 }; |
1129 | 1129 |
1130 | 1130 |
1131 class NegativeLookaheadChoiceNode: public ChoiceNode { | 1131 class NegativeLookaheadChoiceNode: public ChoiceNode { |
(...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1666 Handle<String> sample_subject, | 1666 Handle<String> sample_subject, |
1667 bool is_one_byte, Zone* zone); | 1667 bool is_one_byte, Zone* zone); |
1668 | 1668 |
1669 static void DotPrint(const char* label, RegExpNode* node, bool ignore_case); | 1669 static void DotPrint(const char* label, RegExpNode* node, bool ignore_case); |
1670 }; | 1670 }; |
1671 | 1671 |
1672 | 1672 |
1673 } } // namespace v8::internal | 1673 } } // namespace v8::internal |
1674 | 1674 |
1675 #endif // V8_JSREGEXP_H_ | 1675 #endif // V8_JSREGEXP_H_ |
OLD | NEW |