39 : slow_safe_compiler_(
false),
40 global_mode_(NOT_GLOBAL),
50 #ifdef V8_HOST_CAN_READ_UNALIGNED
58 #ifndef V8_INTERPRETED_REGEXP // Avoid unused code, e.g., on ARM.
70 #ifdef V8_TARGET_CAN_READ_UNALIGNED
81 ASSERT(subject->IsExternalString() || subject->IsSeqString());
83 ASSERT(start_index <= subject->length());
86 if (StringShape(subject).IsExternal()) {
88 address =
reinterpret_cast<const byte*
>(data);
90 ASSERT(subject->IsSeqAsciiString());
92 address =
reinterpret_cast<const byte*
>(data);
94 return address + start_index;
97 if (StringShape(subject).IsExternal()) {
100 ASSERT(subject->IsSeqTwoByteString());
103 return reinterpret_cast<const byte*
>(data + start_index);
111 int offsets_vector_length,
115 ASSERT(subject->IsFlat());
116 ASSERT(previous_index >= 0);
117 ASSERT(previous_index <= subject->length());
123 String* subject_ptr = *subject;
125 int start_offset = previous_index;
126 int char_length = subject_ptr->
length() - start_offset;
127 int slice_offset = 0;
131 if (StringShape(subject_ptr).IsCons()) {
134 }
else if (StringShape(subject_ptr).IsSliced()) {
136 subject_ptr = slice->
parent();
137 slice_offset = slice->
offset();
141 ASSERT(subject_ptr->IsExternalString() || subject_ptr->IsSeqString());
143 int char_size_shift = is_ascii ? 0 : 1;
145 const byte* input_start =
147 int byte_length = char_length << char_size_shift;
148 const byte* input_end = input_start + byte_length;
155 offsets_vector_length,
165 const byte* input_start,
166 const byte* input_end,
170 ASSERT(isolate == Isolate::Current());
193 return static_cast<Result>(result);
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,
201 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u,
203 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u,
204 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u,
205 0xffu, 0xffu, 0xffu, 0xffu, 0xffu, 0xffu, 0xffu, 0xffu,
206 0xffu, 0xffu, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u,
208 0x00u, 0xffu, 0xffu, 0xffu, 0xffu, 0xffu, 0xffu, 0xffu,
209 0xffu, 0xffu, 0xffu, 0xffu, 0xffu, 0xffu, 0xffu, 0xffu,
210 0xffu, 0xffu, 0xffu, 0xffu, 0xffu, 0xffu, 0xffu, 0xffu,
211 0xffu, 0xffu, 0xffu, 0x00u, 0x00u, 0x00u, 0x00u, 0xffu,
213 0x00u, 0xffu, 0xffu, 0xffu, 0xffu, 0xffu, 0xffu, 0xffu,
214 0xffu, 0xffu, 0xffu, 0xffu, 0xffu, 0xffu, 0xffu, 0xffu,
215 0xffu, 0xffu, 0xffu, 0xffu, 0xffu, 0xffu, 0xffu, 0xffu,
216 0xffu, 0xffu, 0xffu, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u,
225 ASSERT(isolate == Isolate::Current());
231 ASSERT(byte_length % 2 == 0);
232 uc16* substring1 =
reinterpret_cast<uc16*
>(byte_offset1);
233 uc16* substring2 =
reinterpret_cast<uc16*
>(byte_offset2);
234 size_t length = byte_length >> 1;
236 for (
size_t i = 0; i < length; i++) {
241 canonicalize->
get(c1,
'\0', s1);
244 canonicalize->
get(c2,
'\0', s2);
245 if (s1[0] != s2[0]) {
258 ASSERT(isolate == Isolate::Current());
262 ASSERT(old_stack_base == *stack_base);
263 ASSERT(stack_pointer <= old_stack_base);
264 ASSERT(static_cast<size_t>(old_stack_base - stack_pointer) <= size);
266 if (new_stack_base ==
NULL) {
269 *stack_base = new_stack_base;
270 intptr_t stack_content_size = old_stack_base - stack_pointer;
271 return new_stack_base - stack_content_size;
274 #endif // V8_INTERPRETED_REGEXP
Failure * StackOverflow()
virtual bool CanReadUnaligned()
#define CALL_GENERATED_REGEXP_CODE(entry, p0, p1, p2, p3, p4, p5, p6, p7, p8)
virtual ~NativeRegExpMacroAssembler()
Address EnsureCapacity(size_t size)
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)
bool IsAsciiRepresentation()
static ExternalTwoByteString * cast(Object *obj)
virtual ~RegExpMacroAssembler()
RegExpStack * regexp_stack()
#define ASSERT(condition)
RegExpMacroAssembler(Zone *zone)
RegExpStack * stack() const
static ExternalAsciiString * cast(Object *obj)
int get(uchar c, uchar n, uchar *result)
virtual bool CanReadUnaligned()
static SlicedString * cast(Object *obj)
unibrow::Mapping< unibrow::Ecma262Canonicalize > * regexp_macro_assembler_canonicalize()
static int CaseInsensitiveCompareUC16(Address byte_offset1, Address byte_offset2, size_t byte_length, Isolate *isolate)
static SeqAsciiString * cast(Object *obj)
static const byte word_character_map[128]
bool has_pending_exception()
static SeqTwoByteString * cast(Object *obj)
static const byte * StringCharacterPosition(String *subject, int start_index)
static Result Match(Handle< Code > regexp, Handle< String > subject, int *offsets_vector, int offsets_vector_length, int previous_index, Isolate *isolate)
#define ASSERT_EQ(v1, v2)
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 trace on stack replacement optimize closures functions with arguments object optimize functions containing for in loops profiler considers IC stability primitive functions trigger their own optimization re try self optimization if it failed insert an interrupt check at function exit execution budget before interrupt is triggered call count before self optimization self_optimization count_based_interrupts weighted_back_edges trace_opt emit comments in code disassembly enable use of SSE3 instructions if available enable use of CMOV instruction if available enable use of SAHF instruction if enable use of VFP3 instructions if available this implies enabling ARMv7 enable use of ARMv7 instructions if enable use of MIPS FPU instructions if NULL
static Address GrowStack(Address stack_pointer, Address *stack_top, Isolate *isolate)
NativeRegExpMacroAssembler(Zone *zone)
static ConsString * cast(Object *obj)
const uint16_t * GetChars()