Selaa lähdekoodia

LibJS: Remove unused members from EnterUnwindContext instruction

Andreas Kling 1 vuosi sitten
vanhempi
commit
298dfa96a4

+ 1 - 1
Userland/Libraries/LibJS/Bytecode/ASTCodegen.cpp

@@ -2397,7 +2397,7 @@ Bytecode::CodeGenerationErrorOr<void> TryStatement::generate_bytecode(Bytecode::
 
     auto& target_block = generator.make_block();
     generator.switch_to_basic_block(saved_block);
-    generator.emit<Bytecode::Op::EnterUnwindContext>(Bytecode::Label { target_block }, handler_target, finalizer_target);
+    generator.emit<Bytecode::Op::EnterUnwindContext>(Bytecode::Label { target_block });
     generator.start_boundary(Bytecode::Generator::BlockBoundaryType::Unwind);
     if (m_finalizer)
         generator.start_boundary(Bytecode::Generator::BlockBoundaryType::ReturnToFinally);

+ 1 - 3
Userland/Libraries/LibJS/Bytecode/Interpreter.cpp

@@ -1572,9 +1572,7 @@ DeprecatedString ThrowIfNullish::to_deprecated_string_impl(Bytecode::Executable
 
 DeprecatedString EnterUnwindContext::to_deprecated_string_impl(Bytecode::Executable const&) const
 {
-    auto handler_string = m_handler_target.has_value() ? DeprecatedString::formatted("{}", *m_handler_target) : "<empty>";
-    auto finalizer_string = m_finalizer_target.has_value() ? DeprecatedString::formatted("{}", *m_finalizer_target) : "<empty>";
-    return DeprecatedString::formatted("EnterUnwindContext handler:{} finalizer:{} entry:{}", handler_string, finalizer_string, m_entry_point);
+    return DeprecatedString::formatted("EnterUnwindContext entry:{}", m_entry_point);
 }
 
 DeprecatedString ScheduleJump::to_deprecated_string_impl(Bytecode::Executable const&) const

+ 1 - 7
Userland/Libraries/LibJS/Bytecode/Op.h

@@ -1192,11 +1192,9 @@ class EnterUnwindContext final : public Instruction {
 public:
     constexpr static bool IsTerminator = true;
 
-    EnterUnwindContext(Label entry_point, Optional<Label> handler_target, Optional<Label> finalizer_target)
+    EnterUnwindContext(Label entry_point)
         : Instruction(Type::EnterUnwindContext, sizeof(*this))
         , m_entry_point(move(entry_point))
-        , m_handler_target(move(handler_target))
-        , m_finalizer_target(move(finalizer_target))
     {
     }
 
@@ -1204,13 +1202,9 @@ public:
     DeprecatedString to_deprecated_string_impl(Bytecode::Executable const&) const;
 
     auto& entry_point() const { return m_entry_point; }
-    auto& handler_target() const { return m_handler_target; }
-    auto& finalizer_target() const { return m_finalizer_target; }
 
 private:
     Label m_entry_point;
-    Optional<Label> m_handler_target;
-    Optional<Label> m_finalizer_target;
 };
 
 class ScheduleJump final : public Instruction {