[gcmole] Handlify test-api.cc

Bug: v8:9994
Change-Id: I662182a252c2aab053f6c821bf281f613316700a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2207143
Commit-Queue: Maya Lekova <mslekova@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Auto-Submit: Maya Lekova <mslekova@chromium.org>
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#67869}
This commit is contained in:
Maya Lekova 2020-05-18 16:20:14 +02:00 committed by Commit Bot
parent 72ae7f48cc
commit 9e2f3f864e

View File

@ -14622,10 +14622,10 @@ THREADED_TEST(MorphCompositeStringTest) {
CHECK(lhs->IsOneByte());
CHECK(rhs->IsOneByte());
i::String ilhs = *v8::Utils::OpenHandle(*lhs);
i::String irhs = *v8::Utils::OpenHandle(*rhs);
MorphAString(ilhs, &one_byte_resource, &uc16_resource);
MorphAString(irhs, &one_byte_resource, &uc16_resource);
i::Handle<i::String> ilhs = v8::Utils::OpenHandle(*lhs);
i::Handle<i::String> irhs = v8::Utils::OpenHandle(*rhs);
MorphAString(*ilhs, &one_byte_resource, &uc16_resource);
MorphAString(*irhs, &one_byte_resource, &uc16_resource);
// This should UTF-8 without flattening, since everything is ASCII.
Local<String> cons =
@ -14670,14 +14670,14 @@ THREADED_TEST(MorphCompositeStringTest) {
.FromJust());
// This avoids the GC from trying to free a stack allocated resource.
if (ilhs.IsExternalOneByteString())
i::ExternalOneByteString::cast(ilhs).SetResource(i_isolate, nullptr);
if (ilhs->IsExternalOneByteString())
i::ExternalOneByteString::cast(*ilhs).SetResource(i_isolate, nullptr);
else
i::ExternalTwoByteString::cast(ilhs).SetResource(i_isolate, nullptr);
if (irhs.IsExternalOneByteString())
i::ExternalOneByteString::cast(irhs).SetResource(i_isolate, nullptr);
i::ExternalTwoByteString::cast(*ilhs).SetResource(i_isolate, nullptr);
if (irhs->IsExternalOneByteString())
i::ExternalOneByteString::cast(*irhs).SetResource(i_isolate, nullptr);
else
i::ExternalTwoByteString::cast(irhs).SetResource(i_isolate, nullptr);
i::ExternalTwoByteString::cast(*irhs).SetResource(i_isolate, nullptr);
}
i::DeleteArray(two_byte_string);
}