Unverified Commit cab08e5b authored by Tobias Koppers's avatar Tobias Koppers Committed by GitHub

Turbopack: handle non-serializable cell content for cell update operation (#86861)

### What?

A `TypedSharedReference` might not be serializable, so we might not be able to serialize the UpdateCellOperation. This avoids the suspend points while we store non-serializable content.
parent b2cc3a20
...@@ -165,12 +165,29 @@ impl UpdateCellOperation { ...@@ -165,12 +165,29 @@ impl UpdateCellOperation {
in_progress.event.notify(usize::MAX); in_progress.event.notify(usize::MAX);
} }
} }
fn is_serializable(&self) -> bool {
match self {
UpdateCellOperation::InvalidateWhenCellDependency {
is_serializable_cell_content,
..
} => *is_serializable_cell_content,
UpdateCellOperation::FinalCellChange {
is_serializable_cell_content,
..
} => *is_serializable_cell_content,
UpdateCellOperation::AggregationUpdate { .. } => true,
UpdateCellOperation::Done => true,
}
}
} }
impl Operation for UpdateCellOperation { impl Operation for UpdateCellOperation {
fn execute(mut self, ctx: &mut impl ExecuteContext) { fn execute(mut self, ctx: &mut impl ExecuteContext) {
loop { loop {
ctx.operation_suspend_point(&self); if self.is_serializable() {
ctx.operation_suspend_point(&self);
}
match self { match self {
UpdateCellOperation::InvalidateWhenCellDependency { UpdateCellOperation::InvalidateWhenCellDependency {
is_serializable_cell_content, is_serializable_cell_content,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment