| Index: runtime/vm/regexp.h
|
| diff --git a/runtime/vm/regexp.h b/runtime/vm/regexp.h
|
| index 8d49edeb210e78f6159ff144dd524428e4c47805..2577aa933b355c832332b2d2a1f401b11b4954f3 100644
|
| --- a/runtime/vm/regexp.h
|
| +++ b/runtime/vm/regexp.h
|
| @@ -6,8 +6,8 @@
|
| #define RUNTIME_VM_REGEXP_H_
|
|
|
| #include "vm/assembler.h"
|
| -#include "vm/intermediate_language.h"
|
| #include "vm/flow_graph_compiler.h"
|
| +#include "vm/intermediate_language.h"
|
| #include "vm/object.h"
|
| #include "vm/regexp_assembler.h"
|
|
|
| @@ -20,7 +20,6 @@ class RegExpNode;
|
| class RegExpTree;
|
| class BoyerMooreLookahead;
|
|
|
| -
|
| // Represents code units in the range from from_ to to_, both ends are
|
| // inclusive.
|
| class CharacterRange {
|
| @@ -78,7 +77,6 @@ class CharacterRange {
|
| DISALLOW_ALLOCATION();
|
| };
|
|
|
| -
|
| // A set of unsigned integers that behaves especially well on small
|
| // integers (< 32). May do zone-allocation.
|
| class OutSet : public ZoneAllocated {
|
| @@ -107,7 +105,6 @@ class OutSet : public ZoneAllocated {
|
| friend class Trace;
|
| };
|
|
|
| -
|
| #define FOR_EACH_NODE_TYPE(VISIT) \
|
| VISIT(End) \
|
| VISIT(Action) \
|
| @@ -116,7 +113,6 @@ class OutSet : public ZoneAllocated {
|
| VISIT(Assertion) \
|
| VISIT(Text)
|
|
|
| -
|
| #define FOR_EACH_REG_EXP_TREE_TYPE(VISIT) \
|
| VISIT(Disjunction) \
|
| VISIT(Alternative) \
|
| @@ -130,12 +126,10 @@ class OutSet : public ZoneAllocated {
|
| VISIT(Empty) \
|
| VISIT(Text)
|
|
|
| -
|
| #define FORWARD_DECLARE(Name) class RegExp##Name;
|
| FOR_EACH_REG_EXP_TREE_TYPE(FORWARD_DECLARE)
|
| #undef FORWARD_DECLARE
|
|
|
| -
|
| class TextElement {
|
| public:
|
| enum TextType { ATOM, CHAR_CLASS };
|
| @@ -172,7 +166,6 @@ class TextElement {
|
| DISALLOW_ALLOCATION();
|
| };
|
|
|
| -
|
| class Trace;
|
| struct PreloadState;
|
| class GreedyLoopState;
|
| @@ -239,7 +232,6 @@ struct NodeInfo {
|
| bool replacement_calculated : 1;
|
| };
|
|
|
| -
|
| // Details of a quick mask-compare check that can look ahead in the
|
| // input stream.
|
| class QuickCheckDetails {
|
| @@ -287,7 +279,6 @@ class QuickCheckDetails {
|
| DISALLOW_ALLOCATION();
|
| };
|
|
|
| -
|
| class RegExpNode : public ZoneAllocated {
|
| public:
|
| explicit RegExpNode(Zone* zone)
|
| @@ -415,7 +406,6 @@ class RegExpNode : public ZoneAllocated {
|
| Zone* zone_;
|
| };
|
|
|
| -
|
| // A simple closed interval.
|
| class Interval {
|
| public:
|
| @@ -447,7 +437,6 @@ class Interval {
|
| DISALLOW_ALLOCATION();
|
| };
|
|
|
| -
|
| class SeqRegExpNode : public RegExpNode {
|
| public:
|
| explicit SeqRegExpNode(RegExpNode* on_success)
|
| @@ -470,7 +459,6 @@ class SeqRegExpNode : public RegExpNode {
|
| RegExpNode* on_success_;
|
| };
|
|
|
| -
|
| class ActionNode : public SeqRegExpNode {
|
| public:
|
| enum ActionType {
|
| @@ -559,7 +547,6 @@ class ActionNode : public SeqRegExpNode {
|
| friend class DotPrinter;
|
| };
|
|
|
| -
|
| class TextNode : public SeqRegExpNode {
|
| public:
|
| TextNode(ZoneGrowableArray<TextElement>* elms, RegExpNode* on_success)
|
| @@ -611,7 +598,6 @@ class TextNode : public SeqRegExpNode {
|
| ZoneGrowableArray<TextElement>* elms_;
|
| };
|
|
|
| -
|
| class AssertionNode : public SeqRegExpNode {
|
| public:
|
| enum AssertionType {
|
| @@ -662,7 +648,6 @@ class AssertionNode : public SeqRegExpNode {
|
| AssertionType assertion_type_;
|
| };
|
|
|
| -
|
| class BackReferenceNode : public SeqRegExpNode {
|
| public:
|
| BackReferenceNode(intptr_t start_reg,
|
| @@ -692,7 +677,6 @@ class BackReferenceNode : public SeqRegExpNode {
|
| intptr_t end_reg_;
|
| };
|
|
|
| -
|
| class EndNode : public RegExpNode {
|
| public:
|
| enum Action { ACCEPT, BACKTRACK, NEGATIVE_SUBMATCH_SUCCESS };
|
| @@ -724,7 +708,6 @@ class EndNode : public RegExpNode {
|
| Action action_;
|
| };
|
|
|
| -
|
| class NegativeSubmatchSuccess : public EndNode {
|
| public:
|
| NegativeSubmatchSuccess(intptr_t stack_pointer_reg,
|
| @@ -746,7 +729,6 @@ class NegativeSubmatchSuccess : public EndNode {
|
| intptr_t clear_capture_start_;
|
| };
|
|
|
| -
|
| class Guard : public ZoneAllocated {
|
| public:
|
| enum Relation { LT, GEQ };
|
| @@ -762,7 +744,6 @@ class Guard : public ZoneAllocated {
|
| intptr_t value_;
|
| };
|
|
|
| -
|
| class GuardedAlternative {
|
| public:
|
| explicit GuardedAlternative(RegExpNode* node) : node_(node), guards_(NULL) {}
|
| @@ -778,10 +759,8 @@ class GuardedAlternative {
|
| DISALLOW_ALLOCATION();
|
| };
|
|
|
| -
|
| struct AlternativeGeneration;
|
|
|
| -
|
| class ChoiceNode : public RegExpNode {
|
| public:
|
| explicit ChoiceNode(intptr_t expected_size, Zone* zone)
|
| @@ -861,7 +840,6 @@ class ChoiceNode : public RegExpNode {
|
| bool being_calculated_;
|
| };
|
|
|
| -
|
| class NegativeLookaheadChoiceNode : public ChoiceNode {
|
| public:
|
| explicit NegativeLookaheadChoiceNode(GuardedAlternative this_must_fail,
|
| @@ -897,7 +875,6 @@ class NegativeLookaheadChoiceNode : public ChoiceNode {
|
| virtual RegExpNode* FilterOneByte(intptr_t depth, bool ignore_case);
|
| };
|
|
|
| -
|
| class LoopChoiceNode : public ChoiceNode {
|
| public:
|
| explicit LoopChoiceNode(bool body_can_be_zero_length, Zone* zone)
|
| @@ -938,7 +915,6 @@ class LoopChoiceNode : public ChoiceNode {
|
| bool body_can_be_zero_length_;
|
| };
|
|
|
| -
|
| // Improve the speed that we scan for an initial point where a non-anchored
|
| // regexp can match by using a Boyer-Moore-like table. This is done by
|
| // identifying non-greedy non-capturing loops in the nodes that eat any
|
| @@ -971,18 +947,15 @@ enum ContainedInLattice {
|
| kLatticeUnknown = 3 // Can also mean both in and out.
|
| };
|
|
|
| -
|
| inline ContainedInLattice Combine(ContainedInLattice a, ContainedInLattice b) {
|
| return static_cast<ContainedInLattice>(a | b);
|
| }
|
|
|
| -
|
| ContainedInLattice AddRange(ContainedInLattice a,
|
| const intptr_t* ranges,
|
| intptr_t ranges_size,
|
| Interval new_range);
|
|
|
| -
|
| class BoyerMoorePositionInfo : public ZoneAllocated {
|
| public:
|
| explicit BoyerMoorePositionInfo(Zone* zone)
|
| @@ -1019,7 +992,6 @@ class BoyerMoorePositionInfo : public ZoneAllocated {
|
| ContainedInLattice surrogate_; // Surrogate UTF-16 code units.
|
| };
|
|
|
| -
|
| class BoyerMooreLookahead : public ZoneAllocated {
|
| public:
|
| BoyerMooreLookahead(intptr_t length, RegExpCompiler* compiler, Zone* Zone);
|
| @@ -1079,7 +1051,6 @@ class BoyerMooreLookahead : public ZoneAllocated {
|
| intptr_t* to);
|
| };
|
|
|
| -
|
| // There are many ways to generate code for a node. This class encapsulates
|
| // the current way we should be generating. In other words it encapsulates
|
| // the current state of the code generator. The effect of this is that we
|
| @@ -1252,7 +1223,6 @@ class Trace {
|
| DISALLOW_ALLOCATION();
|
| };
|
|
|
| -
|
| class GreedyLoopState {
|
| public:
|
| explicit GreedyLoopState(bool not_at_start);
|
| @@ -1265,7 +1235,6 @@ class GreedyLoopState {
|
| Trace counter_backtrack_trace_;
|
| };
|
|
|
| -
|
| struct PreloadState {
|
| static const intptr_t kEatsAtLeastNotYetInitialized = -1;
|
| bool preload_is_current_;
|
| @@ -1277,7 +1246,6 @@ struct PreloadState {
|
| DISALLOW_ALLOCATION();
|
| };
|
|
|
| -
|
| class NodeVisitor : public ValueObject {
|
| public:
|
| virtual ~NodeVisitor() {}
|
| @@ -1287,7 +1255,6 @@ class NodeVisitor : public ValueObject {
|
| virtual void VisitLoopChoice(LoopChoiceNode* that) { VisitChoice(that); }
|
| };
|
|
|
| -
|
| // Assertion propagation moves information about assertions such as
|
| // \b to the affected nodes. For instance, in /.\b./ information must
|
| // be propagated to the first '.' that whatever follows needs to know
|
| @@ -1328,7 +1295,6 @@ class Analysis : public NodeVisitor {
|
| DISALLOW_IMPLICIT_CONSTRUCTORS(Analysis);
|
| };
|
|
|
| -
|
| struct RegExpCompileData : public ZoneAllocated {
|
| RegExpCompileData()
|
| : tree(NULL),
|
| @@ -1345,7 +1311,6 @@ struct RegExpCompileData : public ZoneAllocated {
|
| intptr_t capture_count;
|
| };
|
|
|
| -
|
| class RegExpEngine : public AllStatic {
|
| public:
|
| struct CompilationResult {
|
|
|