mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-28 10:37:17 +02:00
LibJS: Stop worrying about Instruction destructors
By adding static_asserts to prove that all of our generated instruction classes are trivially destructible, we can confidently remove the destructor walk in BasicBlock and save ourselves some unnecessary work.
This commit is contained in:
committed by
Andreas Kling
parent
370b81f1b7
commit
f37063e2a1
Notes:
github-actions[bot]
2025-11-21 08:47:34 +00:00
Author: https://github.com/awesomekling Commit: https://github.com/LadybirdBrowser/ladybird/commit/f37063e2a13 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6888
@@ -21,15 +21,7 @@ BasicBlock::BasicBlock(u32 index, String name)
|
||||
{
|
||||
}
|
||||
|
||||
BasicBlock::~BasicBlock()
|
||||
{
|
||||
Bytecode::InstructionStreamIterator it(instruction_stream());
|
||||
while (!it.at_end()) {
|
||||
auto& to_destroy = (*it);
|
||||
++it;
|
||||
Instruction::destroy(const_cast<Instruction&>(to_destroy));
|
||||
}
|
||||
}
|
||||
BasicBlock::~BasicBlock() = default;
|
||||
|
||||
void BasicBlock::grow(size_t additional_size)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user