mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 06:07:34 +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:
parent
799471d16f
commit
563b402f04
5 changed files with 662 additions and 357 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue