Issue by Abhiroop
Friday Apr 30, 2021 at 09:57 GMT
Originally opened as svenssonjoel/Sense-VM#11
Currently, in the VM a combinator is represented on the heap using a dummy value
(combinator_label, 4294967295) // the dummy value is UINT_MAX
Represented here in the code: https://github.com/svenssonjoel/Sense-VM/blob/master/backend/src/CAM.c#L1110-L1115
Later when evaluating an APP bytecode a runtime check is done to determine if applying on a combinator or a closure done here: https://github.com/svenssonjoel/Sense-VM/blob/master/backend/src/CAM.c#L372-L418
This runtime check is expensive. Instead, we should try to generate an APPCOMB separate bytecode when applying a combinator to avoid the runtime check. The peephole optimisation should be extended to add rules with APPCOMB etc
Friday Apr 30, 2021 at 09:57 GMT
Originally opened as svenssonjoel/Sense-VM#11
Currently, in the VM a combinator is represented on the heap using a dummy value
Represented here in the code: https://github.com/svenssonjoel/Sense-VM/blob/master/backend/src/CAM.c#L1110-L1115
Later when evaluating an
APPbytecode a runtime check is done to determine if applying on a combinator or a closure done here: https://github.com/svenssonjoel/Sense-VM/blob/master/backend/src/CAM.c#L372-L418This runtime check is expensive. Instead, we should try to generate an
APPCOMBseparate bytecode when applying a combinator to avoid the runtime check. The peephole optimisation should be extended to add rules with APPCOMB etc