Removed duplicate code across all the compiler and made
AbstractRuntimeFunction implement Template Design pattern.
This allows for better code reuse and easier customization.
Removed the notion of "virtual function" and unified it with the concept
of thunk function. A thunk is an intermediary function between a caller
and a callee whose purpose is to compute thing before or after the
callee gets invoke. Currently, the only usages of thunks are to do conversions (casting)
before calling the actual callee. Thunks can be created by inheriting
abstract_compiler::ThunkFunction which provides a default
implementation. Furthermore, this class simplify the old code of
SeparateRuntimeFunction by replacing if with actual polymorphism.
Finally, thunks will be used to implement callref mechanics.
Removed duplicate code across all the compiler and made
AbstractRuntimeFunction
implement Template Design pattern. This allows for better code reuse and easier customization.Removed the notion of "virtual function" and unified it with the concept of thunk function. A thunk is an intermediary function between a caller and a callee whose purpose is to compute thing before or after the callee gets invoke. Currently, the only usages of thunks are to do conversions (casting) before calling the actual callee. Thunks can be created by inheriting
abstract_compiler::ThunkFunction
which provides a default implementation. Furthermore, this class simplify the old code ofSeparateRuntimeFunction
by replacingif
with actual polymorphism.Finally, thunks will be used to implement callref mechanics.
Signed-off-by: Louis-Vincent Boudreault lv.boudreault95@gmail.com