summaryrefslogtreecommitdiff
path: root/Libraries/LibJS/Interpreter.h
diff options
context:
space:
mode:
authorMatthew Olsson <matthewcolsson@gmail.com>2020-07-06 16:57:22 -0700
committerAndreas Kling <kling@serenityos.org>2020-07-09 23:29:28 +0200
commitd9db6bec42783ed0b1cacb605575a8e4884dc904 (patch)
treedf5ac869230b9f6ea027115064b6d5e08f0e48a5 /Libraries/LibJS/Interpreter.h
parent4d8683b632161f6da702f1df75b1c507a7bef2ad (diff)
downloadserenity-d9db6bec42783ed0b1cacb605575a8e4884dc904.zip
LibJS: Move global symbol map from SymbolObject to Interpreter
This allows different instances of the Interpreter to have their own global symbols. Also makes Symbol non-copyable and non-moveable.
Diffstat (limited to 'Libraries/LibJS/Interpreter.h')
-rw-r--r--Libraries/LibJS/Interpreter.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/Libraries/LibJS/Interpreter.h b/Libraries/LibJS/Interpreter.h
index 950b40aa3b..442759af30 100644
--- a/Libraries/LibJS/Interpreter.h
+++ b/Libraries/LibJS/Interpreter.h
@@ -111,6 +111,10 @@ public:
Reference get_reference(const FlyString& name);
+ Symbol* get_global_symbol(const String& description);
+ Symbol* get_well_known_symbol(const String& description) const;
+ const HashMap<String, Symbol*>& get_well_known_symbol_map(Badge<SymbolConstructor>) const { return m_well_known_symbol_map; };
+
void gather_roots(Badge<Heap>, HashTable<Cell*>&);
void enter_scope(const ScopeNode&, ArgumentVector, ScopeType, GlobalObject&);
@@ -217,6 +221,9 @@ private:
Object* m_global_object { nullptr };
+ HashMap<String, Symbol*> m_well_known_symbol_map;
+ HashMap<String, Symbol*> m_global_symbol_map;
+
Exception* m_exception { nullptr };
ScopeType m_unwind_until { ScopeType::None };