summaryrefslogtreecommitdiff
path: root/Libraries/LibJS/Runtime/SymbolConstructor.cpp
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-09-22 16:18:51 +0200
committerAndreas Kling <kling@serenityos.org>2020-09-22 20:10:20 +0200
commitd1b58ee9adb5a0c0f6670767bde1ae9854d0cf2d (patch)
treec7ec6829aed334cc364d893f510849507381361a /Libraries/LibJS/Runtime/SymbolConstructor.cpp
parent676cb87a8f767577260b6088cdb443ed4733016e (diff)
downloadserenity-d1b58ee9adb5a0c0f6670767bde1ae9854d0cf2d.zip
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.
Diffstat (limited to 'Libraries/LibJS/Runtime/SymbolConstructor.cpp')
-rw-r--r--Libraries/LibJS/Runtime/SymbolConstructor.cpp4
1 files changed, 2 insertions, 2 deletions
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)