mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 18:37:35 +00:00
LibJS: Mark classes and virtual functions final
where possible
These cases were found with GCC's `-Wsuggest-final-{types,methods}` warnings, which catch calls that could have been devirtualized had we declared the functions `final` in the source. To reproduce, Link Time Optimization needs to be enabled. The easiest way to achieve this is to set the `CMAKE_INTERPROCEDURAL_OPTIMIZATION` cache variable to `ON`. The `.incbin` directive in LibCompress' Brotli decompressor might needs to be changed to an absolute path for this to work. This commit also removes a pair of unused virtual functions.
This commit is contained in:
parent
72c9f56c66
commit
65232b6681
9 changed files with 17 additions and 20 deletions
|
@ -27,8 +27,8 @@ class CyclicModule : public Module {
|
|||
public:
|
||||
// Note: Do not call these methods directly unless you are HostResolveImportedModule.
|
||||
// Badges cannot be used because other hosts must be able to call this (and it is called recursively)
|
||||
virtual ThrowCompletionOr<void> link(VM& vm) override;
|
||||
virtual ThrowCompletionOr<Promise*> evaluate(VM& vm) override;
|
||||
virtual ThrowCompletionOr<void> link(VM& vm) override final;
|
||||
virtual ThrowCompletionOr<Promise*> evaluate(VM& vm) override final;
|
||||
|
||||
Vector<ModuleRequest> const& requested_modules() const { return m_requested_modules; }
|
||||
|
||||
|
@ -37,8 +37,8 @@ protected:
|
|||
|
||||
virtual void visit_edges(Cell::Visitor&) override;
|
||||
|
||||
virtual ThrowCompletionOr<u32> inner_module_linking(VM& vm, Vector<Module*>& stack, u32 index) override;
|
||||
virtual ThrowCompletionOr<u32> inner_module_evaluation(VM& vm, Vector<Module*>& stack, u32 index) override;
|
||||
virtual ThrowCompletionOr<u32> inner_module_linking(VM& vm, Vector<Module*>& stack, u32 index) override final;
|
||||
virtual ThrowCompletionOr<u32> inner_module_evaluation(VM& vm, Vector<Module*>& stack, u32 index) override final;
|
||||
|
||||
virtual ThrowCompletionOr<void> initialize_environment(VM& vm);
|
||||
virtual ThrowCompletionOr<void> execute_module(VM& vm, GCPtr<PromiseCapability> capability = {});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue