1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-19 00:55:08 +00:00
serenity/Userland/Libraries/LibWeb/HTML/Scripting
Daniel Bertalan 9feb1ce39f LibJS+LibWeb: Apply the Rule of Zero to {Nonnull,}GCPtr<T>
The compiler-generated copy constructor and copy assignment operator
already do the right thing (which is to simply copy the underlying
pointer).

The [Itanium C++ ABI][1] treats any class with non-trivial copy/move
constructors and destructors as non-trivial for the purposes of calls --
even if they are functionally identical to the compiler-generated ones.
If a class is non-trivial, it cannot be passed or returned in registers,
only via an invisible reference, which is worse for codegen. This commit
makes `{Nonnull,}GCPtr` trivial.

As the compiler can be sure that capturing a `GCPtr` by value has no
side effects, a few `-Wunused-lambda-capture` warnings had to be
addressed in LibWeb.

GCC seems to have a bug that prevents `ExceptionOr<Variant<GCPtr<T>>>`
from being implicitly constructed from `GCPtr<T>` after this change. A
non-invasive workaround is to explicitly construct the inner Variant
type.

[1]: https://itanium-cxx-abi.github.io/cxx-abi/abi.html#non-trivial
2023-08-07 22:20:03 -04:00
..
ClassicScript.cpp LibJS/Bytecode: Simplify Bytecode::Interpreter lifetime model 2023-06-22 21:16:17 +02:00
ClassicScript.h LibWeb: Implement the "error to rethrow" mechanism in HTML::Script 2023-05-19 06:20:14 +02:00
Environments.cpp LibWeb: Make module maps GC-allocated 2023-05-04 11:56:55 +02:00
Environments.h LibWeb+LibJS: Move some code around to make CSS/Parser parse faster 2023-07-11 09:38:37 +03:30
ExceptionReporter.cpp LibJS: Make Error stack traces lazier 2023-05-28 10:03:11 +02:00
ExceptionReporter.h WebContent+LibWeb+LibJS: Report exceptions to the JS console 2022-10-15 01:25:12 +02:00
Fetching.cpp LibJS+LibWeb: Apply the Rule of Zero to {Nonnull,}GCPtr<T> 2023-08-07 22:20:03 -04:00
Fetching.h Everywhere: Remove needless trailing semi-colons after functions 2023-07-08 10:32:56 +01:00
ImportMap.h AK+Everywhere: Rename String to DeprecatedString 2022-12-06 08:54:33 +01:00
ModuleMap.cpp LibWeb: Make module maps GC-allocated 2023-05-04 11:56:55 +02:00
ModuleMap.h Everywhere: Remove needless trailing semi-colons after functions 2023-07-08 10:32:56 +01:00
ModuleScript.cpp LibWeb: Implement the "error to rethrow" mechanism in HTML::Script 2023-05-19 06:20:14 +02:00
ModuleScript.h Everywhere: Remove needless trailing semi-colons after functions 2023-07-08 10:32:56 +01:00
Script.cpp LibWeb: Implement the "error to rethrow" mechanism in HTML::Script 2023-05-19 06:20:14 +02:00
Script.h LibWeb: Implement the "error to rethrow" mechanism in HTML::Script 2023-05-19 06:20:14 +02:00
TemporaryExecutionContext.cpp LibWeb: Add a helper class to work around empty execution context stack 2023-07-06 15:18:50 -04:00
TemporaryExecutionContext.h LibWeb: Add a helper class to work around empty execution context stack 2023-07-06 15:18:50 -04:00
WindowEnvironmentSettingsObject.cpp LibJS+LibWeb: Normalize calls to Base::visit_edges in GC objects 2023-04-30 06:04:33 +02:00
WindowEnvironmentSettingsObject.h LibWeb: Make factory method of HTML::BrowsingContext fallible 2023-02-22 09:55:33 +01:00
WorkerEnvironmentSettingsObject.h LibJS+LibWeb: Wrap raw JS::Cell*/& fields in GCPtr/NonnullGCPtr 2023-03-15 08:48:49 +01:00