From: Jean Privat Date: Mon, 19 Aug 2019 18:43:04 +0000 (-0400) Subject: Merge: compiler: Refactored `AbstractRuntimeFunction` X-Git-Url: http://nitlanguage.org Merge: compiler: Refactored `AbstractRuntimeFunction` 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. Signed-off-by: Louis-Vincent Boudreault Pull-Request: #2782 --- 7491f5b1d5910bc3030b42234885615acef8e98f