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

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

Issue 45010: Remove all uses of StringShape variables, since that has proven... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years, 9 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-regexp.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-strings.cc
===================================================================
--- test/cctest/test-strings.cc (revision 1519)
+++ test/cctest/test-strings.cc (working copy)
@@ -62,8 +62,7 @@
building_blocks[i] =
Factory::NewStringFromTwoByte(Vector<const uc16>(buf, len));
for (int j = 0; j < len; j++) {
- StringShape shape(*building_blocks[i]);
- CHECK_EQ(buf[j], building_blocks[i]->Get(shape, j));
+ CHECK_EQ(buf[j], building_blocks[i]->Get(j));
}
break;
}
@@ -75,8 +74,7 @@
building_blocks[i] =
Factory::NewStringFromAscii(Vector<const char>(buf, len));
for (int j = 0; j < len; j++) {
- StringShape shape(*building_blocks[i]);
- CHECK_EQ(buf[j], building_blocks[i]->Get(shape, j));
+ CHECK_EQ(buf[j], building_blocks[i]->Get(j));
}
break;
}
@@ -101,8 +99,7 @@
Resource* resource = new Resource(Vector<const uc16>(buf, len));
building_blocks[i] = Factory::NewExternalStringFromTwoByte(resource);
for (int j = 0; j < len; j++) {
- StringShape shape(*building_blocks[i]);
- CHECK_EQ(buf[j], building_blocks[i]->Get(shape, j));
+ CHECK_EQ(buf[j], building_blocks[i]->Get(j));
}
break;
}
@@ -114,8 +111,7 @@
building_blocks[i] =
Factory::NewStringFromAscii(Vector<const char>(buf, len));
for (int j = 0; j < len; j++) {
- StringShape shape(*building_blocks[i]);
- CHECK_EQ(buf[j], building_blocks[i]->Get(shape, j));
+ CHECK_EQ(buf[j], building_blocks[i]->Get(j));
}
DeleteArray<char>(buf);
break;
@@ -132,9 +128,7 @@
for (int i = 0; i < depth; i++) {
answer = Factory::NewConsString(
answer,
- StringShape(*answer),
- building_blocks[i % NUMBER_OF_BUILDING_BLOCKS],
- StringShape(*building_blocks[i % NUMBER_OF_BUILDING_BLOCKS]));
+ building_blocks[i % NUMBER_OF_BUILDING_BLOCKS]);
}
return answer;
}
@@ -147,9 +141,7 @@
for (int i = depth - 1; i >= 0; i--) {
answer = Factory::NewConsString(
building_blocks[i % NUMBER_OF_BUILDING_BLOCKS],
- StringShape(*building_blocks[i % NUMBER_OF_BUILDING_BLOCKS]),
- answer,
- StringShape(*answer));
+ answer);
}
return answer;
}
@@ -166,19 +158,13 @@
if (to - from == 2) {
return Factory::NewConsString(
building_blocks[from % NUMBER_OF_BUILDING_BLOCKS],
- StringShape(*building_blocks[from % NUMBER_OF_BUILDING_BLOCKS]),
- building_blocks[(from+1) % NUMBER_OF_BUILDING_BLOCKS],
- StringShape(*building_blocks[(from+1) % NUMBER_OF_BUILDING_BLOCKS]));
+ building_blocks[(from+1) % NUMBER_OF_BUILDING_BLOCKS]);
}
Handle<String> part1 =
ConstructBalancedHelper(building_blocks, from, from + ((to - from) / 2));
Handle<String> part2 =
ConstructBalancedHelper(building_blocks, from + ((to - from) / 2), to);
- return Factory::NewConsString(
- part1,
- StringShape(*part1),
- part2,
- StringShape(*part2));
+ return Factory::NewConsString(part1, part2);
}
@@ -216,8 +202,8 @@
CHECK_EQ(c, buffer2.GetNext());
i++;
}
- s1->Get(StringShape(*s1), s1->length() - 1);
- s2->Get(StringShape(*s2), s2->length() - 1);
+ s1->Get(s1->length() - 1);
+ s2->Get(s2->length() - 1);
}
@@ -299,19 +285,13 @@
Handle<String> rhs = building_blocks[(from+1) % NUMBER_OF_BUILDING_BLOCKS];
if (gen() % 2 == 0)
rhs = SliceOf(rhs);
- return Factory::NewConsString(lhs,
- StringShape(*lhs),
- rhs,
- StringShape(*rhs));
+ return Factory::NewConsString(lhs, rhs);
}
Handle<String> part1 =
ConstructBalancedHelper(building_blocks, from, from + ((to - from) / 2));
Handle<String> part2 =
ConstructBalancedHelper(building_blocks, from + ((to - from) / 2), to);
- Handle<String> branch = Factory::NewConsString(part1,
- StringShape(*part1),
- part2,
- StringShape(*part2));
+ Handle<String> branch = Factory::NewConsString(part1, part2);
if (gen() % 2 == 0)
return branch;
return(SliceOf(branch));
@@ -351,15 +331,9 @@
Factory::NewStringFromAscii(Vector<const char>(foo, DEEP_ASCII_DEPTH));
Handle<String> foo_string = Factory::NewStringFromAscii(CStrVector("foo"));
for (int i = 0; i < DEEP_ASCII_DEPTH; i += 10) {
- string = Factory::NewConsString(string,
- StringShape(*string),
- foo_string,
- StringShape(*foo_string));
+ string = Factory::NewConsString(string, foo_string);
}
- Handle<String> flat_string = Factory::NewConsString(string,
- StringShape(*string),
- foo_string,
- StringShape(*foo_string));
+ Handle<String> flat_string = Factory::NewConsString(string, foo_string);
FlattenString(flat_string);
for (int i = 0; i < 500; i++) {
« no previous file with comments | « test/cctest/test-regexp.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698