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:
Ali Mohammad Pur 2021-08-09 02:55:01 +04:30 committed by Andreas Kling
commit 563b402f04
Notes: sideshowbarker 2024-07-18 07:04:11 +09:00
5 changed files with 662 additions and 357 deletions

View file

@ -40,6 +40,12 @@ protected:
void store_to_memory(Configuration&, Instruction const&, ReadonlyBytes data);
void call_address(Configuration&, FunctionAddress);
template<typename PopType, typename PushType, typename Operator>
void binary_numeric_operation(Configuration&);
template<typename PopType, typename PushType, typename Operator>
void unary_operation(Configuration&);
template<typename V, typename T>
MakeUnsigned<T> checked_unsigned_truncate(V);