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

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

Issue 239243018: Heap::AllocateStringFromOneByte() and major part of its callers handlified. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressing comment + some cleanup Created 6 years, 8 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') | tools/lexer-shell.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-strings.cc
diff --git a/test/cctest/test-strings.cc b/test/cctest/test-strings.cc
index 0574c69590a2d8d93dd2050b9cbb45af71894021..df59388c7a7f3fb79a3448b0df49215b11fc8bae 100644
--- a/test/cctest/test-strings.cc
+++ b/test/cctest/test-strings.cc
@@ -164,8 +164,8 @@ static void InitializeBuildingBlocks(Handle<String>* building_blocks,
for (int j = 0; j < len; j++) {
buf[j] = rng->next(0x10000);
}
- building_blocks[i] =
- factory->NewStringFromTwoByte(Vector<const uc16>(buf, len));
+ building_blocks[i] = factory->NewStringFromTwoByte(
+ Vector<const uc16>(buf, len)).ToHandleChecked();
for (int j = 0; j < len; j++) {
CHECK_EQ(buf[j], building_blocks[i]->Get(j));
}
@@ -176,8 +176,8 @@ static void InitializeBuildingBlocks(Handle<String>* building_blocks,
for (int j = 0; j < len; j++) {
buf[j] = rng->next(0x80);
}
- building_blocks[i] =
- factory->NewStringFromAscii(Vector<const char>(buf, len));
+ building_blocks[i] = factory->NewStringFromAscii(
+ Vector<const char>(buf, len)).ToHandleChecked();
for (int j = 0; j < len; j++) {
CHECK_EQ(buf[j], building_blocks[i]->Get(j));
}
@@ -463,7 +463,7 @@ static Handle<String> ConstructLeft(
ConsStringGenerationData* data,
int depth) {
Factory* factory = CcTest::i_isolate()->factory();
- Handle<String> answer = factory->NewStringFromAscii(CStrVector(""));
+ Handle<String> answer = factory->NewStringFromStaticAscii("");
data->stats_.leaves_++;
for (int i = 0; i < depth; i++) {
Handle<String> block = data->block(i);
@@ -482,7 +482,7 @@ static Handle<String> ConstructRight(
ConsStringGenerationData* data,
int depth) {
Factory* factory = CcTest::i_isolate()->factory();
- Handle<String> answer = factory->NewStringFromAscii(CStrVector(""));
+ Handle<String> answer = factory->NewStringFromStaticAscii("");
data->stats_.leaves_++;
for (int i = depth - 1; i >= 0; i--) {
Handle<String> block = data->block(i);
@@ -870,9 +870,9 @@ TEST(DeepAscii) {
for (int i = 0; i < DEEP_ASCII_DEPTH; i++) {
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"));
+ Handle<String> string = factory->NewStringFromOneByte(
+ OneByteVector(foo, DEEP_ASCII_DEPTH)).ToHandleChecked();
+ Handle<String> foo_string = factory->NewStringFromStaticAscii("foo");
for (int i = 0; i < DEEP_ASCII_DEPTH; i += 10) {
string = factory->NewConsString(string, foo_string).ToHandleChecked();
}
@@ -1100,7 +1100,7 @@ TEST(SliceFromCons) {
Factory* factory = CcTest::i_isolate()->factory();
v8::HandleScope scope(CcTest::isolate());
Handle<String> string =
- factory->NewStringFromAscii(CStrVector("parentparentparent"));
+ factory->NewStringFromStaticAscii("parentparentparent");
Handle<String> parent =
factory->NewConsString(string, string).ToHandleChecked();
CHECK(parent->IsConsString());
« no previous file with comments | « test/cctest/test-regexp.cc ('k') | tools/lexer-shell.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698