17 : slow_safe_compiler_(
false),
18 global_mode_(NOT_GLOBAL),
27 #ifndef V8_INTERPRETED_REGEXP
39 return FLAG_enable_unaligned_accesses && !
slow_safe();
46 DCHECK(subject->IsExternalString() || subject->IsSeqString());
48 DCHECK(start_index <= subject->length());
51 if (StringShape(subject).IsExternal()) {
52 const uint8_t* data = ExternalOneByteString::cast(subject)->GetChars();
53 address =
reinterpret_cast<const byte*
>(data);
55 DCHECK(subject->IsSeqOneByteString());
56 const uint8_t* data = SeqOneByteString::cast(subject)->GetChars();
57 address =
reinterpret_cast<const byte*
>(data);
59 return address + start_index;
62 if (StringShape(subject).IsExternal()) {
63 data = ExternalTwoByteString::cast(subject)->GetChars();
65 DCHECK(subject->IsSeqTwoByteString());
66 data = SeqTwoByteString::cast(subject)->GetChars();
68 return reinterpret_cast<const byte*
>(data + start_index);
76 int offsets_vector_length,
81 DCHECK(previous_index >= 0);
82 DCHECK(previous_index <= subject->length());
88 String* subject_ptr = *subject;
90 int start_offset = previous_index;
91 int char_length = subject_ptr->
length() - start_offset;
96 if (StringShape(subject_ptr).IsCons()) {
97 DCHECK_EQ(0, ConsString::cast(subject_ptr)->second()->length());
98 subject_ptr = ConsString::cast(subject_ptr)->first();
99 }
else if (StringShape(subject_ptr).IsSliced()) {
101 subject_ptr = slice->
parent();
102 slice_offset = slice->
offset();
106 DCHECK(subject_ptr->IsExternalString() || subject_ptr->IsSeqString());
108 int char_size_shift = is_one_byte ? 0 : 1;
110 const byte* input_start =
112 int byte_length = char_length << char_size_shift;
113 const byte* input_end = input_start + byte_length;
120 offsets_vector_length,
130 const byte* input_start,
131 const byte* input_end,
157 return static_cast<Result>(result);
162 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u,
163 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u,
164 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u,
165 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u,
167 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u,
168 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u,
169 0xffu, 0xffu, 0xffu, 0xffu, 0xffu, 0xffu, 0xffu, 0xffu,
170 0xffu, 0xffu, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u,
172 0x00u, 0xffu, 0xffu, 0xffu, 0xffu, 0xffu, 0xffu, 0xffu,
173 0xffu, 0xffu, 0xffu, 0xffu, 0xffu, 0xffu, 0xffu, 0xffu,
174 0xffu, 0xffu, 0xffu, 0xffu, 0xffu, 0xffu, 0xffu, 0xffu,
175 0xffu, 0xffu, 0xffu, 0x00u, 0x00u, 0x00u, 0x00u, 0xffu,
177 0x00u, 0xffu, 0xffu, 0xffu, 0xffu, 0xffu, 0xffu, 0xffu,
178 0xffu, 0xffu, 0xffu, 0xffu, 0xffu, 0xffu, 0xffu, 0xffu,
179 0xffu, 0xffu, 0xffu, 0xffu, 0xffu, 0xffu, 0xffu, 0xffu,
180 0xffu, 0xffu, 0xffu, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u,
182 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u,
183 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u,
184 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u,
185 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u,
187 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u,
188 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u,
189 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u,
190 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u,
192 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u,
193 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u,
194 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u,
195 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u,
197 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u,
198 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u,
199 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u,
200 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u,
214 DCHECK(byte_length % 2 == 0);
215 uc16* substring1 =
reinterpret_cast<uc16*
>(byte_offset1);
216 uc16* substring2 =
reinterpret_cast<uc16*
>(byte_offset2);
217 size_t length = byte_length >> 1;
219 for (
size_t i = 0;
i < length;
i++) {
224 canonicalize->
get(c1,
'\0',
s1);
227 canonicalize->
get(c2,
'\0',
s2);
228 if (
s1[0] !=
s2[0]) {
244 DCHECK(old_stack_base == *stack_base);
245 DCHECK(stack_pointer <= old_stack_base);
246 DCHECK(
static_cast<size_t>(old_stack_base - stack_pointer) <=
size);
248 if (new_stack_base ==
NULL) {
251 *stack_base = new_stack_base;
252 intptr_t stack_content_size = old_stack_base - stack_pointer;
253 return new_stack_base - stack_content_size;
int get(uchar c, uchar n, uchar *result)
RegExpStack * regexp_stack()
unibrow::Mapping< unibrow::Ecma262Canonicalize > * regexp_macro_assembler_canonicalize()
bool has_pending_exception()
virtual bool CanReadUnaligned()
static Address GrowStack(Address stack_pointer, Address *stack_top, Isolate *isolate)
NativeRegExpMacroAssembler(Zone *zone)
static const byte word_character_map[256]
static Result Execute(Code *code, String *input, int start_offset, const byte *input_start, const byte *input_end, int *output, int output_size, Isolate *isolate)
static Result Match(Handle< Code > regexp, Handle< String > subject, int *offsets_vector, int offsets_vector_length, int previous_index, Isolate *isolate)
static const byte * StringCharacterPosition(String *subject, int start_index)
static int CaseInsensitiveCompareUC16(Address byte_offset1, Address byte_offset2, size_t byte_length, Isolate *isolate)
virtual ~NativeRegExpMacroAssembler()
virtual ~RegExpMacroAssembler()
RegExpMacroAssembler(Zone *zone)
RegExpStack * stack() const
Address EnsureCapacity(size_t size)
bool IsOneByteRepresentation() const
enable harmony numeric enable harmony object literal extensions Optimize object size
enable harmony numeric enable harmony object literal extensions Optimize object Array DOM strings and string trace pretenuring decisions of HAllocate instructions Enables optimizations which favor memory size over execution speed maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining trace the tracking of allocation sites deoptimize every n garbage collections perform array bounds checks elimination analyze liveness of environment slots and zap dead values flushes the cache of optimized code for closures on every GC allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes enable context specialization in TurboFan execution budget before interrupt is triggered max percentage of megamorphic generic ICs to allow optimization enable use of SAHF instruction if enable use of VFP3 instructions if available enable use of NEON instructions if enable use of SDIV and UDIV instructions if enable use of MLS 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 enable alignment of csp to bytes on platforms which prefer the register to always be NULL
#define DCHECK(condition)
#define DCHECK_EQ(v1, v2)
Debugger support for the V8 JavaScript engine.
#define CALL_GENERATED_REGEXP_CODE(entry, p0, p1, p2, p3, p4, p5, p6, p7, p8)