feat(tvix/eval): track span of first force in a thunk blackhole
This is step 1 towards being able to use all 4 spans that we know when dealing with infinite recursion. It tracks the span at which the force of a thunk was first requested when constructing a blackhole, so that we can highlight the spans of the first and second forces. These are actually the least relevant spans, but the easiest to put in place, more coming soon. Change-Id: I4c7e82f6211b98756439d4148a4191457cc46807 Reviewed-on: https://cl.tvl.fyi/c/depot/+/8269 Autosubmit: tazjin <tazjin@tvl.su> Tested-by: BuildkiteCI Reviewed-by: flokli <flokli@flokli.de>
This commit is contained in:
		
							parent
							
								
									5095e4f269
								
							
						
					
					
						commit
						3fa6b13c1e
					
				
					 5 changed files with 48 additions and 17 deletions
				
			
		|  | @ -293,7 +293,9 @@ impl<'o> VM<'o> { | |||
|                         // back to the outer VM loop.
 | ||||
|                         VMRequest::ForceValue(value) => { | ||||
|                             self.reenqueue_generator(name, span.clone(), generator); | ||||
|                             self.enqueue_generator("force", span, |co| value.force(co)); | ||||
|                             self.enqueue_generator("force", span.clone(), |co| { | ||||
|                                 value.force(co, span) | ||||
|                             }); | ||||
|                             return Ok(false); | ||||
|                         } | ||||
| 
 | ||||
|  | @ -313,7 +315,9 @@ impl<'o> VM<'o> { | |||
|                             self.reenqueue_generator(name, span.clone(), generator); | ||||
| 
 | ||||
|                             let value = self.stack[self.with_stack[idx]].clone(); | ||||
|                             self.enqueue_generator("force", span, |co| value.force(co)); | ||||
|                             self.enqueue_generator("force", span.clone(), |co| { | ||||
|                                 value.force(co, span) | ||||
|                             }); | ||||
| 
 | ||||
|                             return Ok(false); | ||||
|                         } | ||||
|  | @ -328,7 +332,9 @@ impl<'o> VM<'o> { | |||
|                                 .expect("Tvix bug: generator requested captured with-value, but there is no call frame"); | ||||
| 
 | ||||
|                             let value = call_frame.upvalues.with_stack().unwrap()[idx].clone(); | ||||
|                             self.enqueue_generator("force", span, |co| value.force(co)); | ||||
|                             self.enqueue_generator("force", span.clone(), |co| { | ||||
|                                 value.force(co, span) | ||||
|                             }); | ||||
| 
 | ||||
|                             return Ok(false); | ||||
|                         } | ||||
|  | @ -441,7 +447,9 @@ impl<'o> VM<'o> { | |||
|                                 "generator should be reenqueued with the same frame ID" | ||||
|                             ); | ||||
| 
 | ||||
|                             self.enqueue_generator("force", span, |co| value.force(co)); | ||||
|                             self.enqueue_generator("force", span.clone(), |co| { | ||||
|                                 value.force(co, span) | ||||
|                             }); | ||||
|                             return Ok(false); | ||||
|                         } | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue