v8  3.25.30(node0.11.13)
V8 is Google's open source JavaScript engine
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
regexp-macro-assembler-tracer.h
Go to the documentation of this file.
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 V8_REGEXP_MACRO_ASSEMBLER_TRACER_H_
29 #define V8_REGEXP_MACRO_ASSEMBLER_TRACER_H_
30 
31 namespace v8 {
32 namespace internal {
33 
34 // Decorator on a RegExpMacroAssembler that write all calls.
36  public:
39  virtual int stack_limit_slack() { return assembler_->stack_limit_slack(); }
40  virtual bool CanReadUnaligned() { return assembler_->CanReadUnaligned(); }
41  virtual void AdvanceCurrentPosition(int by); // Signed cp change.
42  virtual void AdvanceRegister(int reg, int by); // r[reg] += by.
43  virtual void Backtrack();
44  virtual void Bind(Label* label);
45  virtual void CheckAtStart(Label* on_at_start);
46  virtual void CheckCharacter(unsigned c, Label* on_equal);
47  virtual void CheckCharacterAfterAnd(unsigned c,
48  unsigned 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 CheckGreedyLoop(Label* on_tos_equals_current_position);
53  virtual void CheckNotAtStart(Label* on_not_at_start);
54  virtual void CheckNotBackReference(int start_reg, Label* on_no_match);
55  virtual void CheckNotBackReferenceIgnoreCase(int start_reg,
56  Label* on_no_match);
57  virtual void CheckNotCharacter(unsigned c, Label* on_not_equal);
58  virtual void CheckNotCharacterAfterAnd(unsigned c,
59  unsigned and_with,
60  Label* on_not_equal);
61  virtual void CheckNotCharacterAfterMinusAnd(uc16 c,
62  uc16 minus,
63  uc16 and_with,
64  Label* on_not_equal);
65  virtual void CheckCharacterInRange(uc16 from,
66  uc16 to,
67  Label* on_in_range);
68  virtual void CheckCharacterNotInRange(uc16 from,
69  uc16 to,
70  Label* on_not_in_range);
71  virtual void CheckBitInTable(Handle<ByteArray> table, Label* on_bit_set);
72  virtual bool CheckSpecialCharacterClass(uc16 type,
73  Label* on_no_match);
74  virtual void Fail();
76  virtual void GoTo(Label* label);
77  virtual void IfRegisterGE(int reg, int comparand, Label* if_ge);
78  virtual void IfRegisterLT(int reg, int comparand, Label* if_lt);
79  virtual void IfRegisterEqPos(int reg, Label* if_eq);
81  virtual void LoadCurrentCharacter(int cp_offset,
82  Label* on_end_of_input,
83  bool check_bounds = true,
84  int characters = 1);
85  virtual void PopCurrentPosition();
86  virtual void PopRegister(int register_index);
87  virtual void PushBacktrack(Label* label);
88  virtual void PushCurrentPosition();
89  virtual void PushRegister(int register_index,
90  StackCheckFlag check_stack_limit);
91  virtual void ReadCurrentPositionFromRegister(int reg);
92  virtual void ReadStackPointerFromRegister(int reg);
93  virtual void SetCurrentPositionFromEnd(int by);
94  virtual void SetRegister(int register_index, int to);
95  virtual bool Succeed();
96  virtual void WriteCurrentPositionToRegister(int reg, int cp_offset);
97  virtual void ClearRegisters(int reg_from, int reg_to);
98  virtual void WriteStackPointerToRegister(int reg);
99 
100  private:
101  RegExpMacroAssembler* assembler_;
102 };
103 
104 }} // namespace v8::internal
105 
106 #endif // V8_REGEXP_MACRO_ASSEMBLER_TRACER_H_
virtual void CheckNotBackReferenceIgnoreCase(int start_reg, Label *on_no_match)
virtual void CheckCharacterLT(uc16 limit, Label *on_less)
virtual void IfRegisterLT(int reg, int comparand, Label *if_lt)
virtual void ClearRegisters(int reg_from, int reg_to)
virtual void IfRegisterEqPos(int reg, Label *if_eq)
virtual void CheckCharacterNotInRange(uc16 from, uc16 to, Label *on_not_in_range)
virtual void CheckNotCharacterAfterAnd(unsigned c, unsigned and_with, Label *on_not_equal)
virtual void CheckNotCharacterAfterMinusAnd(uc16 c, uc16 minus, uc16 and_with, Label *on_not_equal)
virtual void WriteCurrentPositionToRegister(int reg, int cp_offset)
virtual void CheckBitInTable(Handle< ByteArray > table, Label *on_bit_set)
virtual void CheckGreedyLoop(Label *on_tos_equals_current_position)
virtual void CheckNotAtStart(Label *on_not_at_start)
virtual void LoadCurrentCharacter(int cp_offset, Label *on_end_of_input, bool check_bounds=true, int characters=1)
virtual void CheckCharacter(unsigned c, Label *on_equal)
virtual void CheckNotBackReference(int start_reg, Label *on_no_match)
virtual void CheckCharacterAfterAnd(unsigned c, unsigned and_with, Label *on_equal)
virtual Handle< HeapObject > GetCode(Handle< String > source)
virtual void IfRegisterGE(int reg, int comparand, Label *if_ge)
virtual bool CheckSpecialCharacterClass(uc16 type, Label *on_no_match)
uint16_t uc16
Definition: globals.h:309
virtual void CheckCharacterInRange(uc16 from, uc16 to, Label *on_in_range)
virtual void CheckNotCharacter(unsigned c, Label *on_not_equal)
virtual void PushRegister(int register_index, StackCheckFlag check_stack_limit)
RegExpMacroAssemblerTracer(RegExpMacroAssembler *assembler)
virtual void SetRegister(int register_index, int to)
virtual void CheckCharacterGT(uc16 limit, Label *on_greater)