The data contained in this repository can be downloaded to your computer using one of several clients.
Please see the documentation of your version control software client for more information.

Please select the desired protocol below to get the URL.

This URL has Read-Only access.

Statistics
| Branch: | Revision:

main_repo / deps / v8 / src / regexp-macro-assembler-tracer.h @ 40c0f755

History | View | Annotate | Download (5.61 KB)

1
// Copyright 2008 the V8 project authors. All rights reserved.
2
// Redistribution and use in source and binary forms, with or without
3
// modification, are permitted provided that the following conditions are
4
// met:
5
//
6
//     * Redistributions of source code must retain the above copyright
7
//       notice, this list of conditions and the following disclaimer.
8
//     * Redistributions in binary form must reproduce the above
9
//       copyright notice, this list of conditions and the following
10
//       disclaimer in the documentation and/or other materials provided
11
//       with the distribution.
12
//     * Neither the name of Google Inc. nor the names of its
13
//       contributors may be used to endorse or promote products derived
14
//       from this software without specific prior written permission.
15
//
16
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27

    
28
#ifndef REGEXP_MACRO_ASSEMBLER_TRACER_H_
29
#define REGEXP_MACRO_ASSEMBLER_TRACER_H_
30

    
31
namespace v8 { namespace internal {
32

    
33
// Decorator on a RegExpMacroAssembler that write all calls.
34
class RegExpMacroAssemblerTracer: public RegExpMacroAssembler {
35
 public:
36
  explicit RegExpMacroAssemblerTracer(RegExpMacroAssembler* assembler);
37
  virtual ~RegExpMacroAssemblerTracer();
38
  virtual int stack_limit_slack() { return assembler_->stack_limit_slack(); }
39

    
40
  virtual void AdvanceCurrentPosition(int by);  // Signed cp change.
41
  virtual void AdvanceRegister(int reg, int by);  // r[reg] += by.
42
  virtual void Backtrack();
43
  virtual void Bind(Label* label);
44
  virtual void CheckAtStart(Label* on_at_start);
45
  virtual void CheckBitmap(uc16 start, Label* bitmap, Label* on_zero);
46
  virtual void CheckCharacter(uint32_t c, Label* on_equal);
47
  virtual void CheckCharacterAfterAnd(uint32_t c,
48
                                      uint32_t and_with,
49
                                      Label* on_equal);
50
  virtual void CheckCharacterGT(uc16 limit, Label* on_greater);
51
  virtual void CheckCharacterLT(uc16 limit, Label* on_less);
52
  virtual void CheckCharacters(
53
      Vector<const uc16> str,
54
      int cp_offset,
55
      Label* on_failure,
56
      bool check_end_of_string);
57
  virtual void CheckGreedyLoop(Label* on_tos_equals_current_position);
58
  virtual void CheckNotAtStart(Label* on_not_at_start);
59
  virtual void CheckNotBackReference(int start_reg, Label* on_no_match);
60
  virtual void CheckNotBackReferenceIgnoreCase(int start_reg,
61
                                               Label* on_no_match);
62
  virtual void CheckNotRegistersEqual(int reg1, int reg2, Label* on_not_equal);
63
  virtual void CheckNotCharacter(uint32_t c, Label* on_not_equal);
64
  virtual void CheckNotCharacterAfterAnd(uint32_t c,
65
                                         uint32_t and_with,
66
                                         Label* on_not_equal);
67
  virtual void CheckNotCharacterAfterMinusAnd(uc16 c,
68
                                              uc16 minus,
69
                                              uc16 and_with,
70
                                              Label* on_not_equal);
71
  virtual bool CheckSpecialCharacterClass(uc16 type,
72
                                          int cp_offset,
73
                                          bool check_offset,
74
                                          Label* on_no_match);
75
  virtual void DispatchByteMap(
76
      uc16 start,
77
      Label* byte_map,
78
      const Vector<Label*>& destinations);
79
  virtual void DispatchHalfNibbleMap(
80
      uc16 start,
81
      Label* half_nibble_map,
82
      const Vector<Label*>& destinations);
83
  virtual void DispatchHighByteMap(
84
      byte start,
85
      Label* byte_map,
86
      const Vector<Label*>& destinations);
87
  virtual void EmitOrLink(Label* label);
88
  virtual void Fail();
89
  virtual Handle<Object> GetCode(Handle<String> source);
90
  virtual void GoTo(Label* label);
91
  virtual void IfRegisterGE(int reg, int comparand, Label* if_ge);
92
  virtual void IfRegisterLT(int reg, int comparand, Label* if_lt);
93
  virtual void IfRegisterEqPos(int reg, Label* if_eq);
94
  virtual IrregexpImplementation Implementation();
95
  virtual void LoadCurrentCharacter(int cp_offset,
96
                                    Label* on_end_of_input,
97
                                    bool check_bounds = true,
98
                                    int characters = 1);
99
  virtual void PopCurrentPosition();
100
  virtual void PopRegister(int register_index);
101
  virtual void PushBacktrack(Label* label);
102
  virtual void PushCurrentPosition();
103
  virtual void PushRegister(int register_index,
104
                            StackCheckFlag check_stack_limit);
105
  virtual void ReadCurrentPositionFromRegister(int reg);
106
  virtual void ReadStackPointerFromRegister(int reg);
107
  virtual void SetRegister(int register_index, int to);
108
  virtual void Succeed();
109
  virtual void WriteCurrentPositionToRegister(int reg, int cp_offset);
110
  virtual void ClearRegisters(int reg_from, int reg_to);
111
  virtual void WriteStackPointerToRegister(int reg);
112
 private:
113
  RegExpMacroAssembler* assembler_;
114
};
115

    
116
}}  // namespace v8::internal
117

    
118
#endif  // REGEXP_MACRO_ASSEMBLER_TRACER_H_