28 #ifndef V8_ARM64_REGEXP_MACRO_ASSEMBLER_ARM64_H_
29 #define V8_ARM64_REGEXP_MACRO_ASSEMBLER_ARM64_H_
39 #ifndef V8_INTERPRETED_REGEXP
48 virtual void Bind(Label* label);
59 bool check_end_of_string);
80 Label* on_not_in_range);
85 virtual void CheckPosition(
int cp_offset, Label* on_outside_input);
90 virtual void GoTo(Label* label);
91 virtual void IfRegisterGE(
int reg,
int comparand, Label* if_ge);
92 virtual void IfRegisterLT(
int reg,
int comparand, Label* if_lt);
96 Label* on_end_of_input,
97 bool check_bounds =
true,
108 virtual void SetRegister(
int register_index,
int to);
122 const byte** input_start,
123 const byte** input_end);
128 static const int kCalleeSavedRegisters = 0;
131 static const int kReturnAddress = kCalleeSavedRegisters + 11 *
kPointerSize;
132 static const int kSecondaryReturnAddress = kReturnAddress +
kPointerSize;
134 static const int kIsolate = kSecondaryReturnAddress +
kPointerSize;
138 static const int kDirectCall = kCalleeSavedRegisters -
kPointerSize;
139 static const int kStackBase = kDirectCall -
kPointerSize;
140 static const int kOutputSize = kStackBase -
kPointerSize;
144 static const int kSuccessCounter = kInput -
kPointerSize;
147 static const int kFirstRegisterOnStack = kSuccessCounter -
kWRegSize;
149 static const int kFirstCaptureOnStack = kSuccessCounter -
kXRegSize;
152 static const size_t kRegExpCodeSize = 1024;
156 static const int kNumRegistersToUnroll = 16;
161 static const int kNumCachedRegisters = 16;
165 void LoadCurrentCharacterUnchecked(
int cp_offset,
int character_count);
168 void CheckPreemption();
171 void CheckStackLimit();
174 void CallCheckStackGuardState(
Register scratch);
177 MemOperand register_location(
int register_index);
184 Register current_input_offset() {
return w21; }
187 Register current_character() {
return w22; }
190 Register input_end() {
return x25; }
193 Register input_start() {
return x26; }
197 Register start_offset() {
return w27; }
200 Register output_array() {
return x28; }
208 Register backtrack_stackpointer() {
return x23; }
211 Register code_pointer() {
return x20; }
214 Register non_position_value() {
return w24; }
217 Register twice_non_position_value() {
return x24; }
220 int char_size() {
return static_cast<int>(mode_); }
224 void BranchOrBacktrack(
Condition condition, Label* to);
228 void CompareAndBranchOrBacktrack(
Register reg,
233 inline void CallIf(Label* to,
Condition condition);
237 inline void SaveLinkRegister();
238 inline void RestoreLinkRegister();
255 RegisterState GetRegisterState(
int register_index) {
256 ASSERT(register_index >= 0);
257 if (register_index >= kNumCachedRegisters) {
260 if ((register_index % 2) == 0) {
269 inline void StoreRegister(
int register_index,
Register source);
284 inline Register GetCachedRegister(
int register_index);
298 int num_saved_registers_;
303 Label success_label_;
304 Label backtrack_label_;
306 Label check_preempt_label_;
307 Label stack_overflow_label_;
310 #endif // V8_INTERPRETED_REGEXP
315 #endif // V8_ARM64_REGEXP_MACRO_ASSEMBLER_ARM64_H_
virtual void CheckNotCharacterAfterMinusAnd(uc16 c, uc16 minus, uc16 mask, Label *on_not_equal)
virtual void CheckCharacterInRange(uc16 from, uc16 to, Label *on_in_range)
virtual void PushRegister(int register_index, StackCheckFlag check_stack_limit)
virtual void CheckNotBackReferenceIgnoreCase(int start_reg, Label *on_no_match)
Isolate * isolate() const
virtual int stack_limit_slack()
virtual void CheckCharacters(Vector< const uc16 > str, int cp_offset, Label *on_failure, bool check_end_of_string)
virtual IrregexpImplementation Implementation()
virtual void CheckCharacter(unsigned c, Label *on_equal)
virtual void GoTo(Label *label)
virtual void CheckAtStart(Label *on_at_start)
#define ASSERT(condition)
virtual bool CheckSpecialCharacterClass(uc16 type, Label *on_no_match)
virtual void PopCurrentPosition()
virtual void PushBacktrack(Label *label)
virtual void WriteStackPointerToRegister(int reg)
virtual void CheckCharacterLT(uc16 limit, Label *on_less)
virtual void LoadCurrentCharacter(int cp_offset, Label *on_end_of_input, bool check_bounds=true, int characters=1)
enable upcoming ES6 features enable harmony block scoping enable harmony enable harmony proxies enable harmony generators enable harmony numeric enable harmony string enable harmony math functions harmony_scoping harmony_symbols harmony_collections harmony_iteration harmony_strings harmony_scoping harmony_maths tracks arrays with only smi values Optimize object Array DOM strings and string pretenure call new trace pretenuring decisions of HAllocate instructions track fields with only smi values track fields with heap values track_fields track_fields Enables optimizations which favor memory size over execution speed use string slices optimization filter maximum number of GVN fix point iterations use function inlining use allocation folding eliminate write barriers targeting allocations in optimized code maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining crankshaft harvests type feedback from stub cache trace check elimination phase hydrogen tracing filter trace hydrogen to given file name trace inlining decisions trace store elimination trace all use positions trace global value numbering trace hydrogen escape analysis trace the tracking of allocation sites trace map generalization environment for every instruction deoptimize every n garbage collections put a break point before deoptimizing deoptimize uncommon cases use on stack replacement trace array bounds check elimination perform array index dehoisting use load elimination use store elimination use constant folding eliminate unreachable code number of stress runs when picking a function to watch for shared function not JSFunction itself flushes the cache of optimized code for closures on every GC functions with arguments object maximum number of escape analysis fix point iterations allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms concurrent on stack replacement do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes number of stack frames inspected by the profiler percentage of ICs that must have type info to allow optimization extra verbose compilation tracing generate extra emit comments in code disassembly enable use of SSE3 instructions if available enable use of CMOV instruction if available enable use of VFP3 instructions if available enable use of NEON instructions if enable use of SDIV and UDIV instructions if enable loading bit constant by means of movw movt instruction enable unaligned accesses for enable use of d16 d31 registers on ARM this requires VFP3 force all emitted branches to be in long mode(MIPS only)") DEFINE_string(expose_natives_as
virtual void Bind(Label *label)
virtual void CheckBitInTable(Handle< ByteArray > table, Label *on_bit_set)
virtual void IfRegisterLT(int reg, int comparand, Label *if_lt)
virtual void CheckNotCharacter(unsigned c, Label *on_not_equal)
virtual void CheckCharacterNotInRange(uc16 from, uc16 to, Label *on_not_in_range)
virtual void SetCurrentPositionFromEnd(int by)
virtual void CheckPosition(int cp_offset, Label *on_outside_input)
virtual void CheckNotBackReference(int start_reg, Label *on_no_match)
virtual void ReadCurrentPositionFromRegister(int reg)
virtual void ClearRegisters(int reg_from, int reg_to)
static int CheckStackGuardState(Address *return_address, Code *re_code, Address re_frame, int start_offset, const byte **input_start, const byte **input_end)
virtual ~RegExpMacroAssemblerARM64()
virtual void PushCurrentPosition()
virtual void IfRegisterEqPos(int reg, Label *if_eq)
virtual void PopRegister(int register_index)
RegExpMacroAssemblerARM64(Mode mode, int registers_to_save, Zone *zone)
virtual void IfRegisterGE(int reg, int comparand, Label *if_ge)
virtual void ReadStackPointerFromRegister(int reg)
virtual void SetRegister(int register_index, int to)
virtual void CheckNotAtStart(Label *on_not_at_start)
virtual Handle< HeapObject > GetCode(Handle< String > source)
virtual void CheckGreedyLoop(Label *on_tos_equals_current_position)
virtual void CheckCharacterAfterAnd(unsigned c, unsigned mask, Label *on_equal)
virtual void AdvanceRegister(int reg, int by)
virtual void AdvanceCurrentPosition(int by)
virtual void CheckCharacterGT(uc16 limit, Label *on_greater)
virtual void WriteCurrentPositionToRegister(int reg, int cp_offset)
virtual void CheckNotCharacterAfterAnd(unsigned c, unsigned mask, Label *on_not_equal)
virtual bool CanReadUnaligned()