diff --git a/Cargo.lock b/Cargo.lock index a85d10076bc..79823fbcf32 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -743,9 +743,9 @@ dependencies = [ [[package]] name = "calendrical_calculations" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53c5d386a9f2c8b97e1a036420bcf937db4e5c9df33eb0232025008ced6104c0" +checksum = "3a0b39595c6ee54a8d0900204ba4c401d0ab4eb45adaf07178e8d017541529e7" dependencies = [ "core_maths", "displaydoc", @@ -1772,9 +1772,9 @@ dependencies = [ [[package]] name = "diplomat" -version = "0.12.0" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ced081520ee8cf2b8c5b64a1a901eccd7030ece670dac274afe64607d6499b71" +checksum = "9adb46b05e2f53dcf6a7dfc242e4ce9eb60c369b6b6eb10826a01e93167f59c6" dependencies = [ "diplomat_core", "proc-macro2", @@ -1784,15 +1784,15 @@ dependencies = [ [[package]] name = "diplomat-runtime" -version = "0.12.0" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "098f9520ec5c190943b083bca3ea4cc4e67dc5f85a37062e528ecf1d25f04eb4" +checksum = "0569bd3caaf13829da7ee4e83dbf9197a0e1ecd72772da6d08f0b4c9285c8d29" [[package]] name = "diplomat_core" -version = "0.12.1" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad619d9fdee0e731bb6f8f7d797b6ecfdc2395e363f554d2f6377155955171eb" +checksum = "51731530ed7f2d4495019abc7df3744f53338e69e2863a6a64ae91821c763df1" dependencies = [ "proc-macro2", "quote", @@ -3015,9 +3015,9 @@ dependencies = [ [[package]] name = "icu_calendar" -version = "2.0.5" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f6c40ba6481ed7ddd358437af0f000eb9f661345845977d9d1b38e606374e1f" +checksum = "d6f0e52e009b6b16ba9c0693578796f2dd4aaa59a7f8f920423706714a89ac4e" dependencies = [ "calendrical_calculations", "displaydoc", @@ -3026,21 +3026,20 @@ dependencies = [ "icu_locale_core", "icu_provider", "tinystr", - "writeable", "zerovec", ] [[package]] name = "icu_calendar_data" -version = "2.0.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7219c8639ab936713a87b571eed2bc2615aa9137e8af6eb221446ee5644acc18" +checksum = "527f04223b17edfe0bd43baf14a0cb1b017830db65f3950dc00224860a9a446d" [[package]] name = "icu_collections" -version = "2.0.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "200072f5d0e3614556f94a9930d5dc3e0662a652823904c3a75dc3b0af7fee47" +checksum = "4c6b649701667bbe825c3b7e6388cb521c23d88644678e83c0c4d0a621a34b43" dependencies = [ "displaydoc", "potential_utf", @@ -3051,11 +3050,10 @@ dependencies = [ [[package]] name = "icu_locale" -version = "2.0.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ae5921528335e91da1b6c695dbf1ec37df5ac13faa3f91e5640be93aa2fbefd" +checksum = "532b11722e350ab6bf916ba6eb0efe3ee54b932666afec989465f9243fe6dd60" dependencies = [ - "displaydoc", "icu_collections", "icu_locale_core", "icu_locale_data", @@ -3067,12 +3065,13 @@ dependencies = [ [[package]] name = "icu_locale_core" -version = "2.0.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0cde2700ccaed3872079a65fb1a78f6c0a36c91570f28755dda67bc8f7d9f00a" +checksum = "edba7861004dd3714265b4db54a3c390e880ab658fec5f7db895fae2046b5bb6" dependencies = [ "displaydoc", "litemap", + "serde", "tinystr", "writeable", "zerovec", @@ -3080,17 +3079,16 @@ dependencies = [ [[package]] name = "icu_locale_data" -version = "2.0.0" +version = "2.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fdef0c124749d06a743c69e938350816554eb63ac979166590e2b4ee4252765" +checksum = "1c5f1d16b4c3a2642d3a719f18f6b06070ab0aef246a6418130c955ae08aa831" [[package]] name = "icu_normalizer" -version = "2.0.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "436880e8e18df4d7bbc06d58432329d6458cc84531f7ac5f024e93deadb37979" +checksum = "5f6c8828b67bf8908d82127b2054ea1b4427ff0230ee9141c54251934ab1b599" dependencies = [ - "displaydoc", "icu_collections", "icu_normalizer_data", "icu_properties", @@ -3101,42 +3099,40 @@ dependencies = [ [[package]] name = "icu_normalizer_data" -version = "2.0.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00210d6893afc98edb752b664b8890f0ef174c8adbb8d0be9710fa66fbbf72d3" +checksum = "7aedcccd01fc5fe81e6b489c15b247b8b0690feb23304303a9e560f37efc560a" [[package]] name = "icu_properties" -version = "2.0.1" +version = "2.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "016c619c1eeb94efb86809b015c58f479963de65bdb6253345c1a1276f22e32b" +checksum = "020bfc02fe870ec3a66d93e677ccca0562506e5872c650f893269e08615d74ec" dependencies = [ - "displaydoc", "icu_collections", "icu_locale_core", "icu_properties_data", "icu_provider", - "potential_utf", "zerotrie", "zerovec", ] [[package]] name = "icu_properties_data" -version = "2.0.1" +version = "2.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "298459143998310acd25ffe6810ed544932242d3f07083eee1084d83a71bd632" +checksum = "616c294cf8d725c6afcd8f55abc17c56464ef6211f9ed59cccffe534129c77af" [[package]] name = "icu_provider" -version = "2.0.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03c80da27b5f4187909049ee2d72f276f0d9f99a42c306bd0131ecfe04d8e5af" +checksum = "85962cf0ce02e1e0a629cc34e7ca3e373ce20dda4c4d7294bbd0bf1fdb59e614" dependencies = [ "displaydoc", "icu_locale_core", + "serde", "stable_deref_trait", - "tinystr", "writeable", "yoke", "zerofrom", @@ -3444,12 +3440,9 @@ checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" [[package]] name = "ixdtf" -version = "0.6.3" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33ef2d119044a672ceb96e59608dffe8677f29dc6ec48ed693a4b9ac84751e9b" -dependencies = [ - "displaydoc", -] +checksum = "84de9d95a6d2547d9b77ee3f25fa0ee32e3c3a6484d47a55adebc0439c077992" [[package]] name = "jemalloc_pprof" @@ -3468,12 +3461,6 @@ dependencies = [ "tracing", ] -[[package]] -name = "jiff-tzdb" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1283705eb0a21404d2bfd6eef2a7593d240bc42a0bdb39db0ad6fa2ec026524" - [[package]] name = "jni" version = "0.21.1" @@ -6134,6 +6121,16 @@ dependencies = [ "web-sys", ] +[[package]] +name = "resb" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a067ab3b5ca3b4dc307d0de9cf75f9f5e6ca9717b192b2f28a36c83e5de9e76" +dependencies = [ + "potential_utf", + "serde_core", +] + [[package]] name = "rgb" version = "0.8.52" @@ -6739,21 +6736,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "ry_temporal_capi" -version = "0.0.11-ry.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdfddefd45ee4814bd83d94b7196c95ef6af159f4a0035a6c67bd59edcff14ee" -dependencies = [ - "diplomat", - "diplomat-runtime", - "icu_calendar", - "icu_locale", - "num-traits", - "temporal_rs", - "writeable", -] - [[package]] name = "ryu" version = "1.0.20" @@ -7281,9 +7263,9 @@ dependencies = [ [[package]] name = "sourcemap" -version = "9.2.2" +version = "9.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e22afbcb92ce02d23815b9795523c005cb9d3c214f8b7a66318541c240ea7935" +checksum = "314d62a489431668f719ada776ca1d49b924db951b7450f8974c9ae51ab05ad7" dependencies = [ "base64-simd", "bitvec", @@ -8849,21 +8831,36 @@ dependencies = [ "windows-sys 0.61.2", ] +[[package]] +name = "temporal_capi" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a151e402c2bdb6a3a2a2f3f225eddaead2e7ce7dd5d3fa2090deb11b17aa4ed8" +dependencies = [ + "diplomat", + "diplomat-runtime", + "icu_calendar", + "icu_locale", + "num-traits", + "temporal_rs", + "timezone_provider", + "writeable", + "zoneinfo64", +] + [[package]] name = "temporal_rs" -version = "0.0.11" -source = "git+https://github.com/boa-dev/temporal?tag=v0.0.11#1980ece2d4ebf796d0fe62645392599f64d7b130" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88afde3bd75d2fc68d77a914bece426aa08aa7649ffd0cdd4a11c3d4d33474d1" dependencies = [ - "combine", "core_maths", "icu_calendar", "icu_locale", "ixdtf", - "jiff-tzdb", "num-traits", "timezone_provider", "tinystr", - "tzif", "writeable", ] @@ -9053,12 +9050,14 @@ dependencies = [ [[package]] name = "timezone_provider" -version = "0.0.11" -source = "git+https://github.com/boa-dev/temporal?tag=v0.0.11#1980ece2d4ebf796d0fe62645392599f64d7b130" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df9ba0000e9e73862f3e7ca1ff159e2ddf915c9d8bb11e38a7874760f445d993" dependencies = [ "tinystr", "zerotrie", "zerovec", + "zoneinfo64", ] [[package]] @@ -9637,15 +9636,6 @@ dependencies = [ "spacetimedb 1.11.3", ] -[[package]] -name = "tzif" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5e762ac355f0c204d09ae644b3d59423d5ddfc5603997d60c8c56f24e429a9d" -dependencies = [ - "combine", -] - [[package]] name = "unarray" version = "0.1.4" @@ -9795,9 +9785,9 @@ dependencies = [ [[package]] name = "v8" -version = "140.2.0" +version = "145.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8827809a2884fb68530d678a8ef15b1ed1344bbf844879194d68c140c6f844f9" +checksum = "61d9a107e16bae35a0be2bb0096ac1d2318aac352c82edd796ab2b9cac66d8f0" dependencies = [ "bindgen", "bitflags 2.10.0", @@ -9806,7 +9796,7 @@ dependencies = [ "home", "miniz_oxide", "paste", - "ry_temporal_capi", + "temporal_capi", "which 6.0.3", ] @@ -10957,9 +10947,9 @@ dependencies = [ [[package]] name = "writeable" -version = "0.6.1" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea2f10b9bb0928dfb1b42b65e1f9e36f7f54dbdf08457afefb38afcdec4fa2bb" +checksum = "9edde0db4769d2dc68579893f2306b26c6ecfbe0ef499b013d731b7b9247e0b9" [[package]] name = "wyz" @@ -11209,6 +11199,19 @@ dependencies = [ "zstd", ] +[[package]] +name = "zoneinfo64" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb2e5597efbe7c421da8a7fd396b20b571704e787c21a272eecf35dfe9d386f0" +dependencies = [ + "calendrical_calculations", + "icu_locale_core", + "potential_utf", + "resb", + "serde", +] + [[package]] name = "zopfli" version = "0.8.2" diff --git a/Cargo.toml b/Cargo.toml index 9696129e3b9..a697820bd4d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -275,7 +275,7 @@ slab = "0.4.7" sled = "0.34.7" smallvec = { version = "1.11", features = ["union", "const_generics"] } socket2 = "0.5" -sourcemap = "9" +sourcemap = "9.3.1" sqllogictest = "0.17" sqllogictest-engines = "0.17" sqlparser = "0.38.0" @@ -314,7 +314,7 @@ unicode-normalization = "0.1.23" url = "2.3.1" urlencoding = "2.1.2" uuid = { version = "1.18.1", default-features = false } -v8 = "140.2" +v8 = "145" walkdir = "2.2.5" wasmbin = "0.6" webbrowser = "1.0.2" @@ -371,14 +371,6 @@ unexpected_cfgs = { level = "warn", check-cfg = ['cfg(tokio_unstable)'] } # FIXME: we should work on this lint incrementally result_large_err = "allow" -[patch.crates-io] -# Note(bfops): We require this override because temporal_rs (pulled via core->v8->ry_temporal_capi) -# depends on timezone_provider using a `~` which allows a roll-forward to an incompatible version. -# Maybe this will no longer be an issue if we bump v8 to a version that depends on a post-0.1 -# version of temporal_rs, but I'm not holding my breath. -timezone_provider = { git = "https://github.com/boa-dev/temporal", tag = "v0.0.11" } -temporal_rs = { git = "https://github.com/boa-dev/temporal", tag = "v0.0.11" } - [workspace.metadata] # This silences a warning in our Nix flake, which otherwise would be upset that our call to `crateNameFromCargoToml` # is running against a file that doesn't have a name in it. diff --git a/crates/core/src/host/v8/budget.rs b/crates/core/src/host/v8/budget.rs index c127ce2c55a..7181787025f 100644 --- a/crates/core/src/host/v8/budget.rs +++ b/crates/core/src/host/v8/budget.rs @@ -42,13 +42,14 @@ pub(super) fn with_timeout_and_cb_every( } /// A callback passed to [`IsolateHandle::request_interrupt`]. -pub(super) type InterruptCallback = extern "C" fn(&mut Isolate, *mut c_void); +pub(super) type InterruptCallback = extern "C" fn(v8::UnsafeRawIsolatePtr, *mut c_void); /// An [`InterruptCallback`] used by `call_reducer`, /// and called by a thread separate to V8 execution /// every [`EPOCH_TICKS_PER_SECOND`] ticks (~every 1 second) /// to log that the reducer is still running. -pub(super) extern "C" fn cb_log_long_running(isolate: &mut Isolate, _: *mut c_void) { +pub(super) extern "C" fn cb_log_long_running(mut isolate: v8::UnsafeRawIsolatePtr, _: *mut c_void) { + let isolate = unsafe { Isolate::ref_from_raw_isolate_ptr_mut_unchecked(&mut isolate) }; let Some(env) = env_on_isolate(isolate) else { // All we can do is log something. tracing::error!("`JsInstanceEnv` not set"); @@ -61,7 +62,7 @@ pub(super) extern "C" fn cb_log_long_running(isolate: &mut Isolate, _: *mut c_vo } /// An [`InterruptCallback`] that does nothing. -pub(super) extern "C" fn cb_noop(_: &mut Isolate, _: *mut c_void) {} +pub(super) extern "C" fn cb_noop(_: v8::UnsafeRawIsolatePtr, _: *mut c_void) {} /// Spawns a thread that will terminate execution /// when `budget` has been used up. diff --git a/crates/core/src/host/v8/error.rs b/crates/core/src/host/v8/error.rs index f20c1486425..55792c609bc 100644 --- a/crates/core/src/host/v8/error.rs +++ b/crates/core/src/host/v8/error.rs @@ -261,7 +261,7 @@ pub(super) struct JsStackTrace { impl JsStackTrace { /// Converts a V8 [`StackTrace`] into one independent of `'scope`. - pub(super) fn from_trace<'scope>(scope: &PinScope<'scope, '_>, trace: Local<'scope, StackTrace>) -> Self { + pub(super) fn from_trace<'scope>(scope: &mut PinScope<'scope, '_>, trace: Local<'scope, StackTrace>) -> Self { let frames = (0..trace.get_frame_count()) .map(|index| { let frame = trace.get_frame(scope, index).unwrap(); @@ -276,7 +276,7 @@ impl JsStackTrace { } /// Construct a backtrace from `scope`. - pub(super) fn from_current_stack_trace(scope: &PinScope<'_, '_>) -> ExcResult { + pub(super) fn from_current_stack_trace(scope: &mut PinScope<'_, '_>) -> ExcResult { let trace = StackTrace::current_stack_trace(scope, 1024).ok_or_else(exception_already_thrown)?; Ok(Self::from_trace(scope, trace)) } @@ -342,16 +342,20 @@ pub(super) struct JsStackTraceFrame { impl JsStackTraceFrame { /// Converts a V8 [`StackFrame`] into one independent of `'scope`. - fn from_frame<'scope>(scope: &PinScope<'scope, '_>, frame: Local<'scope, StackFrame>) -> Self { + fn from_frame<'scope>(scope: &mut PinScope<'scope, '_>, frame: Local<'scope, StackFrame>) -> Self { let script_id = frame.get_script_id(); let mut line = frame.get_line_number(); let mut column = frame.get_column(); let mut script_name = None; let fn_name = frame.get_function_name(scope).map(|s| s.to_rust_string_lossy(scope)); - let sourcemap = scope - .get_slot() - .and_then(|SourceMaps(maps)| maps.get(&(script_id as i32))); + let sourcemap = scope.get_slot().and_then(|SourceMaps(maps)| maps.get(&script_id)); + + let sourcemap = if let Some(sm) = sourcemap { + sm.as_ref() + } else { + SourceMaps::parse_and_insert(scope, frame) + }; // sourcemap uses 0-based line/column numbers, while v8 uses 1-based if let Some(token) = sourcemap.and_then(|sm| sm.lookup_token(line as u32 - 1, column as u32 - 1)) { @@ -437,29 +441,32 @@ impl fmt::Display for JsStackTraceFrame { } /// Mappings from a script id to its source map. +/// +/// An entry with `None` indicates that there is no sourcemap for that script. #[derive(Default)] -pub(super) struct SourceMaps(IntMap); - -pub(super) fn parse_and_insert_sourcemap(scope: &mut PinScope<'_, '_>, module: Local<'_, v8::Module>) { - let source_map_url = module.get_unbound_module_script(scope).get_source_mapping_url(scope); - let source_map_url = (!source_map_url.is_null_or_undefined()).then_some(source_map_url); - - if let Some((script_id, source_map_url)) = Option::zip(module.script_id(), source_map_url) { - let mut source_map_url = source_map_url.to_rust_string_lossy(scope); - // Hacky workaround for `decode_data_url` expecting a specific string without `charset=utf-8` - // Can remove once gets into a release - if source_map_url.starts_with("data:application/json;charset=utf-8;base64,") { - let start = "data:application/json;".len(); - let len = "charset=utf-8;".len(); - source_map_url.replace_range(start..start + len, ""); - } - if let Ok(sourcemap::DecodedMap::Regular(sourcemap)) = sourcemap::decode_data_url(&source_map_url) { - let SourceMaps(maps) = get_or_insert_slot(scope, SourceMaps::default); - maps.insert(script_id, sourcemap); - } +struct SourceMaps(IntMap>); + +impl SourceMaps { + /// Extract the sourcemap from the given frame, if it exists, and insert + /// it into the `SourceMaps` in the isolate. + fn parse_and_insert<'a>( + scope: &'a mut PinScope<'_, '_>, + frame: Local<'_, StackFrame>, + ) -> Option<&'a sourcemap::SourceMap> { + let sourcemap = frame.get_script_source_mapping_url(scope).and_then(|source_map_url| { + let source_map_url = source_map_url.to_rust_string_lossy(scope); + if let Ok(sourcemap::DecodedMap::Regular(sourcemap)) = sourcemap::decode_data_url(&source_map_url) { + Some(sourcemap) + } else { + None + } + }); + let SourceMaps(maps) = get_or_insert_slot(scope, SourceMaps::default); + maps.entry(frame.get_script_id()).insert(sourcemap).into_mut().as_ref() } } +/// Get the slot `T` from `isolate`, or create it with the value `default()` if it doesn't exist. fn get_or_insert_slot(isolate: &mut v8::Isolate, default: impl FnOnce() -> T) -> &mut T { if isolate.get_slot::().is_none() { isolate.set_slot(default()); @@ -469,7 +476,7 @@ fn get_or_insert_slot(isolate: &mut v8::Isolate, default: impl FnOnc impl JsError { /// Turns a caught JS exception in `scope` into a [`JSError`]. - fn from_caught(scope: &PinnedRef<'_, TryCatch<'_, '_, HandleScope<'_>>>) -> Self { + fn from_caught(scope: &mut PinnedRef<'_, TryCatch<'_, '_, HandleScope<'_>>>) -> Self { match scope.message() { Some(message) => Self { trace: message diff --git a/crates/core/src/host/v8/mod.rs b/crates/core/src/host/v8/mod.rs index 133def696ce..71bf514f6be 100644 --- a/crates/core/src/host/v8/mod.rs +++ b/crates/core/src/host/v8/mod.rs @@ -94,9 +94,11 @@ impl V8RuntimeInner { /// /// Should only be called once but it isn't unsound to call it more times. fn init() -> Self { - // Our current configuration: - // - will pick a number of worker threads for background jobs based on the num CPUs. - // - does not allow idle tasks + // We don't want idle tasks nor background worker tasks, + // as we intend to run on a single core. + // Per the docs, `new_single_threaded_default_platform` requires + // that we pass `--single-threaded`. + v8::V8::set_flags_from_string("--single-threaded"); let platform = v8::new_single_threaded_default_platform(false).make_shared(); // Initialize V8. Internally, this uses a global lock so it's safe that we don't. v8::V8::initialize_platform(platform); @@ -705,8 +707,6 @@ fn eval_module<'scope>( return Err(error::TypeError("module has top-level await and is pending").throw(scope)); } - error::parse_and_insert_sourcemap(scope, module); - Ok((module, value)) } diff --git a/crates/core/src/host/v8/syscall/hooks.rs b/crates/core/src/host/v8/syscall/hooks.rs index fd6df6cb4b7..7a9207ee091 100644 --- a/crates/core/src/host/v8/syscall/hooks.rs +++ b/crates/core/src/host/v8/syscall/hooks.rs @@ -30,8 +30,6 @@ pub(super) fn set_hook_slots( abi: AbiVersion, hooks: &[(ModuleHookKey, Local<'_, Function>)], ) -> ExcResult<()> { - // Make sure to call `set_slot` first, as it creates the annex - // and `set_embedder_data` is currently buggy. let ctx = scope.get_current_context(); let hooks_info = HooksInfo::get_or_create(&ctx, abi) .map_err(|_| TypeError("cannot call `register_hooks` from different versions").throw(scope))?; @@ -57,15 +55,7 @@ impl ModuleHookKey { /// Returns the index for the slot that holds the module function hook. /// The index is passed to `v8::Context::{get,set}_embedder_data`. fn to_slot_index(self) -> i32 { - match self { - // high numbers to avoid overlapping with rusty_v8 - can be - // reverted to just 0, 1... once denoland/rusty_v8#1868 merges - ModuleHookKey::DescribeModule => 20, - ModuleHookKey::CallReducer => 21, - ModuleHookKey::CallView => 22, - ModuleHookKey::CallAnonymousView => 23, - ModuleHookKey::CallProcedure => 24, - } + self as i32 } }