mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 08:36:15 +00:00
LibWasm: Replace the numeric operation macros with templated functions
This should make debugging and profiling much better, at little to no runtime cost. Also moves off the operator definitions to a separate header, so it should also improve the editing experience quite a bit.
This commit is contained in:
committed by
Andreas Kling
parent
799471d16f
commit
563b402f04
@@ -10,13 +10,13 @@
|
||||
|
||||
namespace Wasm {
|
||||
|
||||
Optional<Label> Configuration::nth_label(size_t i)
|
||||
Optional<size_t> Configuration::nth_label_index(size_t i)
|
||||
{
|
||||
for (size_t index = m_stack.size(); index > 0; --index) {
|
||||
auto& entry = m_stack.entries()[index - 1];
|
||||
if (auto ptr = entry.get_pointer<Label>()) {
|
||||
if (entry.has<Label>()) {
|
||||
if (i == 0)
|
||||
return *ptr;
|
||||
return index - 1;
|
||||
--i;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user