diff --git a/crates/turbo-tasks-memory/src/output.rs b/crates/turbo-tasks-memory/src/output.rs index 43f50580c1fb7..d1c83f7ef216a 100644 --- a/crates/turbo-tasks-memory/src/output.rs +++ b/crates/turbo-tasks-memory/src/output.rs @@ -56,7 +56,17 @@ impl Output { pub fn link(&mut self, target: RawVc, turbo_tasks: &dyn TurboTasksBackendApi) { debug_assert!(*self != target); - self.assign(OutputContent::Link(target), turbo_tasks) + if let OutputContent::Link(old_target) = &self.content { + if *old_target == target { + // unchanged + return; + } + } + self.content = OutputContent::Link(target); + // notify + if !self.dependent_tasks.is_empty() { + turbo_tasks.schedule_notify_tasks_set(&take(&mut self.dependent_tasks)); + } } pub fn error(&mut self, error: Error, turbo_tasks: &dyn TurboTasksBackendApi) { @@ -79,18 +89,6 @@ impl Output { } } - pub fn assign( - &mut self, - content: OutputContent, - turbo_tasks: &dyn TurboTasksBackendApi, - ) { - self.content = content; - // notify - if !self.dependent_tasks.is_empty() { - turbo_tasks.schedule_notify_tasks_set(&take(&mut self.dependent_tasks)); - } - } - pub fn gc_drop(self, turbo_tasks: &dyn TurboTasksBackendApi) { // notify if !self.dependent_tasks.is_empty() { diff --git a/crates/turbopack-core/src/source_map/mod.rs b/crates/turbopack-core/src/source_map/mod.rs index 2af9fcbef4717..98031567bd621 100644 --- a/crates/turbopack-core/src/source_map/mod.rs +++ b/crates/turbopack-core/src/source_map/mod.rs @@ -43,7 +43,7 @@ pub trait GenerateSourceMap { /// The distinction between the source map spec's [sourcemap::Index] and our /// [SourceMap::Sectioned] is whether the sections are represented with Vcs /// pointers. -#[turbo_tasks::value(shared)] +#[turbo_tasks::value(shared, cell = "new")] pub enum SourceMap { /// A decoded source map contains no Vcs. Decoded(#[turbo_tasks(trace_ignore)] InnerSourceMap), diff --git a/crates/turbopack-css/src/process.rs b/crates/turbopack-css/src/process.rs index 23a901ecd97f5..202a309261f97 100644 --- a/crates/turbopack-css/src/process.rs +++ b/crates/turbopack-css/src/process.rs @@ -274,7 +274,7 @@ impl<'i, 'o> StyleSheetLike<'i, 'o> { #[turbo_tasks::value(transparent)] pub struct UnresolvedUrlReferences(pub Vec<(String, Vc)>); -#[turbo_tasks::value(shared, serialization = "none", eq = "manual")] +#[turbo_tasks::value(shared, serialization = "none", eq = "manual", cell = "new")] pub enum ParseCssResult { Ok { #[turbo_tasks(debug_ignore, trace_ignore)] @@ -296,13 +296,7 @@ pub enum ParseCssResult { NotFound, } -impl PartialEq for ParseCssResult { - fn eq(&self, _: &Self) -> bool { - false - } -} - -#[turbo_tasks::value(shared, serialization = "none", eq = "manual")] +#[turbo_tasks::value(shared, serialization = "none", eq = "manual", cell = "new")] pub enum CssWithPlaceholderResult { Ok { parse_result: Vc, @@ -324,12 +318,6 @@ pub enum CssWithPlaceholderResult { NotFound, } -impl PartialEq for CssWithPlaceholderResult { - fn eq(&self, _: &Self) -> bool { - false - } -} - #[turbo_tasks::value(shared, serialization = "none", eq = "manual")] pub enum FinalCssResult { Ok { @@ -390,10 +378,10 @@ pub async fn process_css_with_placeholder( url_references: *url_references, placeholders: HashMap::new(), } - .into()) + .cell()) } - ParseCssResult::Unparseable => Ok(CssWithPlaceholderResult::Unparseable.into()), - ParseCssResult::NotFound => Ok(CssWithPlaceholderResult::NotFound.into()), + ParseCssResult::Unparseable => Ok(CssWithPlaceholderResult::Unparseable.cell()), + ParseCssResult::NotFound => Ok(CssWithPlaceholderResult::NotFound.cell()), } } @@ -602,7 +590,7 @@ async fn process_content( } .cell() .emit(); - return Ok(ParseCssResult::Unparseable.into()); + return Ok(ParseCssResult::Unparseable.cell()); } _ => { @@ -629,7 +617,7 @@ async fn process_content( } .cell() .emit(); - return Ok(ParseCssResult::Unparseable.into()); + return Ok(ParseCssResult::Unparseable.cell()); } } }) @@ -669,12 +657,12 @@ async fn process_content( Ok(v) => v, Err(err) => { err.to_diagnostics(&handler).emit(); - return Ok(ParseCssResult::Unparseable.into()); + return Ok(ParseCssResult::Unparseable.cell()); } }; if handler.has_errors() { - return Ok(ParseCssResult::Unparseable.into()); + return Ok(ParseCssResult::Unparseable.cell()); } if matches!(ty, CssModuleAssetType::Module) { @@ -722,7 +710,7 @@ async fn process_content( url_references: Vc::cell(url_references), options: config, } - .into()) + .cell()) } /// Visitor that lints wrong css module usage.