LibJS: Remove ByteString internals from PrimitiveString

PrimitiveString is now internally either UTF-8, UTF-16, or both.
We no longer convert them to/from ByteString anywhere, nor does VM have
a ByteString cache.
This commit is contained in:
Andreas Kling 2025-03-28 13:55:39 +00:00 committed by Tim Flynn
commit c71772126f
Notes: github-actions[bot] 2025-03-28 16:32:54 +00:00
14 changed files with 49 additions and 118 deletions

View file

@ -75,14 +75,14 @@ VM::VM(OwnPtr<CustomData> custom_data, ErrorMessages error_messages)
m_empty_string = m_heap.allocate<PrimitiveString>(String {});
typeof_strings = {
.number = m_heap.allocate<PrimitiveString>("number"),
.undefined = m_heap.allocate<PrimitiveString>("undefined"),
.object = m_heap.allocate<PrimitiveString>("object"),
.string = m_heap.allocate<PrimitiveString>("string"),
.symbol = m_heap.allocate<PrimitiveString>("symbol"),
.boolean = m_heap.allocate<PrimitiveString>("boolean"),
.bigint = m_heap.allocate<PrimitiveString>("bigint"),
.function = m_heap.allocate<PrimitiveString>("function"),
.number = m_heap.allocate<PrimitiveString>("number"_string),
.undefined = m_heap.allocate<PrimitiveString>("undefined"_string),
.object = m_heap.allocate<PrimitiveString>("object"_string),
.string = m_heap.allocate<PrimitiveString>("string"_string),
.symbol = m_heap.allocate<PrimitiveString>("symbol"_string),
.boolean = m_heap.allocate<PrimitiveString>("boolean"_string),
.bigint = m_heap.allocate<PrimitiveString>("bigint"_string),
.function = m_heap.allocate<PrimitiveString>("function"_string),
};
for (size_t i = 0; i < single_ascii_character_strings.size(); ++i)