v8  3.14.5(node0.10.28)
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 CheckCharacters(
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 CheckNotCharacter(unsigned c, Label* on_not_equal);
63  virtual void CheckNotCharacterAfterAnd(unsigned c,
64  unsigned and_with,
65  Label* on_not_equal);
66  virtual void CheckNotCharacterAfterMinusAnd(uc16 c,
67  uc16 minus,
68  uc16 and_with,
69  Label* on_not_equal);
70  virtual void CheckCharacterInRange(uc16 from,
71  uc16 to,
72  Label* on_in_range);
73  virtual void CheckCharacterNotInRange(uc16 from,
74  uc16 to,
75  Label* on_not_in_range);
76  virtual void CheckBitInTable(Handle<ByteArray> table, Label* on_bit_set);
77  virtual bool CheckSpecialCharacterClass(uc16 type,
78  Label* on_no_match);
79  virtual void Fail();
81  virtual void GoTo(Label* label);
82  virtual void IfRegisterGE(int reg, int comparand, Label* if_ge);
83  virtual void IfRegisterLT(int reg, int comparand, Label* if_lt);
84  virtual void IfRegisterEqPos(int reg, Label* if_eq);
86  virtual void LoadCurrentCharacter(int cp_offset,
87  Label* on_end_of_input,
88  bool check_bounds = true,
89  int characters = 1);
90  virtual void PopCurrentPosition();
91  virtual void PopRegister(int register_index);
92  virtual void PushBacktrack(Label* label);
93  virtual void PushCurrentPosition();
94  virtual void PushRegister(int register_index,
95  StackCheckFlag check_stack_limit);
96  virtual void ReadCurrentPositionFromRegister(int reg);
97  virtual void ReadStackPointerFromRegister(int reg);
98  virtual void SetCurrentPositionFromEnd(int by);
99  virtual void SetRegister(int register_index, int to);
100  virtual bool Succeed();
101  virtual void WriteCurrentPositionToRegister(int reg, int cp_offset);
102  virtual void ClearRegisters(int reg_from, int reg_to);
103  virtual void WriteStackPointerToRegister(int reg);
104 
105  private:
106  RegExpMacroAssembler* assembler_;
107 };
108 
109 }} // namespace v8::internal
110 
111 #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 CheckCharacters(Vector< const uc16 > str, int cp_offset, Label *on_failure, bool check_end_of_string)
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:259
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)