Lines Matching defs:that

2 // Use of this source code is governed by a BSD-style license that can be
40 // that can actually execute the regular expression (perform
106 // Thus it can be seen that the current position is saved and restored
108 // by the action nodes that manipulate them.
110 // The other interesting aspect of this model is that nodes are generated
126 // the choices immediately based on that character. This is not yet
141 // This is used to defer expensive operations until it is clear that they
148 // Instead of emitting code, nodes that manipulate the state can record their
156 // expression since it may be found that the work never has to be done as a
166 // to that trace. The code generator therefore has the ability to generate
171 // This is subsequently used for that node. The code emitted for non-generic
173 // the event that code generation is requested for an identical trace.
295 bool Trace::DeferredAction::Mentions(int that) {
298 return range.Contains(that);
300 return reg() == that;
328 // A (dynamically-sized) set of unsigned integers that behaves especially well
460 // For captures we know that stores and clears alternate.
533 // through a quick check that was already performed.
535 // Create a new trivial state and generate the node with that.
546 // nodes and so they indicate that we have a deferred save of the current
562 // Create a new trivial state and generate the node with that.
601 // Clear any captures that might have been performed during the success
606 // Now that we have unwound the stack we find at the top of the stack the
607 // backtrack that the BeginNegativeSubmatch node got.
752 // that cannot occur in the source string because it is Latin1.
828 // Only emits non-letters (things that don't have case). Only used for case
888 // Only emits letters (things that have case). Only used for case independent
899 // if this character lies before a character that matched.
973 // Assert that everything is on one kTableSize page.
1028 // range that is a merger of the two ranges on either side of the one we
1038 // Unicode case. Split the search space into kSize spaces that are handled
1055 // new_start_index is the index of the first edge that is beyond the
1060 // heuristics are complicated a little by the fact that any 128-character
1062 // wish to do binary chop search at a smaller granularity than that. A
1067 // The first test ensures that we get to the code that handles the Latin1
1103 // know that the character is in the range of min_char to max_char inclusive.
1126 // Another almost trivial case: There is one interval in the middle that is
1183 // We didn't find any section that started after the limit, so everything
1225 // Now that all processing (like case-insensitivity) is done, clamp the
1226 // ranges to the set of ranges that may actually occur in the subject string.
1281 // GenerateBranches. See the comment on that function for how the list should
1331 // recursed too deeply then just generate a jump to that code.
1444 // implies that the following node must be a LoopChoiceNode. If we need to
1446 // new action type SET_REGISTER that doesn't imply anything about its
1472 // that they eat at least the number eaten by the continuation node, since any
1580 // mask and value that can be used to test for a quick failure to match.
1667 // so we just conservatively create a mask and value that will always
2044 // this point, but that seems like more trouble than it's worth. It's safe
2051 // before running the continuation node. Set a flag so that this node knows
2052 // (now and any times we visit it again recursively) that it was entered
2115 // that matches newline or the start of input).
2137 // If we've already checked that we are not at the start of input, it's okay
2231 // If we've already checked that we are not at the start of input, it's okay
2317 // A slight complication involves the fact that the first character may already
2319 // do the test for that character first. We do this in separate passes. The
2320 // 'preloaded' argument indicates that we are doing such a 'pass'. If such a
2322 // first_element_checked to indicate that that character does not need to be
2327 // object we can see details of any quick check that was already passed in
2354 // Everywhere else we assume that a non-Latin-1 character cannot match
2484 // check that now.
2512 // down or for using a shifted value for anything so lets just forget that
2540 // independent case and it slows us down if we don't know that.
2567 // Finds the fixed match length of a sequence of nodes that goes from
2570 // value indicating that a greedy loop cannot be constructed.
2593 // Check that we can jump by the whole text length. If not, return sentinel
2644 // to do that. We can't just load 4 because we could be reading
2715 // New range is wholly inside last-ranges[i]. Note that new_range.to() is
2791 // Find the longest range of lookahead that has the fewest number of different
2792 // characters that can occur at a given position. Since we are optimizing two
2796 // If more than 32 characters out of 128 can occur it is unlikely that we can
2809 // information is not too vague. 'Too vague' means that there are more than
2810 // max_number_of_chars that can occur at this position. Calculates the number
2865 // Take all the characters that will not prevent a successful match if they
2903 // Check if we only have a single non-empty position info, and that info
2966 * We generate quick checks that do a mask and compare to eliminate a
3014 * For greedy loops we push the current position, then generate the code that
3018 * looks like this (U is the unwind code that steps back in the greedy loop).
3196 // loop. That also implies that there are no preloaded characters, which is
3203 // At this point we know that we are at a non-greedy loop that will eat
3285 // previous cases that go here when they fail. There's no reason to
3286 // insist that they preload characters since the slow check we are about
3332 // Reload the current character, since the next quick check expects that.
3492 // Check that the back reference does not end inside a surrogate pair.
3515 // be propagated to the first '.' that whatever follows needs to know
3516 // if it matched a word or a non-word, and to the second '.' that it
3527 static void VisitText(TextNode* that) {}
3529 static void VisitAction(ActionNode* that) {
3532 that->info()->AddFromFollowing(that->on_success()->info());
3535 static void VisitChoice(ChoiceNode* that, int i) {
3538 that->info()->AddFromFollowing(that->alternatives()->at(i).node()->info());
3541 static void VisitLoopChoiceContinueNode(LoopChoiceNode* that) {
3542 that->info()->AddFromFollowing(that->continue_node()->info());
3545 static void VisitLoopChoiceLoopNode(LoopChoiceNode* that) {
3546 that->info()->AddFromFollowing(that->loop_node()->info());
3550 NegativeLookaroundChoiceNode* that) {
3551 VisitChoice(that, NegativeLookaroundChoiceNode::kLookaroundIndex);
3555 NegativeLookaroundChoiceNode* that) {
3556 VisitChoice(that, NegativeLookaroundChoiceNode::kContinueIndex);
3559 static void VisitBackReference(BackReferenceNode* that) {}
3561 static void VisitAssertion(AssertionNode* that) {}
3565 // successor nodes to their predecessors. Note that all eats_at_least values
3569 static void VisitText(TextNode* that) {
3571 if (!that->read_backward()) {
3575 that->Length() + that->on_success()
3578 that->set_eats_at_least_info(EatsAtLeastInfo(eats_at_least));
3582 static void VisitAction(ActionNode* that) {
3583 switch (that->action_type()) {
3592 // is <= eats_at_least_from_possibly_start, and use that value in
3594 DCHECK(that->eats_at_least_info()->IsZero());
3600 that->set_eats_at_least_info(
3601 that->on_success()->EatsAtLeastFromLoopEntry());
3609 that->set_eats_at_least_info(*that->on_success()->eats_at_least_info());
3614 static void VisitChoice(ChoiceNode* that, int i) {
3618 i == 0 ? EatsAtLeastInfo(UINT8_MAX) : *that->eats_at_least_info();
3620 *that->alternatives()->at(i).node()->eats_at_least_info());
3621 that->set_eats_at_least_info(eats_at_least);
3624 static void VisitLoopChoiceContinueNode(LoopChoiceNode* that) {
3625 if (!that->read_backward()) {
3626 that->set_eats_at_least_info(
3627 *that->continue_node()->eats_at_least_info());
3631 static void VisitLoopChoiceLoopNode(LoopChoiceNode* that) {}
3634 NegativeLookaroundChoiceNode* that) {}
3637 NegativeLookaroundChoiceNode* that) {
3638 that->set_eats_at_least_info(*that->continue_node()->eats_at_least_info());
3641 static void VisitBackReference(BackReferenceNode* that) {
3642 if (!that->read_backward()) {
3643 that->set_eats_at_least_info(*that->on_success()->eats_at_least_info());
3647 static void VisitAssertion(AssertionNode* that) {
3648 EatsAtLeastInfo eats_at_least = *that->on_success()->eats_at_least_info();
3649 if (that->assertion_type() == AssertionNode::AT_START) {
3653 // (UINT8_MAX) since that won't prevent us from preloading a lot of
3657 that->set_eats_at_least_info(eats_at_least);
3667 // values that depend on successor nodes.
3677 void EnsureAnalyzed(RegExpNode* that) {
3686 if (that->info()->been_analyzed || that->info()->being_analyzed) return;
3687 that->info()->being_analyzed = true;
3688 that->Accept(this);
3689 that->info()->being_analyzed = false;
3690 that->info()->been_analyzed = true;
3702 void VisitEnd(EndNode* that) override {
3714 void VisitText(TextNode* that) override {
3715 that->MakeCaseIndependent(isolate(), is_one_byte_, flags_);
3716 EnsureAnalyzed(that->on_success());
3718 that->CalculateOffsets();
3719 STATIC_FOR_EACH(Propagators::VisitText(that));
3722 void VisitAction(ActionNode* that) override {
3723 EnsureAnalyzed(that->on_success());
3725 STATIC_FOR_EACH(Propagators::VisitAction(that));
3728 void VisitChoice(ChoiceNode* that) override {
3729 for (int i = 0; i < that->alternatives()->length(); i++) {
3730 EnsureAnalyzed(that->alternatives()->at(i).node());
3732 STATIC_FOR_EACH(Propagators::VisitChoice(that, i));
3736 void VisitLoopChoice(LoopChoiceNode* that) override {
3737 DCHECK_EQ(that->alternatives()->length(), 2); // Just loop and continue.
3740 EnsureAnalyzed(that->continue_node());
3742 STATIC_FOR_EACH(Propagators::VisitLoopChoiceContinueNode(that));
3746 EnsureAnalyzed(that->loop_node());
3748 STATIC_FOR_EACH(Propagators::VisitLoopChoiceLoopNode(that));
3752 NegativeLookaroundChoiceNode* that) override {
3753 DCHECK_EQ(that->alternatives()->length(), 2); // Lookaround and continue.
3755 EnsureAnalyzed(that->lookaround_node());
3758 Propagators::VisitNegativeLookaroundChoiceLookaroundNode(that));
3760 EnsureAnalyzed(that->continue_node());
3763 Propagators::VisitNegativeLookaroundChoiceContinueNode(that));
3766 void VisitBackReference(BackReferenceNode* that) override {
3767 EnsureAnalyzed(that->on_success());
3769 STATIC_FOR_EACH(Propagators::VisitBackReference(that));
3772 void VisitAssertion(AssertionNode* that) override {
3773 EnsureAnalyzed(that->on_success());
3775 STATIC_FOR_EACH(Propagators::VisitAssertion(that));
3802 // Working out the set of characters that a backreference can match is too
3803 // hard, so we just say that any character can match.
3926 // Unroll loop once, to take care of the case that might start