diff options
Diffstat (limited to 'src/3rdparty/v8/test/cctest/test-regexp.cc')
-rw-r--r-- | src/3rdparty/v8/test/cctest/test-regexp.cc | 234 |
1 files changed, 139 insertions, 95 deletions
diff --git a/src/3rdparty/v8/test/cctest/test-regexp.cc b/src/3rdparty/v8/test/cctest/test-regexp.cc index e89e6cd..e433b92 100644 --- a/src/3rdparty/v8/test/cctest/test-regexp.cc +++ b/src/3rdparty/v8/test/cctest/test-regexp.cc @@ -1,4 +1,4 @@ -// Copyright 2008 the V8 project authors. All rights reserved. +// Copyright 2012 the V8 project authors. All rights reserved. // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: @@ -72,23 +72,26 @@ using namespace v8::internal; static bool CheckParse(const char* input) { V8::Initialize(NULL); v8::HandleScope scope; - ZoneScope zone_scope(Isolate::Current(), DELETE_ON_EXIT); + ZoneScope zone_scope(Isolate::Current()->runtime_zone(), DELETE_ON_EXIT); FlatStringReader reader(Isolate::Current(), CStrVector(input)); RegExpCompileData result; - return v8::internal::RegExpParser::ParseRegExp(&reader, false, &result); + return v8::internal::RegExpParser::ParseRegExp( + &reader, false, &result, Isolate::Current()->runtime_zone()); } static SmartArrayPointer<const char> Parse(const char* input) { V8::Initialize(NULL); v8::HandleScope scope; - ZoneScope zone_scope(Isolate::Current(), DELETE_ON_EXIT); + ZoneScope zone_scope(Isolate::Current()->runtime_zone(), DELETE_ON_EXIT); FlatStringReader reader(Isolate::Current(), CStrVector(input)); RegExpCompileData result; - CHECK(v8::internal::RegExpParser::ParseRegExp(&reader, false, &result)); + CHECK(v8::internal::RegExpParser::ParseRegExp( + &reader, false, &result, Isolate::Current()->runtime_zone())); CHECK(result.tree != NULL); CHECK(result.error.is_null()); - SmartArrayPointer<const char> output = result.tree->ToString(); + SmartArrayPointer<const char> output = + result.tree->ToString(Isolate::Current()->runtime_zone()); return output; } @@ -96,10 +99,11 @@ static bool CheckSimple(const char* input) { V8::Initialize(NULL); v8::HandleScope scope; unibrow::Utf8InputBuffer<> buffer(input, StrLength(input)); - ZoneScope zone_scope(Isolate::Current(), DELETE_ON_EXIT); + ZoneScope zone_scope(Isolate::Current()->runtime_zone(), DELETE_ON_EXIT); FlatStringReader reader(Isolate::Current(), CStrVector(input)); RegExpCompileData result; - CHECK(v8::internal::RegExpParser::ParseRegExp(&reader, false, &result)); + CHECK(v8::internal::RegExpParser::ParseRegExp( + &reader, false, &result, Isolate::Current()->runtime_zone())); CHECK(result.tree != NULL); CHECK(result.error.is_null()); return result.simple; @@ -114,10 +118,11 @@ static MinMaxPair CheckMinMaxMatch(const char* input) { V8::Initialize(NULL); v8::HandleScope scope; unibrow::Utf8InputBuffer<> buffer(input, StrLength(input)); - ZoneScope zone_scope(Isolate::Current(), DELETE_ON_EXIT); + ZoneScope zone_scope(Isolate::Current()->runtime_zone(), DELETE_ON_EXIT); FlatStringReader reader(Isolate::Current(), CStrVector(input)); RegExpCompileData result; - CHECK(v8::internal::RegExpParser::ParseRegExp(&reader, false, &result)); + CHECK(v8::internal::RegExpParser::ParseRegExp( + &reader, false, &result, Isolate::Current()->runtime_zone())); CHECK(result.tree != NULL); CHECK(result.error.is_null()); int min_match = result.tree->min_match(); @@ -262,6 +267,7 @@ TEST(Parser) { CHECK_PARSE_EQ("\\u003z", "'u003z'"); CHECK_PARSE_EQ("foo[z]*", "(: 'foo' (# 0 - g [z]))"); + CHECK_SIMPLE("", false); CHECK_SIMPLE("a", true); CHECK_SIMPLE("a|b", false); CHECK_SIMPLE("a\\n", false); @@ -385,10 +391,11 @@ static void ExpectError(const char* input, const char* expected) { V8::Initialize(NULL); v8::HandleScope scope; - ZoneScope zone_scope(Isolate::Current(), DELETE_ON_EXIT); + ZoneScope zone_scope(Isolate::Current()->runtime_zone(), DELETE_ON_EXIT); FlatStringReader reader(Isolate::Current(), CStrVector(input)); RegExpCompileData result; - CHECK(!v8::internal::RegExpParser::ParseRegExp(&reader, false, &result)); + CHECK(!v8::internal::RegExpParser::ParseRegExp( + &reader, false, &result, Isolate::Current()->runtime_zone())); CHECK(result.tree == NULL); CHECK(!result.error.is_null()); SmartArrayPointer<char> str = result.error->ToCString(ALLOW_NULLS); @@ -468,9 +475,11 @@ static bool NotWord(uc16 c) { static void TestCharacterClassEscapes(uc16 c, bool (pred)(uc16 c)) { - ZoneScope scope(Isolate::Current(), DELETE_ON_EXIT); - ZoneList<CharacterRange>* ranges = new ZoneList<CharacterRange>(2); - CharacterRange::AddClassEscape(c, ranges); + ZoneScope scope(Isolate::Current()->runtime_zone(), DELETE_ON_EXIT); + Zone* zone = Isolate::Current()->runtime_zone(); + ZoneList<CharacterRange>* ranges = + new(zone) ZoneList<CharacterRange>(2, zone); + CharacterRange::AddClassEscape(c, ranges, zone); for (unsigned i = 0; i < (1 << 16); i++) { bool in_class = false; for (int j = 0; !in_class && j < ranges->length(); j++) { @@ -500,14 +509,21 @@ static RegExpNode* Compile(const char* input, bool multiline, bool is_ascii) { FlatStringReader reader(isolate, CStrVector(input)); RegExpCompileData compile_data; if (!v8::internal::RegExpParser::ParseRegExp(&reader, multiline, - &compile_data)) + &compile_data, + isolate->runtime_zone())) return NULL; Handle<String> pattern = isolate->factory()-> NewStringFromUtf8(CStrVector(input)); Handle<String> sample_subject = isolate->factory()->NewStringFromUtf8(CStrVector("")); - RegExpEngine::Compile( - &compile_data, false, multiline, pattern, sample_subject, is_ascii); + RegExpEngine::Compile(&compile_data, + false, + false, + multiline, + pattern, + sample_subject, + is_ascii, + isolate->runtime_zone()); return compile_data.node; } @@ -517,7 +533,7 @@ static void Execute(const char* input, bool is_ascii, bool dot_output = false) { v8::HandleScope scope; - ZoneScope zone_scope(Isolate::Current(), DELETE_ON_EXIT); + ZoneScope zone_scope(Isolate::Current()->runtime_zone(), DELETE_ON_EXIT); RegExpNode* node = Compile(input, multiline, is_ascii); USE(node); #ifdef DEBUG @@ -557,8 +573,8 @@ static unsigned PseudoRandom(int i, int j) { TEST(SplayTreeSimple) { v8::internal::V8::Initialize(NULL); static const unsigned kLimit = 1000; - ZoneScope zone_scope(Isolate::Current(), DELETE_ON_EXIT); - ZoneSplayTree<TestConfig> tree; + ZoneScope zone_scope(Isolate::Current()->runtime_zone(), DELETE_ON_EXIT); + ZoneSplayTree<TestConfig> tree(Isolate::Current()->runtime_zone()); bool seen[kLimit]; for (unsigned i = 0; i < kLimit; i++) seen[i] = false; #define CHECK_MAPS_EQUAL() do { \ @@ -625,12 +641,13 @@ TEST(DispatchTableConstruction) { } } // Enter test data into dispatch table. - ZoneScope zone_scope(Isolate::Current(), DELETE_ON_EXIT); - DispatchTable table; + ZoneScope zone_scope(Isolate::Current()->runtime_zone(), DELETE_ON_EXIT); + DispatchTable table(Isolate::Current()->runtime_zone()); for (int i = 0; i < kRangeCount; i++) { uc16* range = ranges[i]; for (int j = 0; j < 2 * kRangeSize; j += 2) - table.AddRange(CharacterRange(range[j], range[j + 1]), i); + table.AddRange(CharacterRange(range[j], range[j + 1]), i, + Isolate::Current()->runtime_zone()); } // Check that the table looks as we would expect for (int p = 0; p < kLimit; p++) { @@ -692,7 +709,8 @@ typedef RegExpMacroAssemblerMIPS ArchRegExpMacroAssembler; class ContextInitializer { public: ContextInitializer() - : env_(), scope_(), zone_(Isolate::Current(), DELETE_ON_EXIT) { + : env_(), scope_(), zone_(Isolate::Current()->runtime_zone(), + DELETE_ON_EXIT) { env_ = v8::Context::New(); env_->Enter(); } @@ -720,6 +738,7 @@ static ArchRegExpMacroAssembler::Result Execute(Code* code, input_start, input_end, captures, + 0, Isolate::Current()); } @@ -729,7 +748,8 @@ TEST(MacroAssemblerNativeSuccess) { ContextInitializer initializer; Factory* factory = Isolate::Current()->factory(); - ArchRegExpMacroAssembler m(NativeRegExpMacroAssembler::ASCII, 4); + ArchRegExpMacroAssembler m(NativeRegExpMacroAssembler::ASCII, 4, + Isolate::Current()->runtime_zone()); m.Succeed(); @@ -764,7 +784,8 @@ TEST(MacroAssemblerNativeSimple) { ContextInitializer initializer; Factory* factory = Isolate::Current()->factory(); - ArchRegExpMacroAssembler m(NativeRegExpMacroAssembler::ASCII, 4); + ArchRegExpMacroAssembler m(NativeRegExpMacroAssembler::ASCII, 4, + Isolate::Current()->runtime_zone()); uc16 foo_chars[3] = {'f', 'o', 'o'}; Vector<const uc16> foo(foo_chars, 3); @@ -821,7 +842,8 @@ TEST(MacroAssemblerNativeSimpleUC16) { ContextInitializer initializer; Factory* factory = Isolate::Current()->factory(); - ArchRegExpMacroAssembler m(NativeRegExpMacroAssembler::UC16, 4); + ArchRegExpMacroAssembler m(NativeRegExpMacroAssembler::UC16, 4, + Isolate::Current()->runtime_zone()); uc16 foo_chars[3] = {'f', 'o', 'o'}; Vector<const uc16> foo(foo_chars, 3); @@ -883,7 +905,8 @@ TEST(MacroAssemblerNativeBacktrack) { ContextInitializer initializer; Factory* factory = Isolate::Current()->factory(); - ArchRegExpMacroAssembler m(NativeRegExpMacroAssembler::ASCII, 0); + ArchRegExpMacroAssembler m(NativeRegExpMacroAssembler::ASCII, 0, + Isolate::Current()->runtime_zone()); Label fail; Label backtrack; @@ -921,7 +944,8 @@ TEST(MacroAssemblerNativeBackReferenceASCII) { ContextInitializer initializer; Factory* factory = Isolate::Current()->factory(); - ArchRegExpMacroAssembler m(NativeRegExpMacroAssembler::ASCII, 4); + ArchRegExpMacroAssembler m(NativeRegExpMacroAssembler::ASCII, 4, + Isolate::Current()->runtime_zone()); m.WriteCurrentPositionToRegister(0, 0); m.AdvanceCurrentPosition(2); @@ -968,7 +992,8 @@ TEST(MacroAssemblerNativeBackReferenceUC16) { ContextInitializer initializer; Factory* factory = Isolate::Current()->factory(); - ArchRegExpMacroAssembler m(NativeRegExpMacroAssembler::UC16, 4); + ArchRegExpMacroAssembler m(NativeRegExpMacroAssembler::UC16, 4, + Isolate::Current()->runtime_zone()); m.WriteCurrentPositionToRegister(0, 0); m.AdvanceCurrentPosition(2); @@ -998,11 +1023,11 @@ TEST(MacroAssemblerNativeBackReferenceUC16) { int output[4]; NativeRegExpMacroAssembler::Result result = Execute(*code, - *input, - 0, - start_adr, - start_adr + input->length() * 2, - output); + *input, + 0, + start_adr, + start_adr + input->length() * 2, + output); CHECK_EQ(NativeRegExpMacroAssembler::SUCCESS, result); CHECK_EQ(0, output[0]); @@ -1018,7 +1043,8 @@ TEST(MacroAssemblernativeAtStart) { ContextInitializer initializer; Factory* factory = Isolate::Current()->factory(); - ArchRegExpMacroAssembler m(NativeRegExpMacroAssembler::ASCII, 0); + ArchRegExpMacroAssembler m(NativeRegExpMacroAssembler::ASCII, 0, + Isolate::Current()->runtime_zone()); Label not_at_start, newline, fail; m.CheckNotAtStart(¬_at_start); @@ -1075,7 +1101,8 @@ TEST(MacroAssemblerNativeBackRefNoCase) { ContextInitializer initializer; Factory* factory = Isolate::Current()->factory(); - ArchRegExpMacroAssembler m(NativeRegExpMacroAssembler::ASCII, 4); + ArchRegExpMacroAssembler m(NativeRegExpMacroAssembler::ASCII, 4, + Isolate::Current()->runtime_zone()); Label fail, succ; @@ -1132,7 +1159,8 @@ TEST(MacroAssemblerNativeRegisters) { ContextInitializer initializer; Factory* factory = Isolate::Current()->factory(); - ArchRegExpMacroAssembler m(NativeRegExpMacroAssembler::ASCII, 6); + ArchRegExpMacroAssembler m(NativeRegExpMacroAssembler::ASCII, 6, + Isolate::Current()->runtime_zone()); uc16 foo_chars[3] = {'f', 'o', 'o'}; Vector<const uc16> foo(foo_chars, 3); @@ -1234,7 +1262,8 @@ TEST(MacroAssemblerStackOverflow) { Isolate* isolate = Isolate::Current(); Factory* factory = isolate->factory(); - ArchRegExpMacroAssembler m(NativeRegExpMacroAssembler::ASCII, 0); + ArchRegExpMacroAssembler m(NativeRegExpMacroAssembler::ASCII, 0, + Isolate::Current()->runtime_zone()); Label loop; m.Bind(&loop); @@ -1272,7 +1301,8 @@ TEST(MacroAssemblerNativeLotsOfRegisters) { Isolate* isolate = Isolate::Current(); Factory* factory = isolate->factory(); - ArchRegExpMacroAssembler m(NativeRegExpMacroAssembler::ASCII, 2); + ArchRegExpMacroAssembler m(NativeRegExpMacroAssembler::ASCII, 2, + Isolate::Current()->runtime_zone()); // At least 2048, to ensure the allocated space for registers // span one full page. @@ -1319,7 +1349,8 @@ TEST(MacroAssemblerNativeLotsOfRegisters) { TEST(MacroAssembler) { V8::Initialize(NULL); byte codes[1024]; - RegExpMacroAssemblerIrregexp m(Vector<byte>(codes, 1024)); + RegExpMacroAssemblerIrregexp m(Vector<byte>(codes, 1024), + Isolate::Current()->runtime_zone()); // ^f(o)o. Label fail, fail2, start; uc16 foo_chars[3]; @@ -1389,17 +1420,20 @@ TEST(AddInverseToTable) { static const int kLimit = 1000; static const int kRangeCount = 16; for (int t = 0; t < 10; t++) { - ZoneScope zone_scope(Isolate::Current(), DELETE_ON_EXIT); + ZoneScope zone_scope(Isolate::Current()->runtime_zone(), DELETE_ON_EXIT); + Zone* zone = Isolate::Current()->runtime_zone(); ZoneList<CharacterRange>* ranges = - new ZoneList<CharacterRange>(kRangeCount); + new(zone) + ZoneList<CharacterRange>(kRangeCount, zone); for (int i = 0; i < kRangeCount; i++) { int from = PseudoRandom(t + 87, i + 25) % kLimit; int to = from + (PseudoRandom(i + 87, t + 25) % (kLimit / 20)); if (to > kLimit) to = kLimit; - ranges->Add(CharacterRange(from, to)); + ranges->Add(CharacterRange(from, to), zone); } - DispatchTable table; - DispatchTableConstructor cons(&table, false); + DispatchTable table(zone); + DispatchTableConstructor cons(&table, false, + Isolate::Current()->runtime_zone()); cons.set_choice_index(0); cons.AddInverse(ranges); for (int i = 0; i < kLimit; i++) { @@ -1410,12 +1444,14 @@ TEST(AddInverseToTable) { CHECK_EQ(is_on, set->Get(0) == false); } } - ZoneScope zone_scope(Isolate::Current(), DELETE_ON_EXIT); + ZoneScope zone_scope(Isolate::Current()->runtime_zone(), DELETE_ON_EXIT); + Zone* zone = Isolate::Current()->runtime_zone(); ZoneList<CharacterRange>* ranges = - new ZoneList<CharacterRange>(1); - ranges->Add(CharacterRange(0xFFF0, 0xFFFE)); - DispatchTable table; - DispatchTableConstructor cons(&table, false); + new(zone) ZoneList<CharacterRange>(1, zone); + ranges->Add(CharacterRange(0xFFF0, 0xFFFE), zone); + DispatchTable table(zone); + DispatchTableConstructor cons(&table, false, + Isolate::Current()->runtime_zone()); cons.set_choice_index(0); cons.AddInverse(ranges); CHECK(!table.Get(0xFFFE)->Get(0)); @@ -1523,10 +1559,12 @@ TEST(UncanonicalizeEquivalence) { static void TestRangeCaseIndependence(CharacterRange input, Vector<CharacterRange> expected) { - ZoneScope zone_scope(Isolate::Current(), DELETE_ON_EXIT); + ZoneScope zone_scope(Isolate::Current()->runtime_zone(), DELETE_ON_EXIT); + Zone* zone = Isolate::Current()->runtime_zone(); int count = expected.length(); - ZoneList<CharacterRange>* list = new ZoneList<CharacterRange>(count); - input.AddCaseEquivalents(list, false); + ZoneList<CharacterRange>* list = + new(zone) ZoneList<CharacterRange>(count, zone); + input.AddCaseEquivalents(list, false, zone); CHECK_EQ(count, list->length()); for (int i = 0; i < list->length(); i++) { CHECK_EQ(expected[i].from(), list->at(i).from()); @@ -1587,13 +1625,16 @@ static bool InClass(uc16 c, ZoneList<CharacterRange>* ranges) { TEST(CharClassDifference) { v8::internal::V8::Initialize(NULL); - ZoneScope zone_scope(Isolate::Current(), DELETE_ON_EXIT); - ZoneList<CharacterRange>* base = new ZoneList<CharacterRange>(1); - base->Add(CharacterRange::Everything()); + ZoneScope zone_scope(Isolate::Current()->runtime_zone(), DELETE_ON_EXIT); + Zone* zone = Isolate::Current()->runtime_zone(); + ZoneList<CharacterRange>* base = + new(zone) ZoneList<CharacterRange>(1, zone); + base->Add(CharacterRange::Everything(), zone); Vector<const int> overlay = CharacterRange::GetWordBounds(); ZoneList<CharacterRange>* included = NULL; ZoneList<CharacterRange>* excluded = NULL; - CharacterRange::Split(base, overlay, &included, &excluded); + CharacterRange::Split(base, overlay, &included, &excluded, + Isolate::Current()->runtime_zone()); for (int i = 0; i < (1 << 16); i++) { bool in_base = InClass(i, base); if (in_base) { @@ -1614,13 +1655,15 @@ TEST(CharClassDifference) { TEST(CanonicalizeCharacterSets) { v8::internal::V8::Initialize(NULL); - ZoneScope scope(Isolate::Current(), DELETE_ON_EXIT); - ZoneList<CharacterRange>* list = new ZoneList<CharacterRange>(4); + ZoneScope scope(Isolate::Current()->runtime_zone(), DELETE_ON_EXIT); + Zone* zone = Isolate::Current()->runtime_zone(); + ZoneList<CharacterRange>* list = + new(zone) ZoneList<CharacterRange>(4, zone); CharacterSet set(list); - list->Add(CharacterRange(10, 20)); - list->Add(CharacterRange(30, 40)); - list->Add(CharacterRange(50, 60)); + list->Add(CharacterRange(10, 20), zone); + list->Add(CharacterRange(30, 40), zone); + list->Add(CharacterRange(50, 60), zone); set.Canonicalize(); ASSERT_EQ(3, list->length()); ASSERT_EQ(10, list->at(0).from()); @@ -1631,9 +1674,9 @@ TEST(CanonicalizeCharacterSets) { ASSERT_EQ(60, list->at(2).to()); list->Rewind(0); - list->Add(CharacterRange(10, 20)); - list->Add(CharacterRange(50, 60)); - list->Add(CharacterRange(30, 40)); + list->Add(CharacterRange(10, 20), zone); + list->Add(CharacterRange(50, 60), zone); + list->Add(CharacterRange(30, 40), zone); set.Canonicalize(); ASSERT_EQ(3, list->length()); ASSERT_EQ(10, list->at(0).from()); @@ -1644,11 +1687,11 @@ TEST(CanonicalizeCharacterSets) { ASSERT_EQ(60, list->at(2).to()); list->Rewind(0); - list->Add(CharacterRange(30, 40)); - list->Add(CharacterRange(10, 20)); - list->Add(CharacterRange(25, 25)); - list->Add(CharacterRange(100, 100)); - list->Add(CharacterRange(1, 1)); + list->Add(CharacterRange(30, 40), zone); + list->Add(CharacterRange(10, 20), zone); + list->Add(CharacterRange(25, 25), zone); + list->Add(CharacterRange(100, 100), zone); + list->Add(CharacterRange(1, 1), zone); set.Canonicalize(); ASSERT_EQ(5, list->length()); ASSERT_EQ(1, list->at(0).from()); @@ -1663,9 +1706,9 @@ TEST(CanonicalizeCharacterSets) { ASSERT_EQ(100, list->at(4).to()); list->Rewind(0); - list->Add(CharacterRange(10, 19)); - list->Add(CharacterRange(21, 30)); - list->Add(CharacterRange(20, 20)); + list->Add(CharacterRange(10, 19), zone); + list->Add(CharacterRange(21, 30), zone); + list->Add(CharacterRange(20, 20), zone); set.Canonicalize(); ASSERT_EQ(1, list->length()); ASSERT_EQ(10, list->at(0).from()); @@ -1675,9 +1718,10 @@ TEST(CanonicalizeCharacterSets) { TEST(CharacterRangeMerge) { v8::internal::V8::Initialize(NULL); - ZoneScope zone_scope(Isolate::Current(), DELETE_ON_EXIT); - ZoneList<CharacterRange> l1(4); - ZoneList<CharacterRange> l2(4); + ZoneScope zone_scope(Isolate::Current()->runtime_zone(), DELETE_ON_EXIT); + ZoneList<CharacterRange> l1(4, Isolate::Current()->runtime_zone()); + ZoneList<CharacterRange> l2(4, Isolate::Current()->runtime_zone()); + Zone* zone = Isolate::Current()->runtime_zone(); // Create all combinations of intersections of ranges, both singletons and // longer. @@ -1692,8 +1736,8 @@ TEST(CharacterRangeMerge) { // Y - outside after for (int i = 0; i < 5; i++) { - l1.Add(CharacterRange::Singleton(offset + 2)); - l2.Add(CharacterRange::Singleton(offset + i)); + l1.Add(CharacterRange::Singleton(offset + 2), zone); + l2.Add(CharacterRange::Singleton(offset + i), zone); offset += 6; } @@ -1708,8 +1752,8 @@ TEST(CharacterRangeMerge) { // Y - disjoint after for (int i = 0; i < 7; i++) { - l1.Add(CharacterRange::Range(offset + 2, offset + 4)); - l2.Add(CharacterRange::Singleton(offset + i)); + l1.Add(CharacterRange::Range(offset + 2, offset + 4), zone); + l2.Add(CharacterRange::Singleton(offset + i), zone); offset += 8; } @@ -1729,35 +1773,35 @@ TEST(CharacterRangeMerge) { // YYYYYYYYYYYY - containing entirely. for (int i = 0; i < 9; i++) { - l1.Add(CharacterRange::Range(offset + 6, offset + 15)); // Length 8. - l2.Add(CharacterRange::Range(offset + 2 * i, offset + 2 * i + 3)); + l1.Add(CharacterRange::Range(offset + 6, offset + 15), zone); // Length 8. + l2.Add(CharacterRange::Range(offset + 2 * i, offset + 2 * i + 3), zone); offset += 22; } - l1.Add(CharacterRange::Range(offset + 6, offset + 15)); - l2.Add(CharacterRange::Range(offset + 6, offset + 15)); + l1.Add(CharacterRange::Range(offset + 6, offset + 15), zone); + l2.Add(CharacterRange::Range(offset + 6, offset + 15), zone); offset += 22; - l1.Add(CharacterRange::Range(offset + 6, offset + 15)); - l2.Add(CharacterRange::Range(offset + 4, offset + 17)); + l1.Add(CharacterRange::Range(offset + 6, offset + 15), zone); + l2.Add(CharacterRange::Range(offset + 4, offset + 17), zone); offset += 22; // Different kinds of multi-range overlap: // XXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXX // YYYY Y YYYY Y YYYY Y YYYY Y YYYY Y YYYY Y - l1.Add(CharacterRange::Range(offset, offset + 21)); - l1.Add(CharacterRange::Range(offset + 31, offset + 52)); + l1.Add(CharacterRange::Range(offset, offset + 21), zone); + l1.Add(CharacterRange::Range(offset + 31, offset + 52), zone); for (int i = 0; i < 6; i++) { - l2.Add(CharacterRange::Range(offset + 2, offset + 5)); - l2.Add(CharacterRange::Singleton(offset + 8)); + l2.Add(CharacterRange::Range(offset + 2, offset + 5), zone); + l2.Add(CharacterRange::Singleton(offset + 8), zone); offset += 9; } ASSERT(CharacterRange::IsCanonical(&l1)); ASSERT(CharacterRange::IsCanonical(&l2)); - ZoneList<CharacterRange> first_only(4); - ZoneList<CharacterRange> second_only(4); - ZoneList<CharacterRange> both(4); + ZoneList<CharacterRange> first_only(4, Isolate::Current()->runtime_zone()); + ZoneList<CharacterRange> second_only(4, Isolate::Current()->runtime_zone()); + ZoneList<CharacterRange> both(4, Isolate::Current()->runtime_zone()); } |