From d1b58ee9adb5a0c0f6670767bde1ae9854d0cf2d Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Tue, 22 Sep 2020 16:18:51 +0200 Subject: LibJS: Move well-known symbols to the VM No need to instantiate unique symbols for each Interpreter; they can be VM-global. This reduces the memory cost and startup time anyway. --- Libraries/LibJS/Runtime/SymbolConstructor.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Libraries/LibJS/Runtime/SymbolConstructor.cpp') diff --git a/Libraries/LibJS/Runtime/SymbolConstructor.cpp b/Libraries/LibJS/Runtime/SymbolConstructor.cpp index 7cb4693d9a..47ff1283b2 100644 --- a/Libraries/LibJS/Runtime/SymbolConstructor.cpp +++ b/Libraries/LibJS/Runtime/SymbolConstructor.cpp @@ -47,7 +47,7 @@ void SymbolConstructor::initialize(GlobalObject& global_object) define_native_function("keyFor", key_for, 1, Attribute::Writable | Attribute::Configurable); #define __JS_ENUMERATE(SymbolName, snake_name) \ - define_property(#SymbolName, global_object.interpreter().well_known_symbol_##snake_name(), 0); + define_property(#SymbolName, global_object.vm().well_known_symbol_##snake_name(), 0); JS_ENUMERATE_WELL_KNOWN_SYMBOLS #undef __JS_ENUMERATE } @@ -78,7 +78,7 @@ JS_DEFINE_NATIVE_FUNCTION(SymbolConstructor::for_) description = interpreter.argument(0).to_string(interpreter); } - return interpreter.get_global_symbol(description); + return global_object.vm().get_global_symbol(description); } JS_DEFINE_NATIVE_FUNCTION(SymbolConstructor::key_for) -- cgit v1.2.3