42 #ifdef V8_INTERPRETED_REGEXP
44 #else // V8_INTERPRETED_REGEXP
47 #ifdef V8_TARGET_ARCH_ARM
52 #ifdef V8_TARGET_ARCH_MIPS
57 #ifdef V8_TARGET_ARCH_X64
62 #ifdef V8_TARGET_ARCH_IA32
67 #endif // V8_INTERPRETED_REGEXP
69 using namespace v8::internal;
72 static bool CheckParse(
const char* input) {
75 ZoneScope zone_scope(Isolate::Current()->runtime_zone(),
DELETE_ON_EXIT);
79 &reader,
false, &result, Isolate::Current()->runtime_zone());
86 ZoneScope zone_scope(Isolate::Current()->runtime_zone(),
DELETE_ON_EXIT);
90 &reader,
false, &result, Isolate::Current()->runtime_zone()));
94 result.
tree->
ToString(Isolate::Current()->runtime_zone());
98 static bool CheckSimple(
const char* input) {
102 ZoneScope zone_scope(Isolate::Current()->runtime_zone(),
DELETE_ON_EXIT);
106 &reader,
false, &result, Isolate::Current()->runtime_zone()));
117 static MinMaxPair CheckMinMaxMatch(
const char* input) {
121 ZoneScope zone_scope(Isolate::Current()->runtime_zone(),
DELETE_ON_EXIT);
125 &reader,
false, &result, Isolate::Current()->runtime_zone()));
135 #define CHECK_PARSE_ERROR(input) CHECK(!CheckParse(input))
136 #define CHECK_PARSE_EQ(input, expected) CHECK_EQ(expected, *Parse(input))
137 #define CHECK_SIMPLE(input, simple) CHECK_EQ(simple, CheckSimple(input));
138 #define CHECK_MIN_MAX(input, min, max) \
139 { MinMaxPair min_max = CheckMinMaxMatch(input); \
140 CHECK_EQ(min, min_max.min_match); \
141 CHECK_EQ(max, min_max.max_match); \
170 CHECK_PARSE_EQ(
"a\\fb\\nc\\rd\\te\\vf",
"'a\\x0cb\\x0ac\\x0dd\\x09e\\x0bf'");
175 CHECK_PARSE_EQ(
"foo|(bar|baz)|quux",
"(| 'foo' (^ (| 'bar' 'baz')) 'quux')");
197 "'\\x0a\\x0a\\x09\\x09\\x0b\\x0b'");
214 CHECK_PARSE_EQ(
"[\\[\\]\\{\\}\\(\\)\\%\\^\\#\\ ]",
"[[ ] { } ( ) % ^ # ]");
225 CHECK_PARSE_EQ(
"(x)(x)(x)\\1",
"(: (^ 'x') (^ 'x') (^ 'x') (<- 1))");
226 CHECK_PARSE_EQ(
"(x)(x)(x)\\2",
"(: (^ 'x') (^ 'x') (^ 'x') (<- 2))");
227 CHECK_PARSE_EQ(
"(x)(x)(x)\\3",
"(: (^ 'x') (^ 'x') (^ 'x') (<- 3))");
228 CHECK_PARSE_EQ(
"(x)(x)(x)\\4",
"(: (^ 'x') (^ 'x') (^ 'x') '\\x04')");
230 " (# 0 - g (<- 1)))");
232 " (# 0 - g (<- 2)))");
234 " (# 0 - g (<- 3)))");
236 " (# 0 - g '\\x04'))");
238 "(: (^ 'x') (^ 'x') (^ 'x') (^ 'x') (^ 'x') (^ 'x')"
239 " (^ 'x') (^ 'x') (^ 'x') (^ 'x') (<- 10))");
241 "(: (^ 'x') (^ 'x') (^ 'x') (^ 'x') (^ 'x') (^ 'x')"
242 " (^ 'x') (^ 'x') (^ 'x') (^ 'x') '\\x09')");
253 CHECK_PARSE_EQ(
"(?!\\1(a\\1)\\1)\\1",
"(: (-> - (: (^ 'a') (<- 1))) (<- 1))");
390 static void ExpectError(
const char* input,
391 const char* expected) {
394 ZoneScope zone_scope(Isolate::Current()->runtime_zone(),
DELETE_ON_EXIT);
398 &reader,
false, &result, Isolate::Current()->runtime_zone()));
408 const char* kEndBackslash =
"\\ at end of pattern";
409 ExpectError(
"\\", kEndBackslash);
410 const char* kUnterminatedGroup =
"Unterminated group";
411 ExpectError(
"(foo", kUnterminatedGroup);
412 const char* kInvalidGroup =
"Invalid group";
413 ExpectError(
"(?", kInvalidGroup);
414 const char* kUnterminatedCharacterClass =
"Unterminated character class";
415 ExpectError(
"[", kUnterminatedCharacterClass);
416 ExpectError(
"[a-", kUnterminatedCharacterClass);
417 const char* kNothingToRepeat =
"Nothing to repeat";
418 ExpectError(
"*", kNothingToRepeat);
419 ExpectError(
"?", kNothingToRepeat);
420 ExpectError(
"+", kNothingToRepeat);
421 ExpectError(
"{1}", kNothingToRepeat);
422 ExpectError(
"{1,2}", kNothingToRepeat);
423 ExpectError(
"{1,}", kNothingToRepeat);
426 const int kMaxCaptures = 1 << 16;
427 const char* kTooManyCaptures =
"Too many captures";
430 for (
int i = 0; i <= kMaxCaptures; i++) {
431 accumulator.
Add(
"()");
434 ExpectError(*many_captures, kTooManyCaptures);
438 static bool IsDigit(
uc16 c) {
439 return (
'0' <= c && c <=
'9');
443 static bool NotDigit(
uc16 c) {
448 static bool IsWhiteSpace(
uc16 c) {
467 static bool NotWhiteSpace(
uc16 c) {
468 return !IsWhiteSpace(c);
472 static bool NotWord(
uc16 c) {
477 static void TestCharacterClassEscapes(
uc16 c,
bool (pred)(
uc16 c)) {
478 ZoneScope scope(Isolate::Current()->runtime_zone(),
DELETE_ON_EXIT);
479 Zone* zone = Isolate::Current()->runtime_zone();
483 for (
unsigned i = 0; i < (1 << 16); i++) {
484 bool in_class =
false;
485 for (
int j = 0; !in_class && j < ranges->length(); j++) {
487 in_class = (range.
from() <= i && i <= range.
to());
497 TestCharacterClassEscapes(
'd', IsDigit);
498 TestCharacterClassEscapes(
'D', NotDigit);
499 TestCharacterClassEscapes(
's', IsWhiteSpace);
500 TestCharacterClassEscapes(
'S', NotWhiteSpace);
502 TestCharacterClassEscapes(
'W', NotWord);
506 static RegExpNode* Compile(
const char* input,
bool multiline,
bool is_ascii) {
508 Isolate* isolate = Isolate::Current();
527 return compile_data.
node;
531 static void Execute(
const char* input,
534 bool dot_output =
false) {
536 ZoneScope zone_scope(Isolate::Current()->runtime_zone(),
DELETE_ON_EXIT);
537 RegExpNode* node = Compile(input, multiline, is_ascii);
568 static unsigned PseudoRandom(
int i,
int j) {
569 return ~(~((i * 781) ^ (j * 329)));
575 static const unsigned kLimit = 1000;
576 ZoneScope zone_scope(Isolate::Current()->runtime_zone(),
DELETE_ON_EXIT);
579 for (
unsigned i = 0; i < kLimit; i++) seen[i] =
false;
580 #define CHECK_MAPS_EQUAL() do { \
581 for (unsigned k = 0; k < kLimit; k++) \
582 CHECK_EQ(seen[k], tree.Find(k, &loc)); \
584 for (
int i = 0; i < 50; i++) {
585 for (
int j = 0; j < 50; j++) {
586 unsigned next = PseudoRandom(i, j) % kLimit;
603 loc.set_value(3 * next);
607 int val = PseudoRandom(j, i) % kLimit;
614 val = PseudoRandom(i + j, i - j) % kLimit;
626 TEST(DispatchTableConstruction) {
629 static const int kLimit = 1000;
630 static const int kRangeCount = 8;
631 static const int kRangeSize = 16;
632 uc16 ranges[kRangeCount][2 * kRangeSize];
633 for (
int i = 0; i < kRangeCount; i++) {
635 for (
int j = 0; j < 2 * kRangeSize; j++) {
636 range[j] = PseudoRandom(i + 25, j + 87) % kLimit;
639 for (
int j = 1; j < 2 * kRangeSize; j++) {
640 CHECK(range[j-1] <= range[j]);
644 ZoneScope zone_scope(Isolate::Current()->runtime_zone(),
DELETE_ON_EXIT);
646 for (
int i = 0; i < kRangeCount; i++) {
647 uc16* range = ranges[i];
648 for (
int j = 0; j < 2 * kRangeSize; j += 2)
650 Isolate::Current()->runtime_zone());
653 for (
int p = 0; p < kLimit; p++) {
655 for (
int j = 0; j < kRangeCount; j++) {
656 uc16* range = ranges[j];
658 for (
int k = 0; !is_on && (k < 2 * kRangeSize); k += 2)
659 is_on = (range[k] <= p && p <= range[k + 1]);
668 TEST(ParsePossessiveRepetition) {
669 bool old_flag_value = FLAG_regexp_possessive_quantifier;
672 FLAG_regexp_possessive_quantifier =
true;
681 FLAG_regexp_possessive_quantifier =
false;
689 FLAG_regexp_possessive_quantifier = old_flag_value;
697 #ifndef V8_INTERPRETED_REGEXP
699 #if V8_TARGET_ARCH_IA32
701 #elif V8_TARGET_ARCH_X64
703 #elif V8_TARGET_ARCH_ARM
705 #elif V8_TARGET_ARCH_MIPS
712 : env_(), scope_(), zone_(
Isolate::Current()->runtime_zone(),
724 v8::internal::ZoneScope zone_;
728 static ArchRegExpMacroAssembler::Result Execute(
Code*
code,
731 const byte* input_start,
732 const byte* input_end,
746 TEST(MacroAssemblerNativeSuccess) {
749 Factory* factory = Isolate::Current()->factory();
752 Isolate::Current()->runtime_zone());
760 int captures[4] = {42, 37, 87, 117};
763 const byte* start_adr =
764 reinterpret_cast<const byte*
>(seq_input->GetCharsAddress());
771 start_adr + seq_input->length(),
782 TEST(MacroAssemblerNativeSimple) {
785 Factory* factory = Isolate::Current()->factory();
788 Isolate::Current()->runtime_zone());
790 uc16 foo_chars[3] = {
'f',
'o',
'o'};
794 m.CheckCharacters(foo, 0, &fail,
true);
795 m.WriteCurrentPositionToRegister(0, 0);
796 m.AdvanceCurrentPosition(3);
797 m.WriteCurrentPositionToRegister(1, 0);
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) {
843 Factory* factory = Isolate::Current()->factory();
846 Isolate::Current()->runtime_zone());
848 uc16 foo_chars[3] = {
'f',
'o',
'o'};
852 m.CheckCharacters(foo, 0, &fail,
true);
853 m.WriteCurrentPositionToRegister(0, 0);
854 m.AdvanceCurrentPosition(3);
855 m.WriteCurrentPositionToRegister(1, 0);
864 int captures[4] = {42, 37, 87, 117};
865 const uc16 input_data[6] = {
'f',
'o',
'o',
'f',
'o',
866 static_cast<uc16>(
'\xa0')};
870 Address start_adr = seq_input->GetCharsAddress();
877 start_adr + input->length(),
886 const uc16 input_data2[9] = {
'b',
'a',
'r',
'b',
'a',
'r',
'b',
'a',
887 static_cast<uc16>(
'\xa0')};
890 start_adr = seq_input->GetCharsAddress();
892 result = Execute(*code,
896 start_adr + input->length() * 2,
903 TEST(MacroAssemblerNativeBacktrack) {
906 Factory* factory = Isolate::Current()->factory();
909 Isolate::Current()->runtime_zone());
913 m.LoadCurrentCharacter(10, &fail);
916 m.PushBacktrack(&backtrack);
917 m.LoadCurrentCharacter(10,
NULL);
928 Address start_adr = seq_input->GetCharsAddress();
935 start_adr + input->length(),
942 TEST(MacroAssemblerNativeBackReferenceASCII) {
945 Factory* factory = Isolate::Current()->factory();
948 Isolate::Current()->runtime_zone());
950 m.WriteCurrentPositionToRegister(0, 0);
951 m.AdvanceCurrentPosition(2);
952 m.WriteCurrentPositionToRegister(1, 0);
954 m.CheckNotBackReference(0, &nomatch);
957 m.AdvanceCurrentPosition(2);
959 m.CheckNotBackReference(0, &missing_match);
960 m.WriteCurrentPositionToRegister(2, 0);
962 m.Bind(&missing_match);
971 Address start_adr = seq_input->GetCharsAddress();
979 start_adr + input->length(),
990 TEST(MacroAssemblerNativeBackReferenceUC16) {
993 Factory* factory = Isolate::Current()->factory();
996 Isolate::Current()->runtime_zone());
998 m.WriteCurrentPositionToRegister(0, 0);
999 m.AdvanceCurrentPosition(2);
1000 m.WriteCurrentPositionToRegister(1, 0);
1002 m.CheckNotBackReference(0, &nomatch);
1005 m.AdvanceCurrentPosition(2);
1006 Label missing_match;
1007 m.CheckNotBackReference(0, &missing_match);
1008 m.WriteCurrentPositionToRegister(2, 0);
1010 m.Bind(&missing_match);
1017 const uc16 input_data[6] = {
'f', 0x2028,
'o',
'o',
'f', 0x2028};
1021 Address start_adr = seq_input->GetCharsAddress();
1029 start_adr + input->length() * 2,
1041 TEST(MacroAssemblernativeAtStart) {
1044 Factory* factory = Isolate::Current()->factory();
1047 Isolate::Current()->runtime_zone());
1049 Label not_at_start, newline, fail;
1050 m.CheckNotAtStart(¬_at_start);
1052 m.CheckCharacter(
'\n', &newline);
1056 m.LoadCurrentCharacter(0, &fail);
1057 m.CheckNotCharacter(
'f', &fail);
1060 m.Bind(¬_at_start);
1063 m.CheckCharacter(
'o', &prevo);
1066 m.LoadCurrentCharacter(0, &fail);
1067 m.CheckNotCharacter(
'b', &fail);
1076 Address start_adr = seq_input->GetCharsAddress();
1083 start_adr + input->length(),
1088 result = Execute(*code,
1092 start_adr + input->length(),
1099 TEST(MacroAssemblerNativeBackRefNoCase) {
1102 Factory* factory = Isolate::Current()->factory();
1105 Isolate::Current()->runtime_zone());
1109 m.WriteCurrentPositionToRegister(0, 0);
1110 m.WriteCurrentPositionToRegister(2, 0);
1111 m.AdvanceCurrentPosition(3);
1112 m.WriteCurrentPositionToRegister(3, 0);
1113 m.CheckNotBackReferenceIgnoreCase(2, &fail);
1114 m.CheckNotBackReferenceIgnoreCase(2, &fail);
1115 Label expected_fail;
1116 m.CheckNotBackReferenceIgnoreCase(2, &expected_fail);
1120 m.Bind(&expected_fail);
1121 m.AdvanceCurrentPosition(3);
1122 m.CheckNotBackReferenceIgnoreCase(2, &succ);
1126 m.WriteCurrentPositionToRegister(1, 0);
1137 Address start_adr = seq_input->GetCharsAddress();
1145 start_adr + input->length(),
1157 TEST(MacroAssemblerNativeRegisters) {
1160 Factory* factory = Isolate::Current()->factory();
1163 Isolate::Current()->runtime_zone());
1165 uc16 foo_chars[3] = {
'f',
'o',
'o'};
1168 enum registers { out1, out2, out3, out4, out5, out6,
sp, loop_cnt };
1171 m.WriteCurrentPositionToRegister(out1, 0);
1173 m.PushBacktrack(&backtrack);
1174 m.WriteStackPointerToRegister(
sp);
1176 m.AdvanceCurrentPosition(2);
1177 m.WriteCurrentPositionToRegister(out1, 0);
1179 m.PushBacktrack(&fail);
1181 m.ReadStackPointerFromRegister(
sp);
1185 m.PushCurrentPosition();
1186 m.AdvanceCurrentPosition(2);
1187 m.PopCurrentPosition();
1190 m.PopRegister(out1);
1191 m.ReadCurrentPositionFromRegister(out1);
1192 m.AdvanceCurrentPosition(3);
1193 m.WriteCurrentPositionToRegister(out2, 0);
1196 m.SetRegister(loop_cnt, 0);
1198 m.AdvanceRegister(loop_cnt, 1);
1199 m.AdvanceCurrentPosition(1);
1200 m.IfRegisterLT(loop_cnt, 3, &loop);
1201 m.WriteCurrentPositionToRegister(out3, 0);
1204 m.SetRegister(loop_cnt, 2);
1206 m.AdvanceRegister(loop_cnt, -1);
1207 m.AdvanceCurrentPosition(1);
1208 m.IfRegisterGE(loop_cnt, 0, &loop2);
1209 m.WriteCurrentPositionToRegister(out4, 0);
1215 m.ReadCurrentPositionFromRegister(out3);
1217 m.AdvanceCurrentPosition(1);
1218 m.CheckGreedyLoop(&exit_loop3);
1220 m.Bind(&exit_loop3);
1221 m.PopCurrentPosition();
1222 m.WriteCurrentPositionToRegister(out5, 0);
1238 Address start_adr = seq_input->GetCharsAddress();
1246 start_adr + input->length(),
1259 TEST(MacroAssemblerStackOverflow) {
1262 Isolate* isolate = Isolate::Current();
1266 Isolate::Current()->runtime_zone());
1270 m.PushBacktrack(&loop);
1282 Address start_adr = seq_input->GetCharsAddress();
1289 start_adr + input->length(),
1298 TEST(MacroAssemblerNativeLotsOfRegisters) {
1301 Isolate* isolate = Isolate::Current();
1305 Isolate::Current()->runtime_zone());
1309 const int large_number = 8000;
1310 m.WriteCurrentPositionToRegister(large_number, 42);
1311 m.WriteCurrentPositionToRegister(0, 0);
1312 m.WriteCurrentPositionToRegister(1, 1);
1314 m.CheckNotBackReference(0, &done);
1329 Address start_adr = seq_input->GetCharsAddress();
1337 start_adr + input->length(),
1347 #else // V8_INTERPRETED_REGEXP
1352 RegExpMacroAssemblerIrregexp m(
Vector<byte>(codes, 1024),
1353 Isolate::Current()->runtime_zone());
1355 Label fail, fail2, start;
1361 m.SetRegister(4, 42);
1363 m.AdvanceRegister(4, 42);
1367 m.PushBacktrack(&fail2);
1368 m.CheckCharacters(foo, 0, &fail,
true);
1369 m.WriteCurrentPositionToRegister(0, 0);
1370 m.PushCurrentPosition();
1371 m.AdvanceCurrentPosition(3);
1372 m.WriteCurrentPositionToRegister(1, 0);
1373 m.PopCurrentPosition();
1374 m.AdvanceCurrentPosition(1);
1375 m.WriteCurrentPositionToRegister(2, 0);
1376 m.AdvanceCurrentPosition(1);
1377 m.WriteCurrentPositionToRegister(3, 0);
1388 Isolate* isolate = Isolate::Current();
1396 const uc16 str1[] = {
'f',
'o',
'o',
'b',
'a',
'r'};
1407 const uc16 str2[] = {
'b',
'a',
'r',
'f',
'o',
'o'};
1415 #endif // V8_INTERPRETED_REGEXP
1420 static const int kLimit = 1000;
1421 static const int kRangeCount = 16;
1422 for (
int t = 0; t < 10; t++) {
1423 ZoneScope zone_scope(Isolate::Current()->runtime_zone(),
DELETE_ON_EXIT);
1424 Zone* zone = Isolate::Current()->runtime_zone();
1428 for (
int i = 0; i < kRangeCount; i++) {
1429 int from = PseudoRandom(t + 87, i + 25) % kLimit;
1430 int to = from + (PseudoRandom(i + 87, t + 25) % (kLimit / 20));
1431 if (to > kLimit) to = kLimit;
1436 Isolate::Current()->runtime_zone());
1439 for (
int i = 0; i < kLimit; i++) {
1441 for (
int j = 0; !is_on && j < kRangeCount; j++)
1447 ZoneScope zone_scope(Isolate::Current()->runtime_zone(),
DELETE_ON_EXIT);
1448 Zone* zone = Isolate::Current()->runtime_zone();
1454 Isolate::Current()->runtime_zone());
1476 for (
char lower =
'a'; lower <=
'z'; lower++) {
1477 char upper = lower + (
'A' -
'a');
1478 CHECK_EQ(canonicalize(lower), canonicalize(upper));
1480 int length = un_canonicalize.
get(lower,
'\0', uncanon);
1485 for (
uc32 c = 128; c < (1 << 21); c++)
1489 for (
uc32 c = 0; c < (1 << 16); c++) {
1491 int length = to_upper.
get(c,
'\0', upper);
1497 if (length > 1 || (c >= 128 && u < 128))
1504 static uc32 CanonRangeEnd(
uc32 c) {
1521 int block_start = 0;
1522 while (block_start <= 0xFFFF) {
1523 uc32 block_end = CanonRangeEnd(block_start);
1524 unsigned block_length = block_end - block_start + 1;
1525 if (block_length > 1) {
1527 int first_length = un_canonicalize.
get(block_start,
'\0', first);
1528 for (
unsigned i = 1; i < block_length; i++) {
1530 int succ_length = un_canonicalize.
get(block_start + i,
'\0', succ);
1531 CHECK_EQ(first_length, succ_length);
1532 for (
int j = 0; j < succ_length; j++) {
1533 int calc = first[j] + i;
1534 int found = succ[j];
1539 block_start = block_start + block_length;
1547 for (
int i = 0; i < (1 << 16); i++) {
1548 int length = un_canonicalize.
get(i,
'\0', chars);
1549 for (
int j = 0; j < length; j++) {
1551 int length2 = un_canonicalize.
get(chars[j],
'\0', chars2);
1553 for (
int k = 0; k < length; k++)
1554 CHECK_EQ(static_cast<int>(chars[k]), static_cast<int>(chars2[k]));
1562 ZoneScope zone_scope(Isolate::Current()->runtime_zone(),
DELETE_ON_EXIT);
1563 Zone* zone = Isolate::Current()->runtime_zone();
1564 int count = expected.
length();
1569 for (
int i = 0; i < list->length(); i++) {
1576 static void TestSimpleRangeCaseIndependence(
CharacterRange input,
1579 vector[0] = expected;
1580 TestRangeCaseIndependence(input, vector);
1584 TEST(CharacterRangeCaseIndependence) {
1598 TestSimpleRangeCaseIndependence(
CharacterRange(
'a' - 1,
'z' + 1),
1604 TestSimpleRangeCaseIndependence(
CharacterRange(
'A' - 1,
'Z' + 1),
1617 for (
int i = 0; i < ranges->length(); i++) {
1619 if (range.
from() <= c && c <= range.
to())
1628 ZoneScope zone_scope(Isolate::Current()->runtime_zone(),
DELETE_ON_EXIT);
1629 Zone* zone = Isolate::Current()->runtime_zone();
1637 Isolate::Current()->runtime_zone());
1638 for (
int i = 0; i < (1 << 16); i++) {
1639 bool in_base = InClass(i, base);
1641 bool in_overlay =
false;
1642 for (
int j = 0; !in_overlay && j < overlay.
length(); j += 2) {
1643 if (overlay[j] <= i && i < overlay[j+1])
1646 CHECK_EQ(in_overlay, InClass(i, included));
1647 CHECK_EQ(!in_overlay, InClass(i, excluded));
1649 CHECK(!InClass(i, included));
1650 CHECK(!InClass(i, excluded));
1658 ZoneScope scope(Isolate::Current()->runtime_zone(),
DELETE_ON_EXIT);
1659 Zone* zone = Isolate::Current()->runtime_zone();
1662 CharacterSet set(list);
1721 ZoneScope zone_scope(Isolate::Current()->runtime_zone(),
DELETE_ON_EXIT);
1724 Zone* zone = Isolate::Current()->runtime_zone();
1738 for (
int i = 0; i < 5; i++) {
1754 for (
int i = 0; i < 7; i++) {
1775 for (
int i = 0; i < 9; i++) {
1793 for (
int i = 0; i < 6; i++) {
1810 Execute(
"\\b\\w+\\b",
false,
true,
true);
#define CHECK_MIN_MAX(input, min, max)
static bool Initialize(Deserializer *des)
static bool ParseRegExp(FlatStringReader *input, bool multiline, RegExpCompileData *result, Zone *zone)
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)
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)
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)
bool has_pending_exception()
bool FindLeastGreaterThan(const Key &key, Locator *locator)
Vector< const char > CStrVector(const char *data)
int StrLength(const char *string)
Handle< String > NewStringFromAscii(Vector< const char > str, PretenureFlag pretenure=NOT_TENURED)
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())
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 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 and VFP2 enable use of VFP2 instructions if available 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 MIPS FPU instructions if NULL
static Persistent< Context > New(ExtensionConfiguration *extensions=NULL, Handle< ObjectTemplate > global_template=Handle< ObjectTemplate >(), Handle< Value > global_object=Handle< Value >())
void set_choice_index(int value)
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
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)