mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-25 17:25:08 +02:00
LibWasm: Give some inline capacity to the frame and label stacks
The average wasm function rarely goes over these bounds for the labels (32 nested control structures), and 8 frames is just enough to clear most initialization code/start section without allocating anything.
This commit is contained in:
committed by
Ali Mohammad Pur
parent
bf4c436ef3
commit
931b554f68
Notes:
github-actions[bot]
2025-08-08 10:56:39 +00:00
Author: https://github.com/alimpfard Commit: https://github.com/LadybirdBrowser/ladybird/commit/931b554f682 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5060 Reviewed-by: https://github.com/Hendiadyoin1 Reviewed-by: https://github.com/R-Goc Reviewed-by: https://github.com/awesomekling Reviewed-by: https://github.com/gmta
@@ -193,6 +193,7 @@ public:
|
||||
private:
|
||||
u128 m_value;
|
||||
};
|
||||
static_assert(IsTriviallyDestructible<Value>);
|
||||
|
||||
struct ExternallyManagedTrap {
|
||||
Array<u8, 64> data;
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace Wasm {
|
||||
|
||||
void Configuration::unwind(Badge<CallFrameHandle>, CallFrameHandle const& frame_handle)
|
||||
{
|
||||
auto frame = m_frame_stack.take_last();
|
||||
m_frame_stack.take_last();
|
||||
m_depth--;
|
||||
m_ip = frame_handle.ip;
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <AK/DoublyLinkedList.h>
|
||||
#include <LibWasm/AbstractMachine/AbstractMachine.h>
|
||||
|
||||
namespace Wasm {
|
||||
@@ -68,8 +69,8 @@ public:
|
||||
private:
|
||||
Store& m_store;
|
||||
Vector<Value> m_value_stack;
|
||||
Vector<Label> m_label_stack;
|
||||
Vector<Frame> m_frame_stack;
|
||||
DoublyLinkedList<Label, 32> m_label_stack;
|
||||
DoublyLinkedList<Frame, 32> m_frame_stack;
|
||||
size_t m_depth { 0 };
|
||||
InstructionPointer m_ip;
|
||||
bool m_should_limit_instruction_count { false };
|
||||
|
||||
Reference in New Issue
Block a user