DavidKinder / Git

Fast Glulx interpreter, originally written by Iain Merrick.
MIT License
45 stars 13 forks source link

Possible speed-up for accelerated functions #22

Open DavidKinder opened 1 month ago

DavidKinder commented 1 month ago

At the moment, accelerated functions are dealt with by checking (at the label do_enter_function_L1) if L1 contains the address of an accelerated function, and calling it if it is. This certainly works, but it does mean that the call to look up the accelerated function (accel_get_func()) occurs every time the call to the function is executed.

However, if the function address is a constant, it ought to be better to move this into Git's JIT logic and directly call the accelerated function. Testing would be needed to determine if this produced a noticable improvement or not. It would also mean that the accelfunc opcode would need to flush the git code cache when called.