From d22a06d6717331bd1eeda6e15462bef5c9aec3f9 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Tue, 14 May 2024 11:35:41 +0200 Subject: [PATCH] LibJS/Bytecode: Remove all the unreachable execute_impl() functions There are no calls to these anywhere anymore. --- .../Libraries/LibJS/Bytecode/Interpreter.cpp | 78 ------------------- Userland/Libraries/LibJS/Bytecode/Op.h | 13 ---- 2 files changed, 91 deletions(-) diff --git a/Userland/Libraries/LibJS/Bytecode/Interpreter.cpp b/Userland/Libraries/LibJS/Bytecode/Interpreter.cpp index b046e127b30..3381d1e87e9 100644 --- a/Userland/Libraries/LibJS/Bytecode/Interpreter.cpp +++ b/Userland/Libraries/LibJS/Bytecode/Interpreter.cpp @@ -866,12 +866,6 @@ void Dump::execute_impl(Bytecode::Interpreter& interpreter) const } } -ThrowCompletionOr End::execute_impl(Bytecode::Interpreter&) const -{ - // Handled in the interpreter loop. - __builtin_unreachable(); -} - #define JS_DEFINE_EXECUTE_FOR_COMMON_BINARY_OP(OpTitleCase, op_snake_case) \ ThrowCompletionOr OpTitleCase::execute_impl(Bytecode::Interpreter& interpreter) const \ { \ @@ -1433,18 +1427,6 @@ ThrowCompletionOr SetVariableBinding::execute_impl(Bytecode::Interpreter& return initialize_or_set_binding(interpreter, m_identifier, interpreter.get(m_src), m_cache); } -ThrowCompletionOr SetArgument::execute_impl(Bytecode::Interpreter&) const -{ - // Handled in the interpreter loop. - __builtin_unreachable(); -} - -ThrowCompletionOr GetArgument::execute_impl(Bytecode::Interpreter&) const -{ - // Handled in the interpreter loop. - __builtin_unreachable(); -} - ThrowCompletionOr GetById::execute_impl(Bytecode::Interpreter& interpreter) const { auto base_identifier = interpreter.current_executable().get_identifier(m_base_identifier); @@ -1543,12 +1525,6 @@ ThrowCompletionOr DeleteByIdWithThis::execute_impl(Bytecode::Interpreter& return {}; } -ThrowCompletionOr Jump::execute_impl(Bytecode::Interpreter&) const -{ - // Handled in the interpreter loop. - __builtin_unreachable(); -} - ThrowCompletionOr ResolveThisBinding::execute_impl(Bytecode::Interpreter& interpreter) const { auto& cached_this_value = interpreter.reg(Register::this_value()); @@ -1589,42 +1565,6 @@ void GetImportMeta::execute_impl(Bytecode::Interpreter& interpreter) const interpreter.set(dst(), interpreter.vm().get_import_meta()); } -ThrowCompletionOr JumpIf::execute_impl(Bytecode::Interpreter&) const -{ - // Handled in the interpreter loop. - __builtin_unreachable(); -} - -ThrowCompletionOr JumpTrue::execute_impl(Bytecode::Interpreter&) const -{ - // Handled in the interpreter loop. - __builtin_unreachable(); -} - -ThrowCompletionOr JumpFalse::execute_impl(Bytecode::Interpreter&) const -{ - // Handled in the interpreter loop. - __builtin_unreachable(); -} - -ThrowCompletionOr JumpUndefined::execute_impl(Bytecode::Interpreter&) const -{ - // Handled in the interpreter loop. - __builtin_unreachable(); -} - -ThrowCompletionOr JumpNullish::execute_impl(Bytecode::Interpreter&) const -{ - // Handled in the interpreter loop. - __builtin_unreachable(); -} - -ThrowCompletionOr Mov::execute_impl(Bytecode::Interpreter&) const -{ - // Handled in the interpreter loop. - __builtin_unreachable(); -} - static ThrowCompletionOr dispatch_builtin_call(Bytecode::Interpreter& interpreter, Bytecode::Builtin builtin, ReadonlySpan arguments) { switch (builtin) { @@ -1811,18 +1751,6 @@ ThrowCompletionOr ThrowIfTDZ::execute_impl(Bytecode::Interpreter& interpre return {}; } -ThrowCompletionOr EnterUnwindContext::execute_impl(Bytecode::Interpreter&) const -{ - // Handled in the interpreter loop. - __builtin_unreachable(); -} - -ThrowCompletionOr ScheduleJump::execute_impl(Bytecode::Interpreter&) const -{ - // Handled in the interpreter loop. - __builtin_unreachable(); -} - void LeaveLexicalEnvironment::execute_impl(Bytecode::Interpreter& interpreter) const { auto& running_execution_context = interpreter.running_execution_context(); @@ -1840,12 +1768,6 @@ void LeaveUnwindContext::execute_impl(Bytecode::Interpreter& interpreter) const interpreter.leave_unwind_context(); } -ThrowCompletionOr ContinuePendingUnwind::execute_impl(Bytecode::Interpreter&) const -{ - // Handled in the interpreter loop. - __builtin_unreachable(); -} - ThrowCompletionOr Yield::execute_impl(Bytecode::Interpreter& interpreter) const { auto yielded_value = interpreter.get(m_value).value_or(js_undefined()); diff --git a/Userland/Libraries/LibJS/Bytecode/Op.h b/Userland/Libraries/LibJS/Bytecode/Op.h index 15be6e3f9a9..5e5e06df949 100644 --- a/Userland/Libraries/LibJS/Bytecode/Op.h +++ b/Userland/Libraries/LibJS/Bytecode/Op.h @@ -84,7 +84,6 @@ public: { } - ThrowCompletionOr execute_impl(Bytecode::Interpreter&) const; ByteString to_byte_string_impl(Bytecode::Executable const&) const; void visit_operands_impl(Function visitor) { @@ -778,7 +777,6 @@ public: { } - ThrowCompletionOr execute_impl(Bytecode::Interpreter&) const; ByteString to_byte_string_impl(Bytecode::Executable const&) const; void visit_operands_impl(Function visitor) { @@ -802,7 +800,6 @@ public: { } - ThrowCompletionOr execute_impl(Bytecode::Interpreter&) const; ByteString to_byte_string_impl(Bytecode::Executable const&) const; void visit_operands_impl(Function visitor) { @@ -1430,7 +1427,6 @@ public: { } - ThrowCompletionOr execute_impl(Bytecode::Interpreter&) const; ByteString to_byte_string_impl(Bytecode::Executable const&) const; void visit_labels_impl(Function visitor) { @@ -1455,7 +1451,6 @@ public: { } - ThrowCompletionOr execute_impl(Bytecode::Interpreter&) const; ByteString to_byte_string_impl(Bytecode::Executable const&) const; void visit_labels_impl(Function visitor) { @@ -1488,7 +1483,6 @@ public: { } - ThrowCompletionOr execute_impl(Bytecode::Interpreter&) const; ByteString to_byte_string_impl(Bytecode::Executable const&) const; void visit_labels_impl(Function visitor) { @@ -1518,7 +1512,6 @@ public: { } - ThrowCompletionOr execute_impl(Bytecode::Interpreter&) const; ByteString to_byte_string_impl(Bytecode::Executable const&) const; void visit_labels_impl(Function visitor) { @@ -1600,7 +1593,6 @@ public: { } - ThrowCompletionOr execute_impl(Bytecode::Interpreter&) const; ByteString to_byte_string_impl(Bytecode::Executable const&) const; void visit_labels_impl(Function visitor) { @@ -1634,7 +1626,6 @@ public: { } - ThrowCompletionOr execute_impl(Bytecode::Interpreter&) const; ByteString to_byte_string_impl(Bytecode::Executable const&) const; void visit_labels_impl(Function visitor) { @@ -2095,7 +2086,6 @@ public: { } - ThrowCompletionOr execute_impl(Bytecode::Interpreter&) const; ByteString to_byte_string_impl(Bytecode::Executable const&) const; void visit_labels_impl(Function visitor) { @@ -2122,7 +2112,6 @@ public: Label target() const { return m_target; } - ThrowCompletionOr execute_impl(Bytecode::Interpreter&) const; ByteString to_byte_string_impl(Bytecode::Executable const&) const; void visit_labels_impl(Function visitor) { @@ -2176,7 +2165,6 @@ public: { } - ThrowCompletionOr execute_impl(Bytecode::Interpreter&) const; ByteString to_byte_string_impl(Bytecode::Executable const&) const; void visit_labels_impl(Function visitor) { @@ -2584,7 +2572,6 @@ public: { } - ThrowCompletionOr execute_impl(Bytecode::Interpreter&) const; ByteString to_byte_string_impl(Bytecode::Executable const&) const; void visit_operands_impl(Function visitor) {