Instruction merging and specialization in the SICStus Prolog virtual machine

Wanting to improve execution speed and reduce code size of SICStus Prolog programs, we embarked on a project whose aim was to systematically investigate combination and specialization of WAM instructions. Various variants of the SICStus Prolog virtual machine instruction set were designed, implemented, and their performance was evaluated against standard benchmarks and on big Prolog programs. In this paper, we describe our methodology in finding appropriate candicates for instruction merging and specialization, discuss related trade-offs, present detailed statistics and performance measurements that we gathered, and report on our experiences from our involvement in this feat. In short, our experience is positiv e: the speedup of performing instruction merging and specialization in the context of the SICStus emulator is approximately 10%, while the bytecode size reduction is about 15%.

[1]  Vítor Santos Costa,et al.  Optimising Bytecode Emulation for Prolog , 1999, PPDP.

[2]  Christopher W. Fraser,et al.  Analyzing and compressing assembly code , 1984, SIGPLAN '84.

[3]  James R. Bell,et al.  Threaded code , 1973, CACM.

[4]  M. Anton Ertl,et al.  Stack caching for interpreters , 1995, PLDI '95.

[5]  Eliot Miranda BrouHaHa- A portable Smalltalk interpreter , 1987, OOPSLA 1987.

[6]  Peter Van Roy,et al.  The Wonder Years of Sequential Prolog Implementation , 1996 .

[7]  Peter Van Roy,et al.  1983-1993: The Wonder Years of Sequential Prolog Implementation , 1994, J. Log. Program..

[8]  Todd A. Proebsting Optimizing an ANSI C interpreter with superoperators , 1995, POPL '95.

[9]  Henrik Nässén Optimizing the SICStus Prolog virtual machine instruction set , 2001 .

[10]  Xavier Leroy The objective caml system release 3 , 2001 .

[11]  Christian Holzbaur,et al.  Metastructures versus Attributed Variables in the Context of Extensible Unification , 1992, PLILP.

[12]  Eliot Miranda BrouHaHa - A Portable Smalltalk Interpreter , 1987, OOPSLA.

[13]  Bart Demoen,et al.  So Many WAM Variations, So Little Time , 2000, Computational Logic.

[14]  Ian Piumarta,et al.  Optimizing direct threaded code by selective inlining , 1998, PLDI 1998.

[15]  Mats Carlsson,et al.  Garbage Collection for Prolog Based on WAM (Revised version) , 1986 .

[16]  Peter Van Roy,et al.  High-performance logic programming with the Aquarius Prolog compiler , 1992, Computer.

[17]  Bart Demoen,et al.  On the impact of argument passing on the performance of the WAM and B-Prolog , 2000 .

[18]  Hassan Aït-Kaci,et al.  Warren's Abstract Machine: A Tutorial Reconstruction , 1991 .