摘要 |
A system and method for accessing closure variables from a lambda expression in certain program configurations, in which the closure variable is accessed while the closure function is active and the closure variable is within an active runtime frame stack corresponding to an instance of the closure function. In response to entering the closure function, a pointer to each closure variable is stored in a stack pointer table. Each reference to each closure variable from the lambda expression is handled by using the closure variable pointer to locate the closure variable on the runtime stack. Program code may be instrumented to insert invocations to helper functions at locations upon entering the closure function and at each reference to each closure variable from the lambda expression.
|