LibWasm: ALWAYS_INLINE some very hot functions

These function couldn't be inlined before because the compiler would've
started flagging invalid paths in Variant as maybe-uninitialized.
This commit is contained in:
Ali Mohammad Pur 2021-06-09 20:31:07 +04:30 committed by Ali Mohammad Pur
parent d3db45c60b
commit aa2916c21b
Notes: sideshowbarker 2024-07-18 12:31:48 +09:00
3 changed files with 17 additions and 14 deletions

View file

@ -457,6 +457,9 @@ void Linker::link(HashMap<Linker::Name, ExternValue> const& exports)
if (m_unresolved_imports.is_empty())
return;
if (exports.is_empty())
return;
HashTable<Name> resolved_imports;
for (auto& import_ : m_unresolved_imports) {
auto export_ = exports.get(import_);

View file

@ -472,10 +472,10 @@ public:
Stack() = default;
[[nodiscard]] ALWAYS_INLINE bool is_empty() const { return m_data.is_empty(); }
FLATTEN void push(EntryType entry) { m_data.append(move(entry)); }
FLATTEN auto pop() { return m_data.take_last(); }
FLATTEN auto& peek() const { return m_data.last(); }
FLATTEN auto& peek() { return m_data.last(); }
ALWAYS_INLINE void push(EntryType entry) { m_data.append(move(entry)); }
ALWAYS_INLINE auto pop() { return m_data.take_last(); }
ALWAYS_INLINE auto& peek() const { return m_data.last(); }
ALWAYS_INLINE auto& peek() { return m_data.last(); }
ALWAYS_INLINE auto size() const { return m_data.size(); }
ALWAYS_INLINE auto& entries() const { return m_data; }

View file

@ -25,16 +25,16 @@ public:
m_stack.push(move(frame));
m_stack.push(label);
}
auto& frame() const { return m_stack.entries()[m_current_frame_index].get<Frame>(); }
auto& frame() { return m_stack.entries()[m_current_frame_index].get<Frame>(); }
auto& ip() const { return m_ip; }
auto& ip() { return m_ip; }
auto& depth() const { return m_depth; }
auto& depth() { return m_depth; }
auto& stack() const { return m_stack; }
auto& stack() { return m_stack; }
auto& store() const { return m_store; }
auto& store() { return m_store; }
ALWAYS_INLINE auto& frame() const { return m_stack.entries()[m_current_frame_index].get<Frame>(); }
ALWAYS_INLINE auto& frame() { return m_stack.entries()[m_current_frame_index].get<Frame>(); }
ALWAYS_INLINE auto& ip() const { return m_ip; }
ALWAYS_INLINE auto& ip() { return m_ip; }
ALWAYS_INLINE auto& depth() const { return m_depth; }
ALWAYS_INLINE auto& depth() { return m_depth; }
ALWAYS_INLINE auto& stack() const { return m_stack; }
ALWAYS_INLINE auto& stack() { return m_stack; }
ALWAYS_INLINE auto& store() const { return m_store; }
ALWAYS_INLINE auto& store() { return m_store; }
struct CallFrameHandle {
explicit CallFrameHandle(Configuration& configuration)