28 #ifndef V8_ARM_REGEXP_MACRO_ASSEMBLER_ARM_H_
29 #define V8_ARM_REGEXP_MACRO_ASSEMBLER_ARM_H_
38 #ifndef V8_INTERPRETED_REGEXP
47 virtual void Bind(Label* label);
58 bool check_end_of_string);
79 Label* on_not_in_range);
84 virtual void CheckPosition(
int cp_offset, Label* on_outside_input);
89 virtual void GoTo(Label* label);
90 virtual void IfRegisterGE(
int reg,
int comparand, Label* if_ge);
91 virtual void IfRegisterLT(
int reg,
int comparand, Label* if_lt);
95 Label* on_end_of_input,
96 bool check_bounds =
true,
107 virtual void SetRegister(
int register_index,
int to);
123 static const int kFramePointer = 0;
127 static const int kStoredRegisters = kFramePointer;
129 static const int kReturnAddress = kStoredRegisters + 8 *
kPointerSize;
130 static const int kSecondaryReturnAddress = kReturnAddress +
kPointerSize;
132 static const int kRegisterOutput = kSecondaryReturnAddress +
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 kInputEnd = kFramePointer -
kPointerSize;
141 static const int kInputStart = kInputEnd -
kPointerSize;
142 static const int kStartIndex = kInputStart -
kPointerSize;
143 static const int kInputString = kStartIndex -
kPointerSize;
146 static const int kSuccessfulCaptures = kInputString -
kPointerSize;
147 static const int kInputStartMinusOne = kSuccessfulCaptures -
kPointerSize;
149 static const int kRegisterZero = kInputStartMinusOne -
kPointerSize;
152 static const size_t kRegExpCodeSize = 1024;
154 static const int kBacktrackConstantPoolSize = 4;
158 void LoadCurrentCharacterUnchecked(
int cp_offset,
int character_count);
161 void CheckPreemption();
164 void CheckStackLimit();
166 void EmitBacktrackConstantPool();
167 int GetBacktrackConstantPoolEntry();
171 void CallCheckStackGuardState(
Register scratch);
174 MemOperand register_location(
int register_index);
178 inline Register current_input_offset() {
return r6; }
181 inline Register current_character() {
return r7; }
184 inline Register end_of_input_address() {
return r10; }
188 inline Register frame_pointer() {
return fp; }
192 inline Register backtrack_stackpointer() {
return r8; }
198 inline int char_size() {
return static_cast<int>(mode_); }
202 void BranchOrBacktrack(
Condition condition, Label* to);
206 inline void SafeCall(Label* to,
Condition cond =
al);
207 inline void SafeReturn();
208 inline void SafeCallTarget(Label* name);
223 inline void CallCFunctionUsingStub(ExternalReference
function,
237 int num_saved_registers_;
241 int backtrack_constant_pool_offset_;
242 int backtrack_constant_pool_capacity_;
247 Label success_label_;
248 Label backtrack_label_;
250 Label check_preempt_label_;
251 Label stack_overflow_label_;
254 #endif // V8_INTERPRETED_REGEXP
259 #endif // V8_ARM_REGEXP_MACRO_ASSEMBLER_ARM_H_
virtual void CheckCharacterInRange(uc16 from, uc16 to, Label *on_in_range)
virtual void Bind(Label *label)
virtual void CheckNotCharacterAfterMinusAnd(uc16 c, uc16 minus, uc16 mask, Label *on_not_equal)
virtual void CheckCharacter(unsigned c, Label *on_equal)
virtual void PushCurrentPosition()
virtual ~RegExpMacroAssemblerARM()
virtual void CheckAtStart(Label *on_at_start)
virtual void CheckNotBackReferenceIgnoreCase(int start_reg, Label *on_no_match)
virtual void CheckCharacterLT(uc16 limit, Label *on_less)
virtual void CheckNotAtStart(Label *on_not_at_start)
virtual void CheckBitInTable(Handle< ByteArray > table, Label *on_bit_set)
virtual void ReadStackPointerFromRegister(int reg)
virtual IrregexpImplementation Implementation()
virtual void AdvanceCurrentPosition(int by)
virtual void PopRegister(int register_index)
virtual bool CanReadUnaligned()
virtual Handle< HeapObject > GetCode(Handle< String > source)
virtual bool CheckSpecialCharacterClass(uc16 type, Label *on_no_match)
static int CheckStackGuardState(Address *return_address, Code *re_code, Address re_frame)
virtual void WriteCurrentPositionToRegister(int reg, int cp_offset)
virtual void CheckNotCharacter(unsigned c, Label *on_not_equal)
virtual void ReadCurrentPositionFromRegister(int reg)
virtual void SetCurrentPositionFromEnd(int by)
virtual void IfRegisterEqPos(int reg, Label *if_eq)
virtual void AdvanceRegister(int reg, int by)
virtual void ClearRegisters(int reg_from, int reg_to)
virtual void CheckPosition(int cp_offset, Label *on_outside_input)
virtual void CheckGreedyLoop(Label *on_tos_equals_current_position)
virtual void CheckCharacterNotInRange(uc16 from, uc16 to, Label *on_not_in_range)
virtual void CheckNotCharacterAfterAnd(unsigned c, unsigned mask, Label *on_not_equal)
virtual void PushRegister(int register_index, StackCheckFlag check_stack_limit)
virtual void IfRegisterGE(int reg, int comparand, Label *if_ge)
virtual void CheckCharacters(Vector< const uc16 > str, int cp_offset, Label *on_failure, bool check_end_of_string)
virtual void SetRegister(int register_index, int to)
virtual void CheckNotBackReference(int start_reg, Label *on_no_match)
virtual void WriteStackPointerToRegister(int reg)
virtual void GoTo(Label *label)
virtual void PushBacktrack(Label *label)
virtual void PopCurrentPosition()
virtual void IfRegisterLT(int reg, int comparand, Label *if_lt)
RegExpMacroAssemblerARM(Mode mode, int registers_to_save, Zone *zone)
virtual int stack_limit_slack()
virtual void CheckCharacterGT(uc16 limit, Label *on_greater)
virtual void LoadCurrentCharacter(int cp_offset, Label *on_end_of_input, bool check_bounds=true, int characters=1)
virtual void CheckCharacterAfterAnd(unsigned c, unsigned mask, Label *on_equal)