denoland / deno_core

The core engine at the heart of Deno
MIT License
233 stars 76 forks source link

fix: root cppgc objects during async ops #790

Closed lucacasonato closed 2 weeks ago

lucacasonato commented 2 weeks ago

Previously cppgc objects were not correctly rooted during async ops. This commit fixes that.

It also improves lifetimes in the generated op code. This results in the compiler being able to reason about lifetimes of function arguments correctly, preventing compilation of incorrect code. Previously #[op2] async fn foo(a: &mut HandleScope) would compile for example, even though it is not safe.