diff --git a/Userland/Libraries/LibJS/Runtime/VM.cpp b/Userland/Libraries/LibJS/Runtime/VM.cpp index 8d723ba4b41..f36f56ad889 100644 --- a/Userland/Libraries/LibJS/Runtime/VM.cpp +++ b/Userland/Libraries/LibJS/Runtime/VM.cpp @@ -219,28 +219,6 @@ void VM::gather_roots(HashMap& roots) roots.set(job, HeapRoot { .type = HeapRoot::Type::VM }); } -ThrowCompletionOr VM::execute_ast_node(ASTNode const& node) -{ - // FIXME: This function should be gone once we will emit bytecode for everything before executing instructions. - - auto executable = TRY(Bytecode::compile(*this, node, FunctionKind::Normal, ""sv)); - auto& running_execution_context = this->running_execution_context(); - - // Registers have to be saved and restored because executable for compiled ASTNode does not have its own execution context - auto saved_registers = running_execution_context.registers; - for (size_t i = 0; i < saved_registers.size(); ++i) - running_execution_context.registers[i] = {}; - - auto result_or_error = bytecode_interpreter().run_executable(*executable, {}); - - for (size_t i = 0; i < saved_registers.size(); ++i) - running_execution_context.registers[i] = saved_registers[i]; - - if (result_or_error.value.is_error()) - return result_or_error.value.release_error(); - return result_or_error.return_register_value; -} - // 9.1.2.1 GetIdentifierReference ( env, name, strict ), https://tc39.es/ecma262/#sec-getidentifierreference ThrowCompletionOr VM::get_identifier_reference(Environment* environment, DeprecatedFlyString name, bool strict, size_t hops) { diff --git a/Userland/Libraries/LibJS/Runtime/VM.h b/Userland/Libraries/LibJS/Runtime/VM.h index 8afaf0ee4e6..a9aa1b08ae9 100644 --- a/Userland/Libraries/LibJS/Runtime/VM.h +++ b/Userland/Libraries/LibJS/Runtime/VM.h @@ -258,10 +258,6 @@ public: Function(Object&)> host_ensure_can_add_private_element; Function(ArrayBuffer&, size_t)> host_resize_array_buffer; - // Execute a specific AST node either in AST or BC interpreter, depending on which one is enabled by default. - // NOTE: This is meant as a temporary stopgap until everything is bytecode. - ThrowCompletionOr execute_ast_node(ASTNode const&); - Vector stack_trace() const; private: