Repository: denoland/deno
Pull request: fix: format wasm stack traces correctly, preserve context in unhandled rejection, improve cppgc inheritance perf

Fixes https://github.com/denoland/deno/issues/30135
Fixes https://github.com/denoland/deno/issues/32239


Changed files:
filename: Cargo.lock
patch: @@ -1929,9 +1929,9 @@ dependencies = [
 
 [[package]]
 name = "deno_core"
-version = "0.385.0"
+version = "0.386.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e348ea58ad12f6bee5407768b571a8af09756246a45c83dfd27a5aeeb338c5eb"
+checksum = "f5cdb60d25f7e87f7f3bb5b1fcbd8d059ab908d614c0ad67dafce7f6c1514f08"
 dependencies = [
  "anyhow",
  "az",
@@ -1949,6 +1949,7 @@ dependencies = [
  "deno_unsync",
  "futures",
  "indexmap 2.9.0",
+ "inventory",
  "libc",
  "parking_lot",
  "percent-encoding",
@@ -2731,9 +2732,9 @@ dependencies = [
 
 [[package]]
 name = "deno_ops"
-version = "0.261.0"
+version = "0.262.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "86077bea01b43941082edef61e150fa661bab25a839f17592bb763faaae0c14b"
+checksum = "34b785cc3c336f7414d49a05119fa001ced8dff3150fdda671fc11eb4ccd15f4"
 dependencies = [
  "indexmap 2.9.0",
  "proc-macro2",
@@ -8545,9 +8546,9 @@ dependencies = [
 
 [[package]]
 name = "serde_v8"
-version = "0.294.0"
+version = "0.295.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8386a10eddc03e63b28ad6963dbd0552470b430419d81fd6409e19e28146a3c8"
+checksum = "cb620fe7d5bf70c50297bdd48621b1c365c0f6535e607a1b0aaab961939fe3e8"
 dependencies = [
  "deno_error",
  "num-bigint",
@@ -9446,9 +9447,9 @@ dependencies = [
 
 [[package]]
 name = "syn-match"
-version = "0.3.0"
+version = "0.3.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "783c4140d7ed89f37116e865b49e5a9fdd28608b9071a9dd1e158b50fc0a31fc"
+checksum = "54b8f0a9004d6aafa6a588602a1119e6cdaacec9921aa1605383e6e7d6258fd6"
 dependencies = [
  "proc-macro2",
  "quote",

filename: Cargo.toml
patch: @@ -77,7 +77,7 @@ repository = "https://github.com/denoland/deno"
 
 [workspace.dependencies]
 deno_ast = { version = "=0.53.1", features = ["transpiling"] }
-deno_core = { version = "0.385.0" }
+deno_core = { version = "0.386.0" }
 
 deno_cache_dir = "=0.27.0"
 deno_doc = "=0.190.1"

filename: ext/node/ops/handle_wrap.rs
patch: @@ -4,6 +4,8 @@ use std::cell::Cell;
 use std::cell::RefCell;
 use std::rc::Rc;
 
+use deno_core::CppgcBase;
+use deno_core::CppgcInherits;
 use deno_core::GarbageCollected;
 use deno_core::OpState;
 use deno_core::ResourceId;
@@ -38,6 +40,8 @@ pub fn op_node_new_async_id(state: &mut OpState) -> f64 {
   next_async_id(state) as f64
 }
 
+#[derive(CppgcBase)]
+#[repr(C)]
 pub struct AsyncWrap {
   provider: i32,
   async_id: i64,
@@ -86,7 +90,11 @@ enum State {
   Closed,
 }
 
+#[derive(CppgcBase, CppgcInherits)]
+#[cppgc_inherits_from(AsyncWrap)]
+#[repr(C)]
 pub struct HandleWrap {
+  base: AsyncWrap,
   handle: Option<ResourceId>,
   state: Rc<Cell<State>>,
 }
@@ -101,8 +109,9 @@ unsafe impl GarbageCollected for HandleWrap {
 }
 
 impl HandleWrap {
-  pub(crate) fn create(handle: Option<ResourceId>) -> Self {
+  pub(crate) fn create(base: AsyncWrap, handle: Option<ResourceId>) -> Self {
     Self {
+      base,
       handle,
       state: Rc::new(Cell::new(State::Initialized)),
     }
@@ -124,11 +133,8 @@ impl HandleWrap {
     state: &mut OpState,
     #[smi] provider: i32,
     #[smi] handle: Option<ResourceId>,
-  ) -> (AsyncWrap, HandleWrap) {
-    (
-      AsyncWrap::create(state, provider),
-      HandleWrap::create(handle),
-    )
+  ) -> HandleWrap {
+    HandleWrap::create(AsyncWrap::create(state, provider), handle)
   }
 
   // Ported from Node.js