1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 15:47:45 +00:00

LibJS: Move AST node stack from VM to Interpreter

This commit is contained in:
Andreas Kling 2021-03-21 12:18:56 +01:00
parent b3b8c01ebf
commit 1603623772
7 changed files with 29 additions and 19 deletions

View file

@ -128,15 +128,10 @@ public:
void pop_call_frame() { m_call_stack.take_last(); }
void push_ast_node(const ASTNode& node) { m_ast_nodes.append(&node); }
void pop_ast_node() { m_ast_nodes.take_last(); }
CallFrame& call_frame() { return *m_call_stack.last(); }
const CallFrame& call_frame() const { return *m_call_stack.last(); }
const Vector<CallFrame*>& call_stack() const { return m_call_stack; }
Vector<CallFrame*>& call_stack() { return m_call_stack; }
const ASTNode* current_node() const { return !m_ast_nodes.is_empty() ? m_ast_nodes.last() : nullptr; }
const Vector<const ASTNode*>& node_stack() const { return m_ast_nodes; }
const ScopeObject* current_scope() const { return call_frame().scope; }
ScopeObject* current_scope() { return call_frame().scope; }
@ -256,7 +251,6 @@ private:
Vector<Interpreter*> m_interpreters;
Vector<CallFrame*> m_call_stack;
Vector<const ASTNode*> m_ast_nodes;
Value m_last_value;
ScopeType m_unwind_until { ScopeType::None };