Representing control in the presence of first-class continuations
Representing control in the presence of first-class continuations
复制标题
代表存在一流延续的控制
DOI:
--
复制
发表时间:
1990
期刊:
影响因子:
--
通讯作者:
Carl Bruggeman
中科院分区:
文献类型:
--
作者:
Robert Hieb;R. Dybvig;Carl Bruggeman
Languages such as Scheme and Smalltalk that provide continuations as first-class data objects present a challenge to efficient implementation. Allocating activation records in a heap has proven unsatisfactory because of increased frame linkage costs, increased garbage collection overhead, and decreased locality of reference. However, simply allocating activation records on a stack and copying them when a continuation is created results in unbounded copying overhead. This paper describes a new approach based on stack allocation that does not require the stack to be copied when a continuation is created and that allows us to place a small upper bound on the amount copied when a continuation is reinstated. This new approach is faster than the naive stack allocation approach, and it does not suffer from the problems associated with unbounded copying. For continuation-intensive programs, our approach is at worst a constant factor slower than the heap allocation approach, and for typical programs, it is significantly faster. An important additional benefit is that recovery from stack overflow is handled gracefully and efficiently.