[Patch] Homogenising all of the DebugMsg methods
Original Reporter info from Mantis: CuriousKit @CuriousKit
-
Reporter name: J. Gareth Moreton
Original Reporter info from Mantis: CuriousKit @CuriousKit
- Reporter name: J. Gareth Moreton
Description:
This patch modifies the jump optimisations and the peephole optimizers on all platforms to use a common DebugMsg method and the "SPeepholeOptimization" string constant for ease of maintenance (also for easier searching when analysing the assembly dumps).
Steps to reproduce:
Apply patch and confirm correct compilation, including "make fullcycle", "make fullcycle OPT=-dDEBUG_AOPTOBJ" and "make fullcycle OPT=-dDEBUG_AOPTCPU".
Additional information:
Currently tested successfully on i386-win32, x86_64-win64 and aarch64-linux.
- TAOptObj.DebugMsg was the version kept, as it is a common ancestor of all optimisation classes, and was changed from private to protected.
- DebugMsg is only functional if DEBUG_AOPTOBJ or DEBUG_AOPTCPU is defined, otherwise it is an empty, inlined procedure.
- SPeepholeOptimization is now declared in the "aasmbase" unit, and is an empty string unless DEBUG_AOPTOBJ or DEBUG_AOPTCPU is defined (this aids optimisation on release builds by stripping out unnecessary string concatenations).
- Notably, with this definition, the debug messages for the cross-platform jump optimisations are now inserted when DEBUG_AOPTCPU is defined (before, they wouldn't appear because the DebugMsg method in question was only functional if DEBUG_AOPTOBJ was defined).
Mantis conversion info:
- Mantis ID: 38405
- OS: LInux (Raspberry Pi OS)
- OS Build: 5.4.51-v8+
- Build: r48428
- Platform: Cross-platform
- Version: 3.3.1