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) {
96 static bool CheckSimple(
const char* input) {
114 static MinMaxPair CheckMinMaxMatch(
const char* input) {
131 #define CHECK_PARSE_ERROR(input) CHECK(!CheckParse(input))
132 #define CHECK_PARSE_EQ(input, expected) CHECK_EQ(expected, *Parse(input))
133 #define CHECK_SIMPLE(input, simple) CHECK_EQ(simple, CheckSimple(input));
134 #define CHECK_MIN_MAX(input, min, max) \
135 { MinMaxPair min_max = CheckMinMaxMatch(input); \
136 CHECK_EQ(min, min_max.min_match); \
137 CHECK_EQ(max, min_max.max_match); \
166 CHECK_PARSE_EQ(
"a\\fb\\nc\\rd\\te\\vf",
"'a\\x0cb\\x0ac\\x0dd\\x09e\\x0bf'");
171 CHECK_PARSE_EQ(
"foo|(bar|baz)|quux",
"(| 'foo' (^ (| 'bar' 'baz')) 'quux')");
193 "'\\x0a\\x0a\\x09\\x09\\x0b\\x0b'");
210 CHECK_PARSE_EQ(
"[\\[\\]\\{\\}\\(\\)\\%\\^\\#\\ ]",
"[[ ] { } ( ) % ^ # ]");
221 CHECK_PARSE_EQ(
"(x)(x)(x)\\1",
"(: (^ 'x') (^ 'x') (^ 'x') (<- 1))");
222 CHECK_PARSE_EQ(
"(x)(x)(x)\\2",
"(: (^ 'x') (^ 'x') (^ 'x') (<- 2))");
223 CHECK_PARSE_EQ(
"(x)(x)(x)\\3",
"(: (^ 'x') (^ 'x') (^ 'x') (<- 3))");
224 CHECK_PARSE_EQ(
"(x)(x)(x)\\4",
"(: (^ 'x') (^ 'x') (^ 'x') '\\x04')");
226 " (# 0 - g (<- 1)))");
228 " (# 0 - g (<- 2)))");
230 " (# 0 - g (<- 3)))");
232 " (# 0 - g '\\x04'))");
234 "(: (^ 'x') (^ 'x') (^ 'x') (^ 'x') (^ 'x') (^ 'x')"
235 " (^ 'x') (^ 'x') (^ 'x') (^ 'x') (<- 10))");
237 "(: (^ 'x') (^ 'x') (^ 'x') (^ 'x') (^ 'x') (^ 'x')"
238 " (^ 'x') (^ 'x') (^ 'x') (^ 'x') '\\x09')");
249 CHECK_PARSE_EQ(
"(?!\\1(a\\1)\\1)\\1",
"(: (-> - (: (^ 'a') (<- 1))) (<- 1))");
385 static void ExpectError(
const char* input,
386 const char* expected) {
402 const char* kEndBackslash =
"\\ at end of pattern";
403 ExpectError(
"\\", kEndBackslash);
404 const char* kUnterminatedGroup =
"Unterminated group";
405 ExpectError(
"(foo", kUnterminatedGroup);
406 const char* kInvalidGroup =
"Invalid group";
407 ExpectError(
"(?", kInvalidGroup);
408 const char* kUnterminatedCharacterClass =
"Unterminated character class";
409 ExpectError(
"[", kUnterminatedCharacterClass);
410 ExpectError(
"[a-", kUnterminatedCharacterClass);
411 const char* kNothingToRepeat =
"Nothing to repeat";
412 ExpectError(
"*", kNothingToRepeat);
413 ExpectError(
"?", kNothingToRepeat);
414 ExpectError(
"+", kNothingToRepeat);
415 ExpectError(
"{1}", kNothingToRepeat);
416 ExpectError(
"{1,2}", kNothingToRepeat);
417 ExpectError(
"{1,}", kNothingToRepeat);
420 const int kMaxCaptures = 1 << 16;
421 const char* kTooManyCaptures =
"Too many captures";
424 for (
int i = 0; i <= kMaxCaptures; i++) {
425 accumulator.
Add(
"()");
428 ExpectError(*many_captures, kTooManyCaptures);
432 static bool IsDigit(
uc16 c) {
433 return (
'0' <= c && c <=
'9');
437 static bool NotDigit(
uc16 c) {
442 static bool IsWhiteSpace(
uc16 c) {
461 static bool NotWhiteSpace(
uc16 c) {
462 return !IsWhiteSpace(c);
466 static bool NotWord(
uc16 c) {
471 static void TestCharacterClassEscapes(
uc16 c,
bool (pred)(
uc16 c)) {
473 Zone* zone = Isolate::Current()->zone();
477 for (
unsigned i = 0; i < (1 << 16); i++) {
478 bool in_class =
false;
479 for (
int j = 0; !in_class && j < ranges->length(); j++) {
481 in_class = (range.
from() <= i && i <= range.
to());
491 TestCharacterClassEscapes(
'd', IsDigit);
492 TestCharacterClassEscapes(
'D', NotDigit);
493 TestCharacterClassEscapes(
's', IsWhiteSpace);
494 TestCharacterClassEscapes(
'S', NotWhiteSpace);
496 TestCharacterClassEscapes(
'W', NotWord);
500 static RegExpNode* Compile(
const char* input,
bool multiline,
bool is_ascii) {
502 Isolate* isolate = Isolate::Current();
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);
561 static unsigned PseudoRandom(
int i,
int j) {
562 return ~(~((i * 781) ^ (j * 329)));
568 static const unsigned kLimit = 1000;
572 for (
unsigned i = 0; i < kLimit; i++) seen[i] =
false;
573 #define CHECK_MAPS_EQUAL() do { \
574 for (unsigned k = 0; k < kLimit; k++) \
575 CHECK_EQ(seen[k], tree.Find(k, &loc)); \
577 for (
int i = 0; i < 50; i++) {
578 for (
int j = 0; j < 50; j++) {
579 unsigned next = PseudoRandom(i, j) % kLimit;
596 loc.set_value(3 * next);
600 int val = PseudoRandom(j, i) % kLimit;
607 val = PseudoRandom(i + j, i - j) % kLimit;
619 TEST(DispatchTableConstruction) {
622 static const int kLimit = 1000;
623 static const int kRangeCount = 8;
624 static const int kRangeSize = 16;
625 uc16 ranges[kRangeCount][2 * kRangeSize];
626 for (
int i = 0; i < kRangeCount; i++) {
628 for (
int j = 0; j < 2 * kRangeSize; j++) {
629 range[j] = PseudoRandom(i + 25, j + 87) % kLimit;
632 for (
int j = 1; j < 2 * kRangeSize; j++) {
633 CHECK(range[j-1] <= range[j]);
639 for (
int i = 0; i < kRangeCount; i++) {
640 uc16* range = ranges[i];
641 for (
int j = 0; j < 2 * kRangeSize; j += 2)
643 Isolate::Current()->zone());
646 for (
int p = 0; p < kLimit; p++) {
648 for (
int j = 0; j < kRangeCount; j++) {
649 uc16* range = ranges[j];
651 for (
int k = 0; !is_on && (k < 2 * kRangeSize); k += 2)
652 is_on = (range[k] <= p && p <= range[k + 1]);
661 TEST(ParsePossessiveRepetition) {
662 bool old_flag_value = FLAG_regexp_possessive_quantifier;
665 FLAG_regexp_possessive_quantifier =
true;
674 FLAG_regexp_possessive_quantifier =
false;
682 FLAG_regexp_possessive_quantifier = old_flag_value;
690 #ifndef V8_INTERPRETED_REGEXP
692 #if V8_TARGET_ARCH_IA32
694 #elif V8_TARGET_ARCH_X64
696 #elif V8_TARGET_ARCH_ARM
698 #elif V8_TARGET_ARCH_MIPS
716 v8::internal::ZoneScope zone_;
720 static ArchRegExpMacroAssembler::Result Execute(
Code* code,
723 const byte* input_start,
724 const byte* input_end,
738 TEST(MacroAssemblerNativeSuccess) {
741 Factory* factory = Isolate::Current()->factory();
744 Isolate::Current()->zone());
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) {
777 Factory* factory = Isolate::Current()->factory();
780 Isolate::Current()->zone());
782 uc16 foo_chars[3] = {
'f',
'o',
'o'};
786 m.CheckCharacters(foo, 0, &fail,
true);
787 m.WriteCurrentPositionToRegister(0, 0);
788 m.AdvanceCurrentPosition(3);
789 m.WriteCurrentPositionToRegister(1, 0);
798 int captures[4] = {42, 37, 87, 117};
801 Address start_adr = seq_input->GetCharsAddress();
808 start_adr + input->length(),
819 start_adr = seq_input->GetCharsAddress();
821 result = Execute(*code,
825 start_adr + input->length(),
832 TEST(MacroAssemblerNativeSimpleUC16) {
835 Factory* factory = Isolate::Current()->factory();
838 Isolate::Current()->zone());
840 uc16 foo_chars[3] = {
'f',
'o',
'o'};
844 m.CheckCharacters(foo, 0, &fail,
true);
845 m.WriteCurrentPositionToRegister(0, 0);
846 m.AdvanceCurrentPosition(3);
847 m.WriteCurrentPositionToRegister(1, 0);
856 int captures[4] = {42, 37, 87, 117};
857 const uc16 input_data[6] = {
'f',
'o',
'o',
'f',
'o',
858 static_cast<uc16>(
'\xa0')};
862 Address start_adr = seq_input->GetCharsAddress();
869 start_adr + input->length(),
878 const uc16 input_data2[9] = {
'b',
'a',
'r',
'b',
'a',
'r',
'b',
'a',
879 static_cast<uc16>(
'\xa0')};
882 start_adr = seq_input->GetCharsAddress();
884 result = Execute(*code,
888 start_adr + input->length() * 2,
895 TEST(MacroAssemblerNativeBacktrack) {
898 Factory* factory = Isolate::Current()->factory();
901 Isolate::Current()->zone());
905 m.LoadCurrentCharacter(10, &fail);
908 m.PushBacktrack(&backtrack);
909 m.LoadCurrentCharacter(10,
NULL);
920 Address start_adr = seq_input->GetCharsAddress();
927 start_adr + input->length(),
934 TEST(MacroAssemblerNativeBackReferenceASCII) {
937 Factory* factory = Isolate::Current()->factory();
940 Isolate::Current()->zone());
942 m.WriteCurrentPositionToRegister(0, 0);
943 m.AdvanceCurrentPosition(2);
944 m.WriteCurrentPositionToRegister(1, 0);
946 m.CheckNotBackReference(0, &nomatch);
949 m.AdvanceCurrentPosition(2);
951 m.CheckNotBackReference(0, &missing_match);
952 m.WriteCurrentPositionToRegister(2, 0);
954 m.Bind(&missing_match);
963 Address start_adr = seq_input->GetCharsAddress();
971 start_adr + input->length(),
982 TEST(MacroAssemblerNativeBackReferenceUC16) {
985 Factory* factory = Isolate::Current()->factory();
988 Isolate::Current()->zone());
990 m.WriteCurrentPositionToRegister(0, 0);
991 m.AdvanceCurrentPosition(2);
992 m.WriteCurrentPositionToRegister(1, 0);
994 m.CheckNotBackReference(0, &nomatch);
997 m.AdvanceCurrentPosition(2);
999 m.CheckNotBackReference(0, &missing_match);
1000 m.WriteCurrentPositionToRegister(2, 0);
1002 m.Bind(&missing_match);
1009 const uc16 input_data[6] = {
'f', 0x2028,
'o',
'o',
'f', 0x2028};
1013 Address start_adr = seq_input->GetCharsAddress();
1021 start_adr + input->length() * 2,
1033 TEST(MacroAssemblernativeAtStart) {
1036 Factory* factory = Isolate::Current()->factory();
1039 Isolate::Current()->zone());
1041 Label not_at_start, newline, fail;
1042 m.CheckNotAtStart(¬_at_start);
1044 m.CheckCharacter(
'\n', &newline);
1048 m.LoadCurrentCharacter(0, &fail);
1049 m.CheckNotCharacter(
'f', &fail);
1052 m.Bind(¬_at_start);
1055 m.CheckCharacter(
'o', &prevo);
1058 m.LoadCurrentCharacter(0, &fail);
1059 m.CheckNotCharacter(
'b', &fail);
1068 Address start_adr = seq_input->GetCharsAddress();
1075 start_adr + input->length(),
1080 result = Execute(*code,
1084 start_adr + input->length(),
1091 TEST(MacroAssemblerNativeBackRefNoCase) {
1094 Factory* factory = Isolate::Current()->factory();
1097 Isolate::Current()->zone());
1101 m.WriteCurrentPositionToRegister(0, 0);
1102 m.WriteCurrentPositionToRegister(2, 0);
1103 m.AdvanceCurrentPosition(3);
1104 m.WriteCurrentPositionToRegister(3, 0);
1105 m.CheckNotBackReferenceIgnoreCase(2, &fail);
1106 m.CheckNotBackReferenceIgnoreCase(2, &fail);
1107 Label expected_fail;
1108 m.CheckNotBackReferenceIgnoreCase(2, &expected_fail);
1112 m.Bind(&expected_fail);
1113 m.AdvanceCurrentPosition(3);
1114 m.CheckNotBackReferenceIgnoreCase(2, &succ);
1118 m.WriteCurrentPositionToRegister(1, 0);
1129 Address start_adr = seq_input->GetCharsAddress();
1137 start_adr + input->length(),
1149 TEST(MacroAssemblerNativeRegisters) {
1152 Factory* factory = Isolate::Current()->factory();
1155 Isolate::Current()->zone());
1157 uc16 foo_chars[3] = {
'f',
'o',
'o'};
1160 enum registers { out1, out2, out3, out4, out5, out6,
sp, loop_cnt };
1163 m.WriteCurrentPositionToRegister(out1, 0);
1165 m.PushBacktrack(&backtrack);
1166 m.WriteStackPointerToRegister(
sp);
1168 m.AdvanceCurrentPosition(2);
1169 m.WriteCurrentPositionToRegister(out1, 0);
1171 m.PushBacktrack(&fail);
1173 m.ReadStackPointerFromRegister(
sp);
1177 m.PushCurrentPosition();
1178 m.AdvanceCurrentPosition(2);
1179 m.PopCurrentPosition();
1182 m.PopRegister(out1);
1183 m.ReadCurrentPositionFromRegister(out1);
1184 m.AdvanceCurrentPosition(3);
1185 m.WriteCurrentPositionToRegister(out2, 0);
1188 m.SetRegister(loop_cnt, 0);
1190 m.AdvanceRegister(loop_cnt, 1);
1191 m.AdvanceCurrentPosition(1);
1192 m.IfRegisterLT(loop_cnt, 3, &loop);
1193 m.WriteCurrentPositionToRegister(out3, 0);
1196 m.SetRegister(loop_cnt, 2);
1198 m.AdvanceRegister(loop_cnt, -1);
1199 m.AdvanceCurrentPosition(1);
1200 m.IfRegisterGE(loop_cnt, 0, &loop2);
1201 m.WriteCurrentPositionToRegister(out4, 0);
1207 m.ReadCurrentPositionFromRegister(out3);
1209 m.AdvanceCurrentPosition(1);
1210 m.CheckGreedyLoop(&exit_loop3);
1212 m.Bind(&exit_loop3);
1213 m.PopCurrentPosition();
1214 m.WriteCurrentPositionToRegister(out5, 0);
1230 Address start_adr = seq_input->GetCharsAddress();
1238 start_adr + input->length(),
1251 TEST(MacroAssemblerStackOverflow) {
1254 Isolate* isolate = Isolate::Current();
1258 Isolate::Current()->zone());
1262 m.PushBacktrack(&loop);
1274 Address start_adr = seq_input->GetCharsAddress();
1281 start_adr + input->length(),
1290 TEST(MacroAssemblerNativeLotsOfRegisters) {
1293 Isolate* isolate = Isolate::Current();
1297 Isolate::Current()->zone());
1301 const int large_number = 8000;
1302 m.WriteCurrentPositionToRegister(large_number, 42);
1303 m.WriteCurrentPositionToRegister(0, 0);
1304 m.WriteCurrentPositionToRegister(1, 1);
1306 m.CheckNotBackReference(0, &done);
1321 Address start_adr = seq_input->GetCharsAddress();
1329 start_adr + input->length(),
1339 #else // V8_INTERPRETED_REGEXP
1344 RegExpMacroAssemblerIrregexp m(
Vector<byte>(codes, 1024));
1346 Label fail, fail2, start;
1352 m.SetRegister(4, 42);
1354 m.AdvanceRegister(4, 42);
1358 m.PushBacktrack(&fail2);
1359 m.CheckCharacters(foo, 0, &fail,
true);
1360 m.WriteCurrentPositionToRegister(0, 0);
1361 m.PushCurrentPosition();
1362 m.AdvanceCurrentPosition(3);
1363 m.WriteCurrentPositionToRegister(1, 0);
1364 m.PopCurrentPosition();
1365 m.AdvanceCurrentPosition(1);
1366 m.WriteCurrentPositionToRegister(2, 0);
1367 m.AdvanceCurrentPosition(1);
1368 m.WriteCurrentPositionToRegister(3, 0);
1379 Isolate* isolate = Isolate::Current();
1387 const uc16 str1[] = {
'f',
'o',
'o',
'b',
'a',
'r'};
1398 const uc16 str2[] = {
'b',
'a',
'r',
'f',
'o',
'o'};
1406 #endif // V8_INTERPRETED_REGEXP
1411 static const int kLimit = 1000;
1412 static const int kRangeCount = 16;
1413 for (
int t = 0; t < 10; t++) {
1415 Zone* zone = Isolate::Current()->zone();
1419 for (
int i = 0; i < kRangeCount; i++) {
1420 int from = PseudoRandom(t + 87, i + 25) % kLimit;
1421 int to = from + (PseudoRandom(i + 87, t + 25) % (kLimit / 20));
1422 if (to > kLimit) to = kLimit;
1429 for (
int i = 0; i < kLimit; i++) {
1431 for (
int j = 0; !is_on && j < kRangeCount; j++)
1438 Zone* zone = Isolate::Current()->zone();
1465 for (
char lower =
'a'; lower <=
'z'; lower++) {
1466 char upper = lower + (
'A' -
'a');
1467 CHECK_EQ(canonicalize(lower), canonicalize(upper));
1469 int length = un_canonicalize.
get(lower,
'\0', uncanon);
1474 for (
uc32 c = 128; c < (1 << 21); c++)
1478 for (
uc32 c = 0; c < (1 << 16); c++) {
1480 int length = to_upper.
get(c,
'\0', upper);
1486 if (length > 1 || (c >= 128 && u < 128))
1493 static uc32 CanonRangeEnd(
uc32 c) {
1510 int block_start = 0;
1511 while (block_start <= 0xFFFF) {
1512 uc32 block_end = CanonRangeEnd(block_start);
1513 unsigned block_length = block_end - block_start + 1;
1514 if (block_length > 1) {
1516 int first_length = un_canonicalize.
get(block_start,
'\0', first);
1517 for (
unsigned i = 1; i < block_length; i++) {
1519 int succ_length = un_canonicalize.
get(block_start + i,
'\0', succ);
1520 CHECK_EQ(first_length, succ_length);
1521 for (
int j = 0; j < succ_length; j++) {
1522 int calc = first[j] + i;
1523 int found = succ[j];
1528 block_start = block_start + block_length;
1536 for (
int i = 0; i < (1 << 16); i++) {
1537 int length = un_canonicalize.
get(i,
'\0', chars);
1538 for (
int j = 0; j < length; j++) {
1540 int length2 = un_canonicalize.
get(chars[j],
'\0', chars2);
1542 for (
int k = 0; k < length; k++)
1543 CHECK_EQ(static_cast<int>(chars[k]), static_cast<int>(chars2[k]));
1552 Zone* zone = Isolate::Current()->zone();
1553 int count = expected.
length();
1558 for (
int i = 0; i < list->length(); i++) {
1565 static void TestSimpleRangeCaseIndependence(
CharacterRange input,
1568 vector[0] = expected;
1569 TestRangeCaseIndependence(input, vector);
1573 TEST(CharacterRangeCaseIndependence) {
1587 TestSimpleRangeCaseIndependence(
CharacterRange(
'a' - 1,
'z' + 1),
1593 TestSimpleRangeCaseIndependence(
CharacterRange(
'A' - 1,
'Z' + 1),
1606 for (
int i = 0; i < ranges->length(); i++) {
1608 if (range.
from() <= c && c <= range.
to())
1618 Zone* zone = Isolate::Current()->zone();
1626 Isolate::Current()->zone());
1627 for (
int i = 0; i < (1 << 16); i++) {
1628 bool in_base = InClass(i, base);
1630 bool in_overlay =
false;
1631 for (
int j = 0; !in_overlay && j < overlay.
length(); j += 2) {
1632 if (overlay[j] <= i && i < overlay[j+1])
1635 CHECK_EQ(in_overlay, InClass(i, included));
1636 CHECK_EQ(!in_overlay, InClass(i, excluded));
1638 CHECK(!InClass(i, included));
1639 CHECK(!InClass(i, excluded));
1648 Zone* zone = Isolate::Current()->zone();
1651 CharacterSet set(list);
1713 Zone* zone = Isolate::Current()->zone();
1727 for (
int i = 0; i < 5; i++) {
1743 for (
int i = 0; i < 7; i++) {
1764 for (
int i = 0; i < 9; i++) {
1782 for (
int i = 0; i < 6; i++) {
1799 Execute(
"\\b\\w+\\b",
false,
true,
true);
#define CHECK_MIN_MAX(input, min, max)
static bool ParseRegExp(FlatStringReader *input, bool multiline, RegExpCompileData *result)
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)
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)
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 void DotPrint(const char *label, RegExpNode *node, bool ignore_case)
void Add(const T &element, AllocationPolicy allocator=AllocationPolicy())
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)
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)