|
x-engine-c v0.2.13
The C engine for x-lang
|
The environment save and restore around a tail call. More...
Functions | |
| x_obj_t * | x_tco_env_save (x_obj_t *p_base) |
| void | x_tco_restore (x_obj_t *p_base, x_obj_t *p_env) |
The environment save and restore around a tail call.
Push the current environment onto the save-stack and return it.
A procedure call and eval-with-env snapshot the environment this way before making another one current; the trampoline, or x_eval_body_tco's early exits, put it back with x_tco_restore(). The environment is a value, so the snapshot is the pointer and nothing else – there is no boundary, tree or shadow list to carry beside it.
| p_base | x_obj_t* – Base (execution context) |
Make p_env the current environment.
Does NOT touch the save-stack – a caller that took the environment from the save-stack top pops it separately. This is the single restore used by both trampoline exit points (x_eval, x_eval_tco_trampoline), x_eval_body_tco's early-exit paths, eval-with-env, and the operative return.
| p_base | x_obj_t* – Base (execution context) |
| p_env | x_obj_t* – The environment to make current |