Commit 62130792 authored by jameslahm's avatar jameslahm Committed by V8 LUCI CQ

[test] Move cctest/test-concurrent-string to unittests

... /objects/concurrent-string-unittest.

- Add AsciiToTwoByteString to convert ascii string to
two byte string.

Bug: v8:12781
Change-Id: Icc2f745846fa10ec940085eab0ef022d7c277e0a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3600552Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
Commit-Queue: 王澳 <wangao.james@bytedance.com>
Cr-Commit-Position: refs/heads/main@{#80101}
parent 130a3099
......@@ -203,7 +203,6 @@ v8_source_set("cctest_sources") {
"test-concurrent-js-array.cc",
"test-concurrent-prototype.cc",
"test-concurrent-script-context-table.cc",
"test-concurrent-string.cc",
"test-concurrent-transition-array.cc",
"test-constantpool.cc",
"test-conversions.cc",
......
......@@ -370,6 +370,7 @@ v8_source_set("unittests_sources") {
"numbers/conversions-unittest.cc",
"objects/array-list-unittest.cc",
"objects/concurrent-descriptor-array-unittest.cc",
"objects/concurrent-string-unittest.cc",
"objects/object-unittest.cc",
"objects/osr-optimized-code-cache-unittest.cc",
"objects/swiss-hash-table-helpers-unittest.cc",
......
......@@ -407,6 +407,13 @@ class V8_NODISCARD ManualGCScope final : private SaveFlags {
~ManualGCScope() = default;
};
static inline uint16_t* AsciiToTwoByteString(const char* source) {
size_t array_length = strlen(source) + 1;
uint16_t* converted = NewArray<uint16_t>(array_length);
for (size_t i = 0; i < array_length; i++) converted[i] = source[i];
return converted;
}
} // namespace internal
} // namespace v8
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment