28 #ifndef V8_IA32_REGEXP_MACRO_ASSEMBLER_IA32_H_
29 #define V8_IA32_REGEXP_MACRO_ASSEMBLER_IA32_H_
37 #ifndef V8_INTERPRETED_REGEXP
46 virtual void Bind(Label* label);
57 bool check_end_of_string);
78 Label* on_not_in_range);
83 virtual void CheckPosition(
int cp_offset, Label* on_outside_input);
87 virtual void GoTo(Label* label);
88 virtual void IfRegisterGE(
int reg,
int comparand, Label* if_ge);
89 virtual void IfRegisterLT(
int reg,
int comparand, Label* if_lt);
93 Label* on_end_of_input,
94 bool check_bounds =
true,
105 virtual void SetRegister(
int register_index,
int to);
120 static const int kFramePointer = 0;
122 static const int kReturn_eip = kFramePointer +
kPointerSize;
123 static const int kFrameAlign = kReturn_eip +
kPointerSize;
125 static const int kInputString = kFrameAlign;
126 static const int kStartIndex = kInputString +
kPointerSize;
127 static const int kInputStart = kStartIndex +
kPointerSize;
128 static const int kInputEnd = kInputStart +
kPointerSize;
129 static const int kRegisterOutput = kInputEnd +
kPointerSize;
133 static const int kNumOutputRegisters = kRegisterOutput +
kPointerSize;
134 static const int kStackHighEnd = kNumOutputRegisters +
kPointerSize;
135 static const int kDirectCall = kStackHighEnd +
kPointerSize;
140 static const int kBackup_esi = kFramePointer -
kPointerSize;
141 static const int kBackup_edi = kBackup_esi -
kPointerSize;
142 static const int kBackup_ebx = kBackup_edi -
kPointerSize;
143 static const int kSuccessfulCaptures = kBackup_ebx -
kPointerSize;
144 static const int kInputStartMinusOne = kSuccessfulCaptures -
kPointerSize;
146 static const int kRegisterZero = kInputStartMinusOne -
kPointerSize;
149 static const size_t kRegExpCodeSize = 1024;
153 void LoadCurrentCharacterUnchecked(
int cp_offset,
int character_count);
156 void CheckPreemption();
159 void CheckStackLimit();
162 void CallCheckStackGuardState(
Register scratch);
165 Operand register_location(
int register_index);
168 inline Register current_character() {
return edx; }
172 inline Register backtrack_stackpointer() {
return ecx; }
175 inline int char_size() {
return static_cast<int>(mode_); }
179 void BranchOrBacktrack(
Condition condition, Label* to);
183 inline void SafeCall(Label* to);
184 inline void SafeReturn();
185 inline void SafeCallTarget(Label* name);
193 inline void Push(Immediate value);
209 int num_saved_registers_;
214 Label success_label_;
215 Label backtrack_label_;
217 Label check_preempt_label_;
218 Label stack_overflow_label_;
220 #endif // V8_INTERPRETED_REGEXP
224 #endif // V8_IA32_REGEXP_MACRO_ASSEMBLER_IA32_H_
virtual void IfRegisterEqPos(int reg, Label *if_eq)
virtual bool CheckSpecialCharacterClass(uc16 type, Label *on_no_match)
virtual void LoadCurrentCharacter(int cp_offset, Label *on_end_of_input, bool check_bounds=true, int characters=1)
virtual void SetCurrentPositionFromEnd(int by)
virtual void CheckCharacterLT(uc16 limit, Label *on_less)
virtual void AdvanceRegister(int reg, int by)
virtual void PushCurrentPosition()
virtual void CheckNotCharacter(uint32_t c, Label *on_not_equal)
virtual Handle< HeapObject > GetCode(Handle< String > source)
virtual void IfRegisterLT(int reg, int comparand, Label *if_lt)
virtual ~RegExpMacroAssemblerIA32()
virtual void CheckPosition(int cp_offset, Label *on_outside_input)
virtual void SetRegister(int register_index, int to)
virtual void PopCurrentPosition()
virtual void CheckGreedyLoop(Label *on_tos_equals_current_position)
virtual void CheckNotBackReferenceIgnoreCase(int start_reg, Label *on_no_match)
virtual void CheckCharacter(uint32_t c, Label *on_equal)
RegExpMacroAssemblerIA32(Mode mode, int registers_to_save, Zone *zone)
virtual void IfRegisterGE(int reg, int comparand, Label *if_ge)
virtual void CheckCharacterGT(uc16 limit, Label *on_greater)
virtual void AdvanceCurrentPosition(int by)
virtual void CheckNotBackReference(int start_reg, Label *on_no_match)
virtual void PushBacktrack(Label *label)
virtual void CheckCharacterInRange(uc16 from, uc16 to, Label *on_in_range)
virtual void ReadCurrentPositionFromRegister(int reg)
static int CheckStackGuardState(Address *return_address, Code *re_code, Address re_frame)
virtual void GoTo(Label *label)
virtual void CheckNotCharacterAfterMinusAnd(uc16 c, uc16 minus, uc16 mask, Label *on_not_equal)
virtual void ReadStackPointerFromRegister(int reg)
virtual void WriteCurrentPositionToRegister(int reg, int cp_offset)
virtual void CheckBitInTable(Handle< ByteArray > table, Label *on_bit_set)
virtual void CheckCharacters(Vector< const uc16 > str, int cp_offset, Label *on_failure, bool check_end_of_string)
virtual int stack_limit_slack()
virtual void PopRegister(int register_index)
virtual void PushRegister(int register_index, StackCheckFlag check_stack_limit)
virtual void CheckCharacterAfterAnd(uint32_t c, uint32_t mask, Label *on_equal)
virtual void ClearRegisters(int reg_from, int reg_to)
virtual void CheckCharacterNotInRange(uc16 from, uc16 to, Label *on_not_in_range)
virtual IrregexpImplementation Implementation()
virtual void CheckNotCharacterAfterAnd(uint32_t c, uint32_t mask, Label *on_not_equal)
virtual void CheckAtStart(Label *on_at_start)
virtual void Bind(Label *label)
virtual void CheckNotAtStart(Label *on_not_at_start)
virtual void WriteStackPointerToRegister(int reg)