28 #ifndef V8_X64_REGEXP_MACRO_ASSEMBLER_X64_H_
29 #define V8_X64_REGEXP_MACRO_ASSEMBLER_X64_H_
40 #ifndef V8_INTERPRETED_REGEXP
50 virtual void Bind(Label* label);
61 bool check_end_of_string);
82 Label* on_not_in_range);
87 virtual void CheckPosition(
int cp_offset, Label* on_outside_input);
92 virtual void GoTo(Label* label);
93 virtual void IfRegisterGE(
int reg,
int comparand, Label* if_ge);
94 virtual void IfRegisterLT(
int reg,
int comparand, Label* if_lt);
98 Label* on_end_of_input,
99 bool check_bounds =
true,
110 virtual void SetRegister(
int register_index,
int to);
119 int offsets_vector_length,
126 const byte* input_start,
127 const byte* input_end,
140 static const int kFramePointer = 0;
142 static const int kReturn_eip = kFramePointer +
kPointerSize;
143 static const int kFrameAlign = kReturn_eip +
kPointerSize;
150 static const int kInputString = kFrameAlign;
152 static const int kStartIndex = kInputString +
kPointerSize;
153 static const int kInputStart = kStartIndex +
kPointerSize;
154 static const int kInputEnd = kInputStart +
kPointerSize;
155 static const int kRegisterOutput = kInputEnd +
kPointerSize;
160 static const int kNumOutputRegisters = kRegisterOutput +
kPointerSize;
161 static const int kStackHighEnd = kNumOutputRegisters +
kPointerSize;
163 static const int kDirectCall = kStackHighEnd +
kPointerSize;
169 static const int kInputString = kFramePointer -
kPointerSize;
170 static const int kStartIndex = kInputString -
kPointerSize;
171 static const int kInputStart = kStartIndex -
kPointerSize;
172 static const int kInputEnd = kInputStart -
kPointerSize;
173 static const int kRegisterOutput = kInputEnd -
kPointerSize;
177 static const int kNumOutputRegisters = kRegisterOutput -
kPointerSize;
178 static const int kStackHighEnd = kFrameAlign;
179 static const int kDirectCall = kStackHighEnd +
kPointerSize;
186 static const int kBackup_rsi = kFramePointer -
kPointerSize;
187 static const int kBackup_rdi = kBackup_rsi -
kPointerSize;
188 static const int kBackup_rbx = kBackup_rdi -
kPointerSize;
189 static const int kLastCalleeSaveRegister = kBackup_rbx;
194 static const int kBackup_rbx = kNumOutputRegisters -
kPointerSize;
195 static const int kLastCalleeSaveRegister = kBackup_rbx;
198 static const int kSuccessfulCaptures = kLastCalleeSaveRegister -
kPointerSize;
201 static const int kInputStartMinusOne = kSuccessfulCaptures -
kPointerSize;
204 static const int kRegisterZero = kInputStartMinusOne -
kPointerSize;
207 static const size_t kRegExpCodeSize = 1024;
211 void LoadCurrentCharacterUnchecked(
int cp_offset,
int character_count);
214 void CheckPreemption();
217 void CheckStackLimit();
220 void CallCheckStackGuardState();
223 Operand register_location(
int register_index);
226 inline Register current_character() {
return rdx; }
230 inline Register backtrack_stackpointer() {
return rcx; }
233 inline Register code_object_pointer() {
return r8; }
236 inline int char_size() {
return static_cast<int>(mode_); }
240 void BranchOrBacktrack(
Condition condition, Label* to);
242 void MarkPositionForCodeRelativeFixup() {
246 void FixupCodeRelativePositions();
250 inline void SafeCall(Label* to);
251 inline void SafeCallTarget(Label* label);
252 inline void SafeReturn();
260 inline void Push(Immediate value);
265 inline void Push(Label* label);
276 MacroAssembler::NoRootArrayScope no_root_array_scope_;
288 int num_saved_registers_;
293 Label success_label_;
294 Label backtrack_label_;
296 Label check_preempt_label_;
297 Label stack_overflow_label_;
300 #endif // V8_INTERPRETED_REGEXP
304 #endif // V8_X64_REGEXP_MACRO_ASSEMBLER_X64_H_
virtual void CheckAtStart(Label *on_at_start)
static Result Execute(Code *code, String *input, int start_offset, const byte *input_start, const byte *input_end, int *output, bool at_start)
virtual void IfRegisterLT(int reg, int comparand, Label *if_lt)
virtual void ReadCurrentPositionFromRegister(int reg)
virtual void SetCurrentPositionFromEnd(int by)
virtual void IfRegisterGE(int reg, int comparand, Label *if_ge)
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 CheckNotCharacterAfterMinusAnd(uc16 c, uc16 minus, uc16 mask, Label *on_not_equal)
virtual void Bind(Label *label)
virtual void CheckGreedyLoop(Label *on_tos_equals_current_position)
virtual void PushCurrentPosition()
virtual Handle< HeapObject > GetCode(Handle< String > source)
virtual void ReadStackPointerFromRegister(int reg)
RegExpMacroAssemblerX64(Mode mode, int registers_to_save, Zone *zone)
virtual void PopRegister(int register_index)
virtual void CheckNotCharacter(uint32_t c, Label *on_not_equal)
virtual IrregexpImplementation Implementation()
virtual void CheckCharacterAfterAnd(uint32_t c, uint32_t mask, Label *on_equal)
virtual void CheckNotBackReference(int start_reg, Label *on_no_match)
virtual void CheckNotAtStart(Label *on_not_at_start)
virtual void CheckCharacter(uint32_t c, Label *on_equal)
virtual void WriteStackPointerToRegister(int reg)
virtual void GoTo(Label *label)
virtual void SetRegister(int register_index, int to)
virtual void WriteCurrentPositionToRegister(int reg, int cp_offset)
static Result Match(Handle< Code > regexp, Handle< String > subject, int *offsets_vector, int offsets_vector_length, int previous_index, Isolate *isolate)
virtual void CheckCharacterInRange(uc16 from, uc16 to, Label *on_in_range)
virtual void CheckNotBackReferenceIgnoreCase(int start_reg, Label *on_no_match)
virtual void AdvanceCurrentPosition(int by)
virtual void PushRegister(int register_index, StackCheckFlag check_stack_limit)
virtual void PopCurrentPosition()
virtual void CheckCharacterNotInRange(uc16 from, uc16 to, Label *on_not_in_range)
virtual void CheckCharacters(Vector< const uc16 > str, int cp_offset, Label *on_failure, bool check_end_of_string)
void Add(const T &element, AllocationPolicy allocator=AllocationPolicy())
virtual void IfRegisterEqPos(int reg, Label *if_eq)
virtual void AdvanceRegister(int reg, int by)
activate correct semantics for inheriting readonliness enable harmony semantics for typeof enable harmony enable harmony proxies enable all harmony harmony_scoping harmony_proxies harmony_scoping tracks arrays with only smi values automatically unbox arrays of doubles use crankshaft use hydrogen range analysis use hydrogen global value numbering use function inlining maximum number of AST nodes considered for a single inlining loop invariant code motion print statistics for hydrogen trace generated IR for specified phases trace register allocator trace range analysis trace representation types environment for every instruction put a break point before deoptimizing polymorphic inlining perform array bounds checks elimination use dead code elimination trace on stack replacement optimize closures cache optimized code for closures functions with arguments object loop weight for representation inference allow uint32 values on optimize frames if they are used only in safe operations track parallel recompilation enable all profiler experiments number of stack frames inspected by the profiler call recompile stub directly when self optimizing trigger profiler ticks based on counting instead of timing weight back edges by jump distance for interrupt triggering percentage of ICs that must have type info to allow optimization watch_ic_patching retry_self_opt interrupt_at_exit extra verbose compilation tracing generate extra code(assertions) for debugging") DEFINE_bool(code_comments
virtual int stack_limit_slack()
virtual void CheckBitInTable(Handle< ByteArray > table, Label *on_bit_set)
virtual void ClearRegisters(int reg_from, int reg_to)
virtual void PushBacktrack(Label *label)
static int CheckStackGuardState(Address *return_address, Code *re_code, Address re_frame)
virtual void CheckPosition(int cp_offset, Label *on_outside_input)
virtual void CheckCharacterGT(uc16 limit, Label *on_greater)
virtual ~RegExpMacroAssemblerX64()
virtual void CheckCharacterLT(uc16 limit, Label *on_less)
virtual void CheckNotCharacterAfterAnd(uint32_t c, uint32_t mask, Label *on_not_equal)