Return value placement and tail call optimization in high level languages

被引:3
作者
Bigot, PA [1 ]
Debray, S [1 ]
机构
[1] Univ Arizona, Dept Comp Sci, Tucson, AZ 85721 USA
来源
JOURNAL OF LOGIC PROGRAMMING | 1999年 / 38卷 / 01期
基金
美国国家科学基金会;
关键词
implementation; optimization; tail call;
D O I
10.1016/S0743-1066(98)80001-0
中图分类号
TP301 [理论、方法];
学科分类号
081202 ;
摘要
This paper discusses the interaction between tail call optimization and the placement of output values in functional and logic programming languages. Implementations of such languages typically rely on fixed placement policies: most functional language implementations return output values in registers, while most logic programming systems return outputs via memory. Such fixed placement policies incur unnecessary overheads in many commonly encountered situations: the former an unable to implement many intuitively iterative computations in a truly iterative manner, while the latter incur a performance penalty due to additional memory references. We describe an approach that determines, based on a low-level cost model for an implementation together with an estimated execution profile for a program, whether or not the output of a procedure should be returned in registers or in memory. This can be seen as realizing a restricted form of inter-procedural register allocation, and avoids the disadvantages associated with the fixed register and fixed memory output placement policies. Experimental results indicate that it provides good performance improvements compared to existing approaches. (C) 1999 Elsevier Science Inc. All rights reserved.
引用
收藏
页码:1 / 29
页数:29
相关论文
共 21 条
[1]  
Appel A. W., 1992, LISP and Symbolic Computation, V5, P191, DOI 10.1007/BF01807505
[2]  
Appel Andrew W., 1992, Compiling with Continuations
[3]  
Ashley J. M., 1994, Proceedings of the 1994 ACM Conference on LISP and Functional Programming, P140, DOI 10.1145/182409.156784
[4]   THE OCCUR-CHECK PROBLEM REVISITED [J].
BEER, J .
JOURNAL OF LOGIC PROGRAMMING, 1988, 5 (03) :243-261
[5]  
BIGOT PA, 1994, 9403 U AR DEP COMP S
[6]  
BROOKS RA, 1982, P ACM S LISP FUNCT P, P108
[7]  
CHENG P, 1996, UNPUB DESTINATION PA
[8]  
Clinger W. D., 1994, Proceedings of the 1994 ACM Conference on LISP and Functional Programming, P128, DOI 10.1145/182409.156786
[9]   Detection and optimization of suspension-free logic programs [J].
Debray, S ;
Gudeman, D ;
Bigot, P .
JOURNAL OF LOGIC PROGRAMMING, 1996, 29 (1-3) :171-194
[10]  
GUDEMAN D, 1992, P JOINT INT C S LOG, P399