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