next.js
9a1447c0 - turbo-tasks: inline per-variant lazy access; drop closure-taking helpers

Commit
103 days ago
turbo-tasks: inline per-variant lazy access; drop closure-taking helpers Continues the prefactor for swapping the TaskStorage lazy area away from TinyVec<LazyField>. The generic closure-taking helpers (find_lazy, find_lazy_mut, find_lazy_ref, lazy_at_mut, lazy_take_at, get_or_create_lazy, take_lazy, set_lazy) were the last places where a closure parameter forced the rest of the codegen to know about the LazyField enum shape — every caller was passing `|f| match f { LazyField::Variant(...) => ... }` extractors. Each lazy direct/collection accessor (`get_<name>`, `set_<name>`, `take_<name>`, `<name>`, `<name>_mut`, `get_<name>_mut`) now inlines a single per-variant `match` over `&LazyField` / `&mut LazyField` in its body and goes directly to the encapsulated primitives (`lazy_iter`, `lazy_iter_mut`, `lazy_push`, `lazy_slot_mut`, `lazy_swap_remove`, `lazy_replace_at`). The trait-level set/take/extend/add/remove/update_with bodies for direct and collection lazy fields collapse to the same shape as the inline shape — they just route through the typed `<name>` / `<name>_mut` / `take_<name>` accessors and let those do the per-variant scan internally. Once the byte-tail layout lands, the per-variant `match`es become unsafe pointer casts; the inline shape and the trait-level shape don't change. Drops `lazy_extractor_closure`, `lazy_matches_closure`, `lazy_unwrap_closure`, `lazy_constructor`, and the eight closure-taking helper methods. All 50 backend tests pass; whole workspace builds.
Author
Committer
Parents
Loading