summaryrefslogtreecommitdiff
path: root/deps/v8/test/cctest/test-strings.cc
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2011-07-05 14:40:13 -0700
committerRyan Dahl <ry@tinyclouds.org>2011-07-05 14:51:29 -0700
commit149562555c9bf56457dee9a1ad70c53ed670a776 (patch)
treef6217cf3c54ddbee03f37247a3c7c75203f868fd /deps/v8/test/cctest/test-strings.cc
parentf08720606757577d95bd09b48697c7decbf17f00 (diff)
downloadnode-new-149562555c9bf56457dee9a1ad70c53ed670a776.tar.gz
Downgrade V8 to 3.1.8.25
There are serious performance regressions both in V8 and our own legacy networking stack. Until we correct our own problems we are going back to the old V8.
Diffstat (limited to 'deps/v8/test/cctest/test-strings.cc')
-rw-r--r--deps/v8/test/cctest/test-strings.cc46
1 files changed, 23 insertions, 23 deletions
diff --git a/deps/v8/test/cctest/test-strings.cc b/deps/v8/test/cctest/test-strings.cc
index 4d9b264e93..3f02b32b8c 100644
--- a/deps/v8/test/cctest/test-strings.cc
+++ b/deps/v8/test/cctest/test-strings.cc
@@ -94,7 +94,7 @@ static void InitializeBuildingBlocks(
buf[j] = gen() % 65536;
}
building_blocks[i] =
- FACTORY->NewStringFromTwoByte(Vector<const uc16>(buf, len));
+ Factory::NewStringFromTwoByte(Vector<const uc16>(buf, len));
for (int j = 0; j < len; j++) {
CHECK_EQ(buf[j], building_blocks[i]->Get(j));
}
@@ -106,19 +106,19 @@ static void InitializeBuildingBlocks(
buf[j] = gen() % 128;
}
building_blocks[i] =
- FACTORY->NewStringFromAscii(Vector<const char>(buf, len));
+ Factory::NewStringFromAscii(Vector<const char>(buf, len));
for (int j = 0; j < len; j++) {
CHECK_EQ(buf[j], building_blocks[i]->Get(j));
}
break;
}
case 2: {
- uc16* buf = ZONE->NewArray<uc16>(len);
+ uc16* buf = Zone::NewArray<uc16>(len);
for (int j = 0; j < len; j++) {
buf[j] = gen() % 65536;
}
Resource* resource = new Resource(Vector<const uc16>(buf, len));
- building_blocks[i] = FACTORY->NewExternalStringFromTwoByte(resource);
+ building_blocks[i] = Factory::NewExternalStringFromTwoByte(resource);
for (int j = 0; j < len; j++) {
CHECK_EQ(buf[j], building_blocks[i]->Get(j));
}
@@ -130,7 +130,7 @@ static void InitializeBuildingBlocks(
buf[j] = gen() % 128;
}
building_blocks[i] =
- FACTORY->NewStringFromAscii(Vector<const char>(buf, len));
+ Factory::NewStringFromAscii(Vector<const char>(buf, len));
for (int j = 0; j < len; j++) {
CHECK_EQ(buf[j], building_blocks[i]->Get(j));
}
@@ -145,9 +145,9 @@ static void InitializeBuildingBlocks(
static Handle<String> ConstructLeft(
Handle<String> building_blocks[NUMBER_OF_BUILDING_BLOCKS],
int depth) {
- Handle<String> answer = FACTORY->NewStringFromAscii(CStrVector(""));
+ Handle<String> answer = Factory::NewStringFromAscii(CStrVector(""));
for (int i = 0; i < depth; i++) {
- answer = FACTORY->NewConsString(
+ answer = Factory::NewConsString(
answer,
building_blocks[i % NUMBER_OF_BUILDING_BLOCKS]);
}
@@ -158,9 +158,9 @@ static Handle<String> ConstructLeft(
static Handle<String> ConstructRight(
Handle<String> building_blocks[NUMBER_OF_BUILDING_BLOCKS],
int depth) {
- Handle<String> answer = FACTORY->NewStringFromAscii(CStrVector(""));
+ Handle<String> answer = Factory::NewStringFromAscii(CStrVector(""));
for (int i = depth - 1; i >= 0; i--) {
- answer = FACTORY->NewConsString(
+ answer = Factory::NewConsString(
building_blocks[i % NUMBER_OF_BUILDING_BLOCKS],
answer);
}
@@ -177,7 +177,7 @@ static Handle<String> ConstructBalancedHelper(
return building_blocks[from % NUMBER_OF_BUILDING_BLOCKS];
}
if (to - from == 2) {
- return FACTORY->NewConsString(
+ return Factory::NewConsString(
building_blocks[from % NUMBER_OF_BUILDING_BLOCKS],
building_blocks[(from+1) % NUMBER_OF_BUILDING_BLOCKS]);
}
@@ -185,7 +185,7 @@ static Handle<String> ConstructBalancedHelper(
ConstructBalancedHelper(building_blocks, from, from + ((to - from) / 2));
Handle<String> part2 =
ConstructBalancedHelper(building_blocks, from + ((to - from) / 2), to);
- return FACTORY->NewConsString(part1, part2);
+ return Factory::NewConsString(part1, part2);
}
@@ -233,7 +233,7 @@ TEST(Traverse) {
InitializeVM();
v8::HandleScope scope;
Handle<String> building_blocks[NUMBER_OF_BUILDING_BLOCKS];
- ZoneScope zone(Isolate::Current(), DELETE_ON_EXIT);
+ ZoneScope zone(DELETE_ON_EXIT);
InitializeBuildingBlocks(building_blocks);
Handle<String> flat = ConstructBalanced(building_blocks);
FlattenString(flat);
@@ -286,12 +286,12 @@ TEST(DeepAscii) {
foo[i] = "foo "[i % 4];
}
Handle<String> string =
- FACTORY->NewStringFromAscii(Vector<const char>(foo, DEEP_ASCII_DEPTH));
- Handle<String> foo_string = FACTORY->NewStringFromAscii(CStrVector("foo"));
+ 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, foo_string);
+ string = Factory::NewConsString(string, foo_string);
}
- Handle<String> flat_string = FACTORY->NewConsString(string, foo_string);
+ Handle<String> flat_string = Factory::NewConsString(string, foo_string);
FlattenString(flat_string);
for (int i = 0; i < 500; i++) {
@@ -348,7 +348,7 @@ TEST(Utf8Conversion) {
TEST(ExternalShortStringAdd) {
- ZoneScope zone(Isolate::Current(), DELETE_ON_EXIT);
+ ZoneScope zone(DELETE_ON_EXIT);
InitializeVM();
v8::HandleScope handle_scope;
@@ -365,7 +365,7 @@ TEST(ExternalShortStringAdd) {
// Generate short ascii and non-ascii external strings.
for (int i = 0; i <= kMaxLength; i++) {
- char* ascii = ZONE->NewArray<char>(i + 1);
+ char* ascii = Zone::NewArray<char>(i + 1);
for (int j = 0; j < i; j++) {
ascii[j] = 'a';
}
@@ -377,7 +377,7 @@ TEST(ExternalShortStringAdd) {
v8::String::NewExternal(ascii_resource);
ascii_external_strings->Set(v8::Integer::New(i), ascii_external_string);
- uc16* non_ascii = ZONE->NewArray<uc16>(i + 1);
+ uc16* non_ascii = Zone::NewArray<uc16>(i + 1);
for (int j = 0; j < i; j++) {
non_ascii[j] = 0x1234;
}
@@ -439,7 +439,7 @@ TEST(CachedHashOverflow) {
// We incorrectly allowed strings to be tagged as array indices even if their
// values didn't fit in the hash field.
// See http://code.google.com/p/v8/issues/detail?id=728
- ZoneScope zone(Isolate::Current(), DELETE_ON_EXIT);
+ ZoneScope zone(DELETE_ON_EXIT);
InitializeVM();
v8::HandleScope handle_scope;
@@ -459,10 +459,10 @@ TEST(CachedHashOverflow) {
Handle<Smi> fortytwo(Smi::FromInt(42));
Handle<Smi> thirtyseven(Smi::FromInt(37));
Handle<Object> results[] = {
- FACTORY->undefined_value(),
+ Factory::undefined_value(),
fortytwo,
- FACTORY->undefined_value(),
- FACTORY->undefined_value(),
+ Factory::undefined_value(),
+ Factory::undefined_value(),
thirtyseven,
fortytwo,
thirtyseven // Bug yielded 42 here.