diff --git a/.gitmodules b/.gitmodules index 929159e6..5326577c 100644 --- a/.gitmodules +++ b/.gitmodules @@ -46,3 +46,6 @@ [submodule "third_party/highway/src"] path = third_party/highway/src url = https://chromium.googlesource.com/external/github.com/google/highway.git +[submodule "third_party/partition_alloc"] + path = third_party/partition_alloc + url = https://chromium.googlesource.com/chromium/src/base/allocator/partition_allocator.git diff --git a/README.md b/README.md index 11a4c6f6..47d467be 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Rusty V8 Binding -V8 Version: 13.4.114.17 +V8 Version: 13.5.212.0 [![ci](https://github.com/denoland/rusty_v8/workflows/ci/badge.svg?branch=main)](https://github.com/denoland/rusty_v8/actions) [![crates](https://img.shields.io/crates/v/v8.svg)](https://crates.io/crates/v8) diff --git a/build b/build index 430d9c26..d62828b9 160000 --- a/build +++ b/build @@ -1 +1 @@ -Subproject commit 430d9c2604fd5d1d53ee2c0a4a10fdf72b036521 +Subproject commit d62828b93ca8ff189bcc58615ff2176b6232c143 diff --git a/buildtools b/buildtools index 6b4eaa1e..b248db94 160000 --- a/buildtools +++ b/buildtools @@ -1 +1 @@ -Subproject commit 6b4eaa1ed0f3a604f354b4098e4f676f7815f1da +Subproject commit b248db940ef3dd7e5f4694ebf4d8a3f67aa0086d diff --git a/src/array_buffer_view.rs b/src/array_buffer_view.rs index fbbf68e4..73fe773d 100644 --- a/src/array_buffer_view.rs +++ b/src/array_buffer_view.rs @@ -121,7 +121,12 @@ impl ArrayBufferView { { unsafe { let (data, size) = self.get_contents_raw_parts(storage); - std::slice::from_raw_parts(data, size) + if data.is_null() { + debug_assert_eq!(size, 0); + std::slice::from_raw_parts(std::ptr::dangling(), size) + } else { + std::slice::from_raw_parts(data, size) + } } } } diff --git a/src/binding.cc b/src/binding.cc index e63c0b72..c67ea93f 100644 --- a/src/binding.cc +++ b/src/binding.cc @@ -7,6 +7,7 @@ #include #include +#include "cppgc/allocation.h" #include "cppgc/platform.h" #include "support.h" #include "unicode/locid.h" diff --git a/src/function.rs b/src/function.rs index 80e1fa6a..fdf2c38d 100644 --- a/src/function.rs +++ b/src/function.rs @@ -243,7 +243,7 @@ pub struct FunctionCallbackInfo { impl FunctionCallbackInfo { const kHolderIndex: i32 = 0; const kIsolateIndex: i32 = 1; - const kUnusedIndex: i32 = 2; + const kContextIndex: i32 = 2; const kReturnValueIndex: i32 = 3; const kTargetIndex: i32 = 4; const kNewTargetIndex: i32 = 5; @@ -263,11 +263,6 @@ impl FunctionCallbackInfo { self.get_implicit_arg_non_null::(Self::kReturnValueIndex) } - #[inline(always)] - pub(crate) fn holder(&self) -> Local { - unsafe { self.get_implicit_arg_local(Self::kHolderIndex) } - } - #[inline(always)] pub(crate) fn new_target(&self) -> Local { unsafe { self.get_implicit_arg_local(Self::kNewTargetIndex) } @@ -374,19 +369,6 @@ impl<'s> FunctionCallbackArguments<'s> { unsafe { &mut *self.0.get_isolate_ptr() } } - /// If the callback was created without a Signature, this is the same value as - /// `this()`. If there is a signature, and the signature didn't match `this()` - /// but one of its hidden prototypes, this will be the respective hidden - /// prototype. - /// - /// Note that this is not the prototype of `this()` on which the accessor - /// referencing this callback was found (which in V8 internally is often - /// referred to as holder [sic]). - #[inline(always)] - pub fn holder(&self) -> Local<'s, Object> { - self.0.holder() - } - /// For construct calls, this returns the "new.target" value. #[inline(always)] pub fn new_target(&self) -> Local<'s, Value> { diff --git a/src/string.rs b/src/string.rs index b54a15a1..9acc8d0c 100644 --- a/src/string.rs +++ b/src/string.rs @@ -286,6 +286,11 @@ unsafe extern "C" fn one_byte_const_estimate_memory_usage( ) -> int { -1 } +unsafe extern "C" fn one_byte_const_estimate_shared_memory_usage( + _this: *const OneByteConst, + _recorder: *mut (), +) { +} type OneByteConstNoOp = unsafe extern "C" fn(*const OneByteConst); type OneByteConstIsCacheable = @@ -297,6 +302,8 @@ type OneByteConstUnaccount = unsafe extern "C" fn(*const OneByteConst, *mut Isolate); type OneByteConstEstimateMemoryUsage = unsafe extern "C" fn(*const OneByteConst) -> int; +type OneByteConstEstimateSharedMemoryUsage = + unsafe extern "C" fn(*const OneByteConst, *mut ()); #[repr(C)] struct OneByteConstVtable { @@ -327,6 +334,7 @@ struct OneByteConstVtable { is_cacheable: OneByteConstIsCacheable, unaccount: OneByteConstUnaccount, estimate_memory_usage: OneByteConstEstimateMemoryUsage, + estimate_shared_memory_usage: OneByteConstEstimateSharedMemoryUsage, dispose: OneByteConstNoOp, lock: OneByteConstNoOp, unlock: OneByteConstNoOp, @@ -344,6 +352,7 @@ const ONE_BYTE_CONST_VTABLE: OneByteConstVtable = OneByteConstVtable { is_cacheable: one_byte_const_is_cacheable, unaccount: one_byte_const_unaccount, estimate_memory_usage: one_byte_const_estimate_memory_usage, + estimate_shared_memory_usage: one_byte_const_estimate_shared_memory_usage, dispose: one_byte_const_no_op, lock: one_byte_const_no_op, unlock: one_byte_const_no_op, diff --git a/tests/test_api.rs b/tests/test_api.rs index aa4b680a..05b0198c 100644 --- a/tests/test_api.rs +++ b/tests/test_api.rs @@ -1938,7 +1938,6 @@ fn instance_template_with_internal_field() { ) { let this = args.this(); - assert_eq!(args.holder(), this); assert!(args.data().is_undefined()); assert!(this.set_internal_field(0, v8::Integer::new(scope, 42).into())); @@ -2135,7 +2134,6 @@ fn object_template_set_accessor() { ) { let this = args.this(); - assert_eq!(args.holder(), this); assert!(args.data().is_undefined()); let ret = v8::Integer::new(scope, 69); diff --git a/third_party/abseil-cpp b/third_party/abseil-cpp index aaed376e..2705c665 160000 --- a/third_party/abseil-cpp +++ b/third_party/abseil-cpp @@ -1 +1 @@ -Subproject commit aaed376e01b9f98ff29f70fd47468b7e806e1639 +Subproject commit 2705c6655c0008cc3fb152dae27890d44bc335f1 diff --git a/third_party/icu b/third_party/icu index bbccc2f6..d30b7b0b 160000 --- a/third_party/icu +++ b/third_party/icu @@ -1 +1 @@ -Subproject commit bbccc2f6efc1b825de5f2c903c48be685cd0cf22 +Subproject commit d30b7b0bb3829f2e220df403ed461a1ede78b774 diff --git a/third_party/libc++/src b/third_party/libc++/src index 2e25154d..7f8b68f9 160000 --- a/third_party/libc++/src +++ b/third_party/libc++/src @@ -1 +1 @@ -Subproject commit 2e25154d49c29fa9aa42c30ad4a027bd30123434 +Subproject commit 7f8b68f91ca8b192375f5e71cd81fb3ed9650ef3 diff --git a/third_party/libc++abi/src b/third_party/libc++abi/src index 634228a7..94c5d7a8 160000 --- a/third_party/libc++abi/src +++ b/third_party/libc++abi/src @@ -1 +1 @@ -Subproject commit 634228a732a1d9ae1a6d459556e8fc58707cf961 +Subproject commit 94c5d7a8edc09f0680aee57548c0b5d400c2840d diff --git a/third_party/libunwind/src b/third_party/libunwind/src index e55d8cf5..62e217a1 160000 --- a/third_party/libunwind/src +++ b/third_party/libunwind/src @@ -1 +1 @@ -Subproject commit e55d8cf51c6db1fdd4bb56c158945ec59772c8ee +Subproject commit 62e217a12ee1133833d9890b2f7adde900e4efbd diff --git a/third_party/llvm-libc/src b/third_party/llvm-libc/src index 6b4e376d..2f5bf11b 160000 --- a/third_party/llvm-libc/src +++ b/third_party/llvm-libc/src @@ -1 +1 @@ -Subproject commit 6b4e376d4537ac5c0601bc1459e315a86f0dafd8 +Subproject commit 2f5bf11b5c1ee22291223990c912f2cecdcdb0ce diff --git a/third_party/partition_alloc b/third_party/partition_alloc new file mode 160000 index 00000000..46d880ff --- /dev/null +++ b/third_party/partition_alloc @@ -0,0 +1 @@ +Subproject commit 46d880ff62f340854a5a70142b0abf604c7af221 diff --git a/tools/clang b/tools/clang index a037c8c5..ab2d3eca 160000 --- a/tools/clang +++ b/tools/clang @@ -1 +1 @@ -Subproject commit a037c8c5ad9a5591d9699730ed8c30f3e0a9a5ac +Subproject commit ab2d3eca76026ac7b13ba8913597218457d7e800 diff --git a/v8 b/v8 index c2a4cc21..6f22e2f6 160000 --- a/v8 +++ b/v8 @@ -1 +1 @@ -Subproject commit c2a4cc213a89c4c881119b15e7da8c3cc81cb291 +Subproject commit 6f22e2f6df50928298327a70879d1f0a842ac91e