28 #ifndef V8_REGEXP_MACRO_ASSEMBLER_IRREGEXP_H_
29 #define V8_REGEXP_MACRO_ASSEMBLER_IRREGEXP_H_
34 #ifdef V8_INTERPRETED_REGEXP
36 class RegExpMacroAssemblerIrregexp:
public RegExpMacroAssembler {
51 explicit RegExpMacroAssemblerIrregexp(Vector<byte>);
52 virtual ~RegExpMacroAssemblerIrregexp();
54 virtual int stack_limit_slack() {
return 1; }
55 virtual void Bind(Label* label);
56 virtual void AdvanceCurrentPosition(
int by);
57 virtual void PopCurrentPosition();
58 virtual void PushCurrentPosition();
59 virtual void Backtrack();
60 virtual void GoTo(Label* label);
61 virtual void PushBacktrack(Label* label);
62 virtual bool Succeed();
64 virtual void PopRegister(
int register_index);
65 virtual void PushRegister(
int register_index,
66 StackCheckFlag check_stack_limit);
67 virtual void AdvanceRegister(
int reg,
int by);
68 virtual void SetCurrentPositionFromEnd(
int by);
69 virtual void SetRegister(
int register_index,
int to);
70 virtual void WriteCurrentPositionToRegister(
int reg,
int cp_offset);
71 virtual void ClearRegisters(
int reg_from,
int reg_to);
72 virtual void ReadCurrentPositionFromRegister(
int reg);
73 virtual void WriteStackPointerToRegister(
int reg);
74 virtual void ReadStackPointerFromRegister(
int reg);
75 virtual void LoadCurrentCharacter(
int cp_offset,
76 Label* on_end_of_input,
77 bool check_bounds =
true,
79 virtual void CheckCharacter(
unsigned c, Label* on_equal);
80 virtual void CheckCharacterAfterAnd(
unsigned c,
83 virtual void CheckCharacterGT(
uc16 limit, Label* on_greater);
84 virtual void CheckCharacterLT(
uc16 limit, Label* on_less);
85 virtual void CheckGreedyLoop(Label* on_tos_equals_current_position);
86 virtual void CheckAtStart(Label* on_at_start);
87 virtual void CheckNotAtStart(Label* on_not_at_start);
88 virtual void CheckNotCharacter(
unsigned c, Label* on_not_equal);
89 virtual void CheckNotCharacterAfterAnd(
unsigned c,
92 virtual void CheckNotCharacterAfterMinusAnd(
uc16 c,
96 virtual void CheckCharacterInRange(
uc16 from,
99 virtual void CheckCharacterNotInRange(
uc16 from,
101 Label* on_not_in_range);
102 virtual void CheckBitInTable(Handle<ByteArray> table, Label* on_bit_set);
103 virtual void CheckNotBackReference(
int start_reg, Label* on_no_match);
104 virtual void CheckNotBackReferenceIgnoreCase(
int start_reg,
106 virtual void CheckCharacters(Vector<const uc16> str,
109 bool check_end_of_string);
110 virtual void IfRegisterLT(
int register_index,
int comparand, Label* if_lt);
111 virtual void IfRegisterGE(
int register_index,
int comparand, Label* if_ge);
112 virtual void IfRegisterEqPos(
int register_index, Label* if_eq);
114 virtual IrregexpImplementation Implementation();
115 virtual Handle<HeapObject> GetCode(Handle<String> source);
120 inline void EmitOrLink(Label* label);
121 inline void Emit32(uint32_t x);
122 inline void Emit16(uint32_t x);
123 inline void Emit8(uint32_t x);
124 inline void Emit(uint32_t bc, uint32_t arg);
137 int advance_current_start_;
138 int advance_current_offset_;
139 int advance_current_end_;
141 static const int kInvalidPC = -1;
146 #endif // V8_INTERPRETED_REGEXP
150 #endif // V8_REGEXP_MACRO_ASSEMBLER_IRREGEXP_H_
v8::Handle< v8::Value > Fail(const v8::Arguments &args)
StringInputBuffer *const buffer_
#define DISALLOW_IMPLICIT_CONSTRUCTORS(TypeName)
Handle< JSObject > Copy(Handle< JSObject > obj)