refactor(tvix/eval): search-and-replace changes

This commit contains two search-and-replace renames which are broken
out from I04131501029772f30e28da8281d864427685097f in order to
reduce the noise in that CL:

- `is_thunk -> is_suspended_thunk`, since there are now
  OpThunkClosure and OpThunkSuspended

- `compile_lambda_or_thunk` -> `compile_lambda_or_suspension`

Change-Id: I7cc5bbb75ef6605e3428c7be27e812f41a10c127
Signed-off-by: Adam Joseph <adam@westernsemico.com>
Reviewed-on: https://cl.tvl.fyi/c/depot/+/7037
Reviewed-by: tazjin <tazjin@tvl.su>
Tested-by: BuildkiteCI
This commit is contained in:
Adam Joseph 2022-10-18 00:48:19 -07:00
parent 8616f13a71
commit 4d83fd84b4

View file

@ -898,7 +898,7 @@ impl Compiler<'_> {
/// Compile an expression into a runtime cloure or thunk
fn compile_lambda_or_thunk<N, F>(
&mut self,
is_thunk: bool,
is_suspended_thunk: bool,
outer_slot: LocalIdx,
node: &N,
content: F,
@ -936,7 +936,7 @@ impl Compiler<'_> {
}
let lambda = Rc::new(compiled.lambda);
if is_thunk {
if is_suspended_thunk {
self.observer.observe_compiled_thunk(&lambda);
} else {
self.observer.observe_compiled_lambda(&lambda);
@ -945,7 +945,7 @@ impl Compiler<'_> {
// If no upvalues are captured, emit directly and move on.
if lambda.upvalue_count == 0 {
self.emit_constant(
if is_thunk {
if is_suspended_thunk {
Value::Thunk(Thunk::new_suspended(lambda, span))
} else {
Value::Closure(Closure::new(lambda))
@ -962,7 +962,7 @@ impl Compiler<'_> {
let blueprint_idx = self.chunk().push_constant(Value::Blueprint(lambda));
let code_idx = self.push_op(
if is_thunk {
if is_suspended_thunk {
OpCode::OpThunkSuspended(blueprint_idx)
} else {
OpCode::OpThunkClosure(blueprint_idx)
@ -977,7 +977,7 @@ impl Compiler<'_> {
compiled.captures_with_stack,
);
if !is_thunk && !self.scope()[outer_slot].needs_finaliser {
if !is_suspended_thunk && !self.scope()[outer_slot].needs_finaliser {
if !self.scope()[outer_slot].must_thunk {
// The closure has upvalues, but is not recursive. Therefore no thunk is required,
// which saves us the overhead of Rc<RefCell<>>