Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(21)

Unified Diff: test/cctest/test-regexp.cc

Issue 7374002: Refactor allocation policies. Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/cctest/test-list.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-regexp.cc
diff --git a/test/cctest/test-regexp.cc b/test/cctest/test-regexp.cc
index 9f18b600b25162e028f9d7da319344528e58acd4..5a9dfe32544d22ed8b36ff2c055973e0fcd287b1 100644
--- a/test/cctest/test-regexp.cc
+++ b/test/cctest/test-regexp.cc
@@ -467,7 +467,7 @@ 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);
+ ZoneList<CharacterRange>* ranges = ZoneList<CharacterRange>::New(ZONE, 2);
CharacterRange::AddClassEscape(c, ranges);
for (unsigned i = 0; i < (1 << 16); i++) {
bool in_class = false;
@@ -554,7 +554,7 @@ TEST(SplayTreeSimple) {
v8::internal::V8::Initialize(NULL);
static const unsigned kLimit = 1000;
ZoneScope zone_scope(Isolate::Current(), DELETE_ON_EXIT);
- ZoneSplayTree<TestConfig> tree;
+ ZoneSplayTree<TestConfig> tree(ZONE);
bool seen[kLimit];
for (unsigned i = 0; i < kLimit; i++) seen[i] = false;
#define CHECK_MAPS_EQUAL() do { \
@@ -622,7 +622,7 @@ TEST(DispatchTableConstruction) {
}
// Enter test data into dispatch table.
ZoneScope zone_scope(Isolate::Current(), DELETE_ON_EXIT);
- DispatchTable table;
+ DispatchTable table(ZONE);
for (int i = 0; i < kRangeCount; i++) {
uc16* range = ranges[i];
for (int j = 0; j < 2 * kRangeSize; j += 2)
@@ -1385,15 +1385,15 @@ TEST(AddInverseToTable) {
for (int t = 0; t < 10; t++) {
ZoneScope zone_scope(Isolate::Current(), DELETE_ON_EXIT);
ZoneList<CharacterRange>* ranges =
- new ZoneList<CharacterRange>(kRangeCount);
+ ZoneList<CharacterRange>::New(ZONE, kRangeCount);
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));
}
- DispatchTable table;
- DispatchTableConstructor cons(&table, false);
+ DispatchTable table(ZONE);
+ DispatchTableConstructor cons(ZONE, &table, false);
cons.set_choice_index(0);
cons.AddInverse(ranges);
for (int i = 0; i < kLimit; i++) {
@@ -1406,10 +1406,10 @@ TEST(AddInverseToTable) {
}
ZoneScope zone_scope(Isolate::Current(), DELETE_ON_EXIT);
ZoneList<CharacterRange>* ranges =
- new ZoneList<CharacterRange>(1);
+ ZoneList<CharacterRange>::New(ZONE, 1);
ranges->Add(CharacterRange(0xFFF0, 0xFFFE));
- DispatchTable table;
- DispatchTableConstructor cons(&table, false);
+ DispatchTable table(ZONE);
+ DispatchTableConstructor cons(ZONE, &table, false);
cons.set_choice_index(0);
cons.AddInverse(ranges);
CHECK(!table.Get(0xFFFE)->Get(0));
@@ -1519,7 +1519,7 @@ static void TestRangeCaseIndependence(CharacterRange input,
Vector<CharacterRange> expected) {
ZoneScope zone_scope(Isolate::Current(), DELETE_ON_EXIT);
int count = expected.length();
- ZoneList<CharacterRange>* list = new ZoneList<CharacterRange>(count);
+ ZoneList<CharacterRange>* list = ZoneList<CharacterRange>::New(ZONE, count);
input.AddCaseEquivalents(list, false);
CHECK_EQ(count, list->length());
for (int i = 0; i < list->length(); i++) {
@@ -1582,12 +1582,12 @@ 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);
+ ZoneList<CharacterRange>* base = ZoneList<CharacterRange>::New(ZONE, 1);
base->Add(CharacterRange::Everything());
Vector<const uc16> overlay = CharacterRange::GetWordBounds();
ZoneList<CharacterRange>* included = NULL;
ZoneList<CharacterRange>* excluded = NULL;
- CharacterRange::Split(base, overlay, &included, &excluded);
+ CharacterRange::Split(ZONE, base, overlay, &included, &excluded);
for (int i = 0; i < (1 << 16); i++) {
bool in_base = InClass(i, base);
if (in_base) {
@@ -1609,7 +1609,7 @@ TEST(CharClassDifference) {
TEST(CanonicalizeCharacterSets) {
v8::internal::V8::Initialize(NULL);
ZoneScope scope(Isolate::Current(), DELETE_ON_EXIT);
- ZoneList<CharacterRange>* list = new ZoneList<CharacterRange>(4);
+ ZoneList<CharacterRange>* list = ZoneList<CharacterRange>::New(ZONE, 4);
CharacterSet set(list);
list->Add(CharacterRange(10, 20));
@@ -1680,8 +1680,8 @@ static bool CharacterInSet(ZoneList<CharacterRange>* set, uc16 value) {
TEST(CharacterRangeMerge) {
v8::internal::V8::Initialize(NULL);
ZoneScope zone_scope(Isolate::Current(), DELETE_ON_EXIT);
- ZoneList<CharacterRange> l1(4);
- ZoneList<CharacterRange> l2(4);
+ ZoneList<CharacterRange> l1(ZONE, 4);
+ ZoneList<CharacterRange> l2(ZONE, 4);
// Create all combinations of intersections of ranges, both singletons and
// longer.
@@ -1759,9 +1759,9 @@ TEST(CharacterRangeMerge) {
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(ZONE, 4);
+ ZoneList<CharacterRange> second_only(ZONE, 4);
+ ZoneList<CharacterRange> both(ZONE, 4);
// Merge one direction.
CharacterRange::Merge(&l1, &l2, &first_only, &second_only, &both);
@@ -1813,7 +1813,7 @@ TEST(CharacterRangeMerge) {
}
// Merge into same set.
- ZoneList<CharacterRange> all(4);
+ ZoneList<CharacterRange> all(ZONE, 4);
CharacterRange::Merge(&l1, &l2, &all, &all, &all);
CHECK(CharacterRange::IsCanonical(&all));
« no previous file with comments | « test/cctest/test-list.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698