42 #ifdef V8_INTERPRETED_REGEXP
44 #else // V8_INTERPRETED_REGEXP
47 #if V8_TARGET_ARCH_ARM
52 #if V8_TARGET_ARCH_ARM64
57 #if V8_TARGET_ARCH_MIPS
62 #if V8_TARGET_ARCH_X64
67 #if V8_TARGET_ARCH_IA32
72 #endif // V8_INTERPRETED_REGEXP
74 using namespace v8::internal;
77 static bool CheckParse(
const char* input) {
83 return v8::internal::RegExpParser::ParseRegExp(
84 &reader,
false, &result, &zone);
94 CHECK(v8::internal::RegExpParser::ParseRegExp(
95 &reader,
false, &result, &zone));
103 static bool CheckSimple(
const char* input) {
109 CHECK(v8::internal::RegExpParser::ParseRegExp(
110 &reader,
false, &result, &zone));
122 static MinMaxPair CheckMinMaxMatch(
const char* input) {
128 CHECK(v8::internal::RegExpParser::ParseRegExp(
129 &reader,
false, &result, &zone));
139 #define CHECK_PARSE_ERROR(input) CHECK(!CheckParse(input))
140 #define CHECK_PARSE_EQ(input, expected) CHECK_EQ(expected, Parse(input).get())
141 #define CHECK_SIMPLE(input, simple) CHECK_EQ(simple, CheckSimple(input));
142 #define CHECK_MIN_MAX(input, min, max) \
143 { MinMaxPair min_max = CheckMinMaxMatch(input); \
144 CHECK_EQ(min, min_max.min_match); \
145 CHECK_EQ(max, min_max.max_match); \
174 CHECK_PARSE_EQ(
"a\\fb\\nc\\rd\\te\\vf",
"'a\\x0cb\\x0ac\\x0dd\\x09e\\x0bf'");
179 CHECK_PARSE_EQ(
"foo|(bar|baz)|quux",
"(| 'foo' (^ (| 'bar' 'baz')) 'quux')");
201 "'\\x0a\\x0a\\x09\\x09\\x0b\\x0b'");
218 CHECK_PARSE_EQ(
"[\\[\\]\\{\\}\\(\\)\\%\\^\\#\\ ]",
"[[ ] { } ( ) % ^ # ]");
229 CHECK_PARSE_EQ(
"(x)(x)(x)\\1",
"(: (^ 'x') (^ 'x') (^ 'x') (<- 1))");
230 CHECK_PARSE_EQ(
"(x)(x)(x)\\2",
"(: (^ 'x') (^ 'x') (^ 'x') (<- 2))");
231 CHECK_PARSE_EQ(
"(x)(x)(x)\\3",
"(: (^ 'x') (^ 'x') (^ 'x') (<- 3))");
232 CHECK_PARSE_EQ(
"(x)(x)(x)\\4",
"(: (^ 'x') (^ 'x') (^ 'x') '\\x04')");
234 " (# 0 - g (<- 1)))");
236 " (# 0 - g (<- 2)))");
238 " (# 0 - g (<- 3)))");
240 " (# 0 - g '\\x04'))");
242 "(: (^ 'x') (^ 'x') (^ 'x') (^ 'x') (^ 'x') (^ 'x')"
243 " (^ 'x') (^ 'x') (^ 'x') (^ 'x') (<- 10))");
245 "(: (^ 'x') (^ 'x') (^ 'x') (^ 'x') (^ 'x') (^ 'x')"
246 " (^ 'x') (^ 'x') (^ 'x') (^ 'x') '\\x09')");
257 CHECK_PARSE_EQ(
"(?!\\1(a\\1)\\1)\\1",
"(: (-> - (: (^ 'a') (<- 1))) (<- 1))");
395 static void ExpectError(
const char* input,
396 const char* expected) {
402 CHECK(!v8::internal::RegExpParser::ParseRegExp(
403 &reader,
false, &result, &zone));
412 const char* kEndBackslash =
"\\ at end of pattern";
413 ExpectError(
"\\", kEndBackslash);
414 const char* kUnterminatedGroup =
"Unterminated group";
415 ExpectError(
"(foo", kUnterminatedGroup);
416 const char* kInvalidGroup =
"Invalid group";
417 ExpectError(
"(?", kInvalidGroup);
418 const char* kUnterminatedCharacterClass =
"Unterminated character class";
419 ExpectError(
"[", kUnterminatedCharacterClass);
420 ExpectError(
"[a-", kUnterminatedCharacterClass);
421 const char* kNothingToRepeat =
"Nothing to repeat";
422 ExpectError(
"*", kNothingToRepeat);
423 ExpectError(
"?", kNothingToRepeat);
424 ExpectError(
"+", kNothingToRepeat);
425 ExpectError(
"{1}", kNothingToRepeat);
426 ExpectError(
"{1,2}", kNothingToRepeat);
427 ExpectError(
"{1,}", kNothingToRepeat);
430 const int kMaxCaptures = 1 << 16;
431 const char* kTooManyCaptures =
"Too many captures";
434 for (
int i = 0; i <= kMaxCaptures; i++) {
435 accumulator.
Add(
"()");
438 ExpectError(many_captures.get(), kTooManyCaptures);
442 static bool IsDigit(
uc16 c) {
443 return (
'0' <= c && c <=
'9');
447 static bool NotDigit(
uc16 c) {
452 static bool IsWhiteSpaceOrLineTerminator(
uc16 c) {
459 static bool NotWhiteSpaceNorLineTermiantor(
uc16 c) {
460 return !IsWhiteSpaceOrLineTerminator(c);
464 static bool NotWord(
uc16 c) {
469 static void TestCharacterClassEscapes(
uc16 c,
bool (pred)(
uc16 c)) {
474 for (
unsigned i = 0; i < (1 << 16); i++) {
475 bool in_class =
false;
476 for (
int j = 0; !in_class && j < ranges->length(); j++) {
478 in_class = (range.
from() <= i && i <= range.
to());
488 TestCharacterClassEscapes(
'd', IsDigit);
489 TestCharacterClassEscapes(
'D', NotDigit);
490 TestCharacterClassEscapes(
's', IsWhiteSpaceOrLineTerminator);
491 TestCharacterClassEscapes(
'S', NotWhiteSpaceNorLineTermiantor);
493 TestCharacterClassEscapes(
'W', NotWord);
505 if (!v8::internal::RegExpParser::ParseRegExp(&reader, multiline,
506 &compile_data, zone))
520 return compile_data.
node;
524 static void Execute(
const char* input,
527 bool dot_output =
false) {
530 RegExpNode* node = Compile(input, multiline, is_ascii, &zone);
560 static unsigned PseudoRandom(
int i,
int j) {
561 return ~(~((i * 781) ^ (j * 329)));
567 static const unsigned kLimit = 1000;
571 for (
unsigned i = 0; i < kLimit; i++) seen[i] =
false;
572 #define CHECK_MAPS_EQUAL() do { \
573 for (unsigned k = 0; k < kLimit; k++) \
574 CHECK_EQ(seen[k], tree.Find(k, &loc)); \
576 for (
int i = 0; i < 50; i++) {
577 for (
int j = 0; j < 50; j++) {
578 unsigned next = PseudoRandom(i, j) % kLimit;
595 loc.set_value(3 * next);
599 int val = PseudoRandom(j, i) % kLimit;
606 val = PseudoRandom(i + j, i - j) % kLimit;
618 TEST(DispatchTableConstruction) {
621 static const int kLimit = 1000;
622 static const int kRangeCount = 8;
623 static const int kRangeSize = 16;
624 uc16 ranges[kRangeCount][2 * kRangeSize];
625 for (
int i = 0; i < kRangeCount; i++) {
627 for (
int j = 0; j < 2 * kRangeSize; j++) {
628 range[j] = PseudoRandom(i + 25, j + 87) % kLimit;
631 for (
int j = 1; j < 2 * kRangeSize; j++) {
632 CHECK(range[j-1] <= range[j]);
638 for (
int i = 0; i < kRangeCount; i++) {
639 uc16* range = ranges[i];
640 for (
int j = 0; j < 2 * kRangeSize; j += 2)
644 for (
int p = 0; p < kLimit; p++) {
646 for (
int j = 0; j < kRangeCount; j++) {
647 uc16* range = ranges[j];
649 for (
int k = 0; !is_on && (k < 2 * kRangeSize); k += 2)
650 is_on = (range[k] <= p && p <= range[k + 1]);
660 TEST(ParsePossessiveRepetition) {
661 bool old_flag_value = FLAG_regexp_possessive_quantifier;
664 FLAG_regexp_possessive_quantifier =
true;
673 FLAG_regexp_possessive_quantifier =
false;
681 FLAG_regexp_possessive_quantifier = old_flag_value;
689 #ifndef V8_INTERPRETED_REGEXP
691 #if V8_TARGET_ARCH_IA32
693 #elif V8_TARGET_ARCH_X64
695 #elif V8_TARGET_ARCH_ARM
697 #elif V8_TARGET_ARCH_ARM64
699 #elif V8_TARGET_ARCH_MIPS
706 : scope_(
CcTest::isolate()),
719 static ArchRegExpMacroAssembler::Result Execute(
Code*
code,
722 const byte* input_start,
723 const byte* input_end,
737 TEST(MacroAssemblerNativeSuccess) {
752 int captures[4] = {42, 37, 87, 117};
755 const byte* start_adr =
756 reinterpret_cast<const byte*
>(seq_input->GetCharsAddress());
763 start_adr + seq_input->length(),
774 TEST(MacroAssemblerNativeSimple) {
783 Label fail, backtrack;
784 m.PushBacktrack(&fail);
785 m.CheckNotAtStart(
NULL);
786 m.LoadCurrentCharacter(2,
NULL);
787 m.CheckNotCharacter(
'o',
NULL);
788 m.LoadCurrentCharacter(1,
NULL,
false);
789 m.CheckNotCharacter(
'o',
NULL);
790 m.LoadCurrentCharacter(0,
NULL,
false);
791 m.CheckNotCharacter(
'f',
NULL);
792 m.WriteCurrentPositionToRegister(0, 0);
793 m.WriteCurrentPositionToRegister(1, 3);
794 m.AdvanceCurrentPosition(3);
795 m.PushBacktrack(&backtrack);
806 int captures[4] = {42, 37, 87, 117};
809 Address start_adr = seq_input->GetCharsAddress();
816 start_adr + input->length(),
827 start_adr = seq_input->GetCharsAddress();
829 result = Execute(*code,
833 start_adr + input->length(),
840 TEST(MacroAssemblerNativeSimpleUC16) {
849 Label fail, backtrack;
850 m.PushBacktrack(&fail);
851 m.CheckNotAtStart(
NULL);
852 m.LoadCurrentCharacter(2,
NULL);
853 m.CheckNotCharacter(
'o',
NULL);
854 m.LoadCurrentCharacter(1,
NULL,
false);
855 m.CheckNotCharacter(
'o',
NULL);
856 m.LoadCurrentCharacter(0,
NULL,
false);
857 m.CheckNotCharacter(
'f',
NULL);
858 m.WriteCurrentPositionToRegister(0, 0);
859 m.WriteCurrentPositionToRegister(1, 3);
860 m.AdvanceCurrentPosition(3);
861 m.PushBacktrack(&backtrack);
872 int captures[4] = {42, 37, 87, 117};
873 const uc16 input_data[6] = {
'f',
'o',
'o',
'f',
'o',
874 static_cast<uc16>(0x2603)};
878 Address start_adr = seq_input->GetCharsAddress();
885 start_adr + input->length(),
894 const uc16 input_data2[9] = {
'b',
'a',
'r',
'b',
'a',
'r',
'b',
'a',
895 static_cast<uc16>(0x2603)};
898 start_adr = seq_input->GetCharsAddress();
900 result = Execute(*code,
904 start_adr + input->length() * 2,
911 TEST(MacroAssemblerNativeBacktrack) {
922 m.LoadCurrentCharacter(10, &fail);
925 m.PushBacktrack(&backtrack);
926 m.LoadCurrentCharacter(10,
NULL);
937 Address start_adr = seq_input->GetCharsAddress();
944 start_adr + input->length(),
951 TEST(MacroAssemblerNativeBackReferenceASCII) {
960 m.WriteCurrentPositionToRegister(0, 0);
961 m.AdvanceCurrentPosition(2);
962 m.WriteCurrentPositionToRegister(1, 0);
964 m.CheckNotBackReference(0, &nomatch);
967 m.AdvanceCurrentPosition(2);
969 m.CheckNotBackReference(0, &missing_match);
970 m.WriteCurrentPositionToRegister(2, 0);
972 m.Bind(&missing_match);
981 Address start_adr = seq_input->GetCharsAddress();
989 start_adr + input->length(),
1000 TEST(MacroAssemblerNativeBackReferenceUC16) {
1009 m.WriteCurrentPositionToRegister(0, 0);
1010 m.AdvanceCurrentPosition(2);
1011 m.WriteCurrentPositionToRegister(1, 0);
1013 m.CheckNotBackReference(0, &nomatch);
1016 m.AdvanceCurrentPosition(2);
1017 Label missing_match;
1018 m.CheckNotBackReference(0, &missing_match);
1019 m.WriteCurrentPositionToRegister(2, 0);
1021 m.Bind(&missing_match);
1028 const uc16 input_data[6] = {
'f', 0x2028,
'o',
'o',
'f', 0x2028};
1032 Address start_adr = seq_input->GetCharsAddress();
1040 start_adr + input->length() * 2,
1052 TEST(MacroAssemblernativeAtStart) {
1061 Label not_at_start, newline, fail;
1062 m.CheckNotAtStart(¬_at_start);
1064 m.CheckCharacter(
'\n', &newline);
1068 m.LoadCurrentCharacter(0, &fail);
1069 m.CheckNotCharacter(
'f', &fail);
1072 m.Bind(¬_at_start);
1075 m.CheckCharacter(
'o', &prevo);
1078 m.LoadCurrentCharacter(0, &fail);
1079 m.CheckNotCharacter(
'b', &fail);
1088 Address start_adr = seq_input->GetCharsAddress();
1095 start_adr + input->length(),
1100 result = Execute(*code,
1104 start_adr + input->length(),
1111 TEST(MacroAssemblerNativeBackRefNoCase) {
1122 m.WriteCurrentPositionToRegister(0, 0);
1123 m.WriteCurrentPositionToRegister(2, 0);
1124 m.AdvanceCurrentPosition(3);
1125 m.WriteCurrentPositionToRegister(3, 0);
1126 m.CheckNotBackReferenceIgnoreCase(2, &fail);
1127 m.CheckNotBackReferenceIgnoreCase(2, &fail);
1128 Label expected_fail;
1129 m.CheckNotBackReferenceIgnoreCase(2, &expected_fail);
1133 m.Bind(&expected_fail);
1134 m.AdvanceCurrentPosition(3);
1135 m.CheckNotBackReferenceIgnoreCase(2, &succ);
1139 m.WriteCurrentPositionToRegister(1, 0);
1150 Address start_adr = seq_input->GetCharsAddress();
1158 start_adr + input->length(),
1170 TEST(MacroAssemblerNativeRegisters) {
1179 uc16 foo_chars[3] = {
'f',
'o',
'o'};
1182 enum registers { out1, out2, out3, out4, out5, out6,
sp, loop_cnt };
1185 m.WriteCurrentPositionToRegister(out1, 0);
1187 m.PushBacktrack(&backtrack);
1188 m.WriteStackPointerToRegister(
sp);
1190 m.AdvanceCurrentPosition(2);
1191 m.WriteCurrentPositionToRegister(out1, 0);
1193 m.PushBacktrack(&fail);
1195 m.ReadStackPointerFromRegister(
sp);
1199 m.PushCurrentPosition();
1200 m.AdvanceCurrentPosition(2);
1201 m.PopCurrentPosition();
1204 m.PopRegister(out1);
1205 m.ReadCurrentPositionFromRegister(out1);
1206 m.AdvanceCurrentPosition(3);
1207 m.WriteCurrentPositionToRegister(out2, 0);
1210 m.SetRegister(loop_cnt, 0);
1212 m.AdvanceRegister(loop_cnt, 1);
1213 m.AdvanceCurrentPosition(1);
1214 m.IfRegisterLT(loop_cnt, 3, &loop);
1215 m.WriteCurrentPositionToRegister(out3, 0);
1218 m.SetRegister(loop_cnt, 2);
1220 m.AdvanceRegister(loop_cnt, -1);
1221 m.AdvanceCurrentPosition(1);
1222 m.IfRegisterGE(loop_cnt, 0, &loop2);
1223 m.WriteCurrentPositionToRegister(out4, 0);
1229 m.ReadCurrentPositionFromRegister(out3);
1231 m.AdvanceCurrentPosition(1);
1232 m.CheckGreedyLoop(&exit_loop3);
1234 m.Bind(&exit_loop3);
1235 m.PopCurrentPosition();
1236 m.WriteCurrentPositionToRegister(out5, 0);
1252 Address start_adr = seq_input->GetCharsAddress();
1260 start_adr + input->length(),
1273 TEST(MacroAssemblerStackOverflow) {
1284 m.PushBacktrack(&loop);
1296 Address start_adr = seq_input->GetCharsAddress();
1303 start_adr + input->length(),
1312 TEST(MacroAssemblerNativeLotsOfRegisters) {
1323 const int large_number = 8000;
1324 m.WriteCurrentPositionToRegister(large_number, 42);
1325 m.WriteCurrentPositionToRegister(0, 0);
1326 m.WriteCurrentPositionToRegister(1, 1);
1328 m.CheckNotBackReference(0, &done);
1343 Address start_adr = seq_input->GetCharsAddress();
1351 start_adr + input->length(),
1361 #else // V8_INTERPRETED_REGEXP
1367 RegExpMacroAssemblerIrregexp m(
Vector<byte>(codes, 1024), &zone);
1369 Label start, fail, backtrack;
1371 m.SetRegister(4, 42);
1373 m.AdvanceRegister(4, 42);
1377 m.PushBacktrack(&fail);
1378 m.CheckNotAtStart(
NULL);
1379 m.LoadCurrentCharacter(0,
NULL);
1380 m.CheckNotCharacter(
'f',
NULL);
1381 m.LoadCurrentCharacter(1,
NULL);
1382 m.CheckNotCharacter(
'o',
NULL);
1383 m.LoadCurrentCharacter(2,
NULL);
1384 m.CheckNotCharacter(
'o',
NULL);
1385 m.WriteCurrentPositionToRegister(0, 0);
1386 m.WriteCurrentPositionToRegister(1, 3);
1387 m.WriteCurrentPositionToRegister(2, 1);
1388 m.WriteCurrentPositionToRegister(3, 2);
1389 m.AdvanceCurrentPosition(3);
1390 m.PushBacktrack(&backtrack);
1393 m.ClearRegisters(2, 3);
1407 const uc16 str1[] = {
'f',
'o',
'o',
'b',
'a',
'r'};
1418 const uc16 str2[] = {
'b',
'a',
'r',
'f',
'o',
'o'};
1426 #endif // V8_INTERPRETED_REGEXP
1431 static const int kLimit = 1000;
1432 static const int kRangeCount = 16;
1433 for (
int t = 0; t < 10; t++) {
1437 for (
int i = 0; i < kRangeCount; i++) {
1438 int from = PseudoRandom(t + 87, i + 25) % kLimit;
1439 int to = from + (PseudoRandom(i + 87, t + 25) % (kLimit / 20));
1440 if (to > kLimit) to = kLimit;
1447 for (
int i = 0; i < kLimit; i++) {
1449 for (
int j = 0; !is_on && j < kRangeCount; j++)
1482 for (
char lower =
'a'; lower <=
'z'; lower++) {
1483 char upper = lower + (
'A' -
'a');
1484 CHECK_EQ(canonicalize(lower), canonicalize(upper));
1486 int length = un_canonicalize.
get(lower,
'\0', uncanon);
1491 for (
uc32 c = 128; c < (1 << 21); c++)
1495 for (
uc32 c = 0; c < (1 << 16); c++) {
1497 int length = to_upper.
get(c,
'\0', upper);
1503 if (length > 1 || (c >= 128 && u < 128))
1510 static uc32 CanonRangeEnd(
uc32 c) {
1527 int block_start = 0;
1528 while (block_start <= 0xFFFF) {
1529 uc32 block_end = CanonRangeEnd(block_start);
1530 unsigned block_length = block_end - block_start + 1;
1531 if (block_length > 1) {
1533 int first_length = un_canonicalize.
get(block_start,
'\0', first);
1534 for (
unsigned i = 1; i < block_length; i++) {
1536 int succ_length = un_canonicalize.
get(block_start + i,
'\0', succ);
1537 CHECK_EQ(first_length, succ_length);
1538 for (
int j = 0; j < succ_length; j++) {
1539 int calc = first[j] + i;
1540 int found = succ[j];
1545 block_start = block_start + block_length;
1553 for (
int i = 0; i < (1 << 16); i++) {
1554 int length = un_canonicalize.
get(i,
'\0', chars);
1555 for (
int j = 0; j < length; j++) {
1557 int length2 = un_canonicalize.
get(chars[j],
'\0', chars2);
1559 for (
int k = 0; k < length; k++)
1560 CHECK_EQ(static_cast<int>(chars[k]), static_cast<int>(chars2[k]));
1569 int count = expected.
length();
1574 for (
int i = 0; i < list->length(); i++) {
1581 static void TestSimpleRangeCaseIndependence(
CharacterRange input,
1584 vector[0] = expected;
1585 TestRangeCaseIndependence(input, vector);
1589 TEST(CharacterRangeCaseIndependence) {
1603 TestSimpleRangeCaseIndependence(
CharacterRange(
'a' - 1,
'z' + 1),
1609 TestSimpleRangeCaseIndependence(
CharacterRange(
'A' - 1,
'Z' + 1),
1622 for (
int i = 0; i < ranges->length(); i++) {
1624 if (range.
from() <= c && c <= range.
to())
1641 for (
int i = 0; i < (1 << 16); i++) {
1642 bool in_base = InClass(i, base);
1644 bool in_overlay =
false;
1645 for (
int j = 0; !in_overlay && j < overlay.
length(); j += 2) {
1646 if (overlay[j] <= i && i < overlay[j+1])
1649 CHECK_EQ(in_overlay, InClass(i, included));
1650 CHECK_EQ(!in_overlay, InClass(i, excluded));
1652 CHECK(!InClass(i, included));
1653 CHECK(!InClass(i, excluded));
1664 CharacterSet set(list);
1739 for (
int i = 0; i < 5; i++) {
1755 for (
int i = 0; i < 7; i++) {
1776 for (
int i = 0; i < 9; i++) {
1794 for (
int i = 0; i < 6; i++) {
1811 Execute(
"\\b\\w+\\b",
false,
true,
true);
#define CHECK_MIN_MAX(input, min, max)
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 NULL
static bool Initialize(Deserializer *des)
bool Find(const Key &key, Locator *locator)
#define CHECK_EQ(expected, value)
static Vector< const int > GetWordBounds()
bool Insert(const Key &key, Locator *locator)
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)
void Sort(int(*cmp)(const T *, const T *))
static int Convert(uchar c, uchar n, uchar *result, bool *allow_caching_ptr)
static Handle< T > cast(Handle< S > that)
bool IsRegExpWord(uc16 c)
Handle< String > NewStringFromAscii(Vector< const char > str, PretenureFlag pretenure=NOT_TENURED)
void AddRange(CharacterRange range, int value, Zone *zone)
#define CHECK_PARSE_EQ(input, expected)
SmartArrayPointer< const char > ToString(Zone *zone)
static CharacterRange Everything()
#define ASSERT(condition)
static const int kMaxWidth
void clear_pending_exception()
int get(uchar c, uchar n, uchar *result)
void Add(Vector< const char > format, Vector< FmtElm > elms)
static void Split(ZoneList< CharacterRange > *base, Vector< const int > overlay, ZoneList< CharacterRange > **included, ZoneList< CharacterRange > **excluded, Zone *zone)
Handle< String > NewStringFromUtf8(Vector< const char > str, PretenureFlag pretenure=NOT_TENURED)
static int Convert(uchar c, uchar n, uchar *result, bool *allow_caching_ptr)
#define CHECK_PARSE_ERROR(input)
static CharacterRange Range(uc16 from, uc16 to)
static const int kInfinity
static const int kMaxWidth
static bool IsCanonical(ZoneList< CharacterRange > *ranges)
void AddInverse(ZoneList< CharacterRange > *ranges)
static int Compare(int a, int b)
virtual int min_match()=0
void AddCaseEquivalents(ZoneList< CharacterRange > *ranges, bool is_ascii, Zone *zone)
#define CHECK_MAPS_EQUAL()
bool IsRegExpNewline(uc16 c)
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 code(assertions) for debugging") DEFINE_bool(code_comments
static RegExpImpl::IrregexpResult Match(Isolate *isolate, Handle< ByteArray > code, Handle< String > subject, int *captures, int start_position)
Handle< String > NewStringFromTwoByte(Vector< const uc16 > str, PretenureFlag pretenure=NOT_TENURED)
#define CHECK_SIMPLE(input, simple)
static i::Isolate * i_isolate()
bool has_pending_exception()
bool FindLeastGreaterThan(const Key &key, Locator *locator)
Vector< const char > CStrVector(const char *data)
bool Remove(const Key &key)
bool FindGreatestLessThan(const Key &key, Locator *locator)
static const int kMaxWidth
#define ASSERT_EQ(v1, v2)
static void DotPrint(const char *label, RegExpNode *node, bool ignore_case)
void Add(const T &element, AllocationPolicy allocator=AllocationPolicy())
void set_choice_index(int value)
SmartArrayPointer< const char > ToCString() const
virtual int max_match()=0
static const int kMaxWidth
static void AddClassEscape(uc16 type, ZoneList< CharacterRange > *ranges, Zone *zone)
static CharacterRange Singleton(uc16 value)
static CompilationResult Compile(RegExpCompileData *input, bool ignore_case, bool global, bool multiline, Handle< String > pattern, Handle< String > sample_subject, bool is_ascii, Zone *zone)
static v8::Isolate * isolate()