From ca655f5e7def13195121d3daf70cec81212da817 Mon Sep 17 00:00:00 2001 From: Timothy Flynn Date: Fri, 13 Jan 2023 09:41:24 -0500 Subject: [PATCH] LibJS: Rename VM::string_cache to deprecated_string_cache And rename the member variable from m_string_cache to m_deprecated_string_cache to match. --- Userland/Libraries/LibJS/Heap/Heap.cpp | 2 +- Userland/Libraries/LibJS/Runtime/PrimitiveString.cpp | 4 ++-- Userland/Libraries/LibJS/Runtime/VM.h | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Userland/Libraries/LibJS/Heap/Heap.cpp b/Userland/Libraries/LibJS/Heap/Heap.cpp index e452ecfd94..254cecf19a 100644 --- a/Userland/Libraries/LibJS/Heap/Heap.cpp +++ b/Userland/Libraries/LibJS/Heap/Heap.cpp @@ -57,7 +57,7 @@ Heap::Heap(VM& vm) Heap::~Heap() { - vm().string_cache().clear(); + vm().deprecated_string_cache().clear(); collect_garbage(CollectionType::CollectEverything); } diff --git a/Userland/Libraries/LibJS/Runtime/PrimitiveString.cpp b/Userland/Libraries/LibJS/Runtime/PrimitiveString.cpp index 42c7b2f08a..65db0765a2 100644 --- a/Userland/Libraries/LibJS/Runtime/PrimitiveString.cpp +++ b/Userland/Libraries/LibJS/Runtime/PrimitiveString.cpp @@ -38,7 +38,7 @@ PrimitiveString::PrimitiveString(Utf16String string) PrimitiveString::~PrimitiveString() { if (has_deprecated_string()) - vm().string_cache().remove(*m_deprecated_string); + vm().deprecated_string_cache().remove(*m_deprecated_string); } void PrimitiveString::visit_edges(Cell::Visitor& visitor) @@ -139,7 +139,7 @@ NonnullGCPtr PrimitiveString::create(VM& vm, DeprecatedString s return vm.single_ascii_character_string(ch); } - auto& string_cache = vm.string_cache(); + auto& string_cache = vm.deprecated_string_cache(); auto it = string_cache.find(string); if (it == string_cache.end()) { auto new_string = vm.heap().allocate_without_realm(string); diff --git a/Userland/Libraries/LibJS/Runtime/VM.h b/Userland/Libraries/LibJS/Runtime/VM.h index 7ff9087d10..8ac1aa219f 100644 --- a/Userland/Libraries/LibJS/Runtime/VM.h +++ b/Userland/Libraries/LibJS/Runtime/VM.h @@ -73,9 +73,9 @@ public: JS_ENUMERATE_WELL_KNOWN_SYMBOLS #undef __JS_ENUMERATE - HashMap& string_cache() + HashMap& deprecated_string_cache() { - return m_string_cache; + return m_deprecated_string_cache; } PrimitiveString& empty_string() { return *m_empty_string; } PrimitiveString& single_ascii_character_string(u8 character) @@ -257,7 +257,7 @@ private: void import_module_dynamically(ScriptOrModule referencing_script_or_module, ModuleRequest module_request, PromiseCapability const& promise_capability); void finish_dynamic_import(ScriptOrModule referencing_script_or_module, ModuleRequest module_request, PromiseCapability const& promise_capability, Promise* inner_promise); - HashMap m_string_cache; + HashMap m_deprecated_string_cache; Heap m_heap; Vector m_interpreters;