CW 510

Bart Demoen, Phuong-Lan Nguyen
Environment reuse in the WAM

Abstract

The WAM passes arguments to predicate calls in registers. The TOAM pushes arguments to predicate calls onto the execution stack. The WAM compiles clauses at a time. The TOAM treats a predicate as the compilation unit. These differences boil down to reuse of argument registers versus reuse of stack frames. In the TOAM, the environment reuse comes together with eager environment creation, while the WAM creates environments lazily. This warrants further investigation. The tak/4 benchmark is used as an inital case study for better understanding what one can expect from environment reuse for deterministic predicates. Additionally, artificial programs are used to amplify the findings. The experiment shows the relative merit of reusing an environment versus avoiding to create it: the latter seems a superior technique. The expected performance gain is related to the form of the program and the determinism of its predicates.

report.pdf (197K) / mailto: B. Demoen