mirror of
https://github.com/denoland/rusty_v8.git
synced 2024-11-21 05:43:13 -05:00
Rolling to V8 11.7.439.1 (#1296)
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
This commit is contained in:
parent
8c8f88a294
commit
4573256203
11 changed files with 37 additions and 31 deletions
3
.gitmodules
vendored
3
.gitmodules
vendored
|
@ -25,3 +25,6 @@
|
|||
[submodule "third_party/icu"]
|
||||
path = third_party/icu
|
||||
url = https://github.com/denoland/icu.git
|
||||
[submodule "third_party/abseil-cpp"]
|
||||
path = third_party/abseil-cpp
|
||||
url = https://chromium.googlesource.com/chromium/src/third_party/abseil-cpp.git
|
||||
|
|
6
.gn
6
.gn
|
@ -51,12 +51,6 @@ default_args = {
|
|||
# compiler" snapshots, and sometimes uses them both at the same time.
|
||||
v8_enable_shared_ro_heap = false
|
||||
|
||||
# V8 introduced a bug in 11.1 that causes the External Pointer Table to never
|
||||
# be cleaned which causes resource exhaustion. Disabling pointer compression
|
||||
# makes sure that the EPT is not used.
|
||||
# https://bugs.chromium.org/p/v8/issues/detail?id=13640&q=garbage%20collection&can=2
|
||||
v8_enable_pointer_compression = false
|
||||
|
||||
# V8 11.6 hardcoded an assumption in `mksnapshot` that shared RO heap
|
||||
# is enabled. In our case it's disabled so without this flag we can't
|
||||
# compile.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Rusty V8 Binding
|
||||
|
||||
V8 Version: 11.6.189.16
|
||||
V8 Version: 11.7.439.1
|
||||
|
||||
[![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)
|
||||
|
|
2
build.rs
2
build.rs
|
@ -883,6 +883,6 @@ edge [fontsize=10]
|
|||
fn test_static_lib_size() {
|
||||
let static_lib_size = std::fs::metadata(static_lib_path()).unwrap().len();
|
||||
eprintln!("static lib size {}", static_lib_size);
|
||||
assert!(static_lib_size <= 230u64 << 20); // No more than 230 MiB.
|
||||
assert!(static_lib_size <= 270u64 << 20); // No more than 270 MiB.
|
||||
}
|
||||
}
|
||||
|
|
|
@ -484,17 +484,17 @@ bool v8__Data__EQ(const v8::Data& self, const v8::Data& other) {
|
|||
}
|
||||
|
||||
bool v8__Data__IsBigInt(const v8::Data& self) {
|
||||
return v8::Utils::OpenHandle(&self)->IsBigInt();
|
||||
return IsBigInt(*v8::Utils::OpenHandle(&self));
|
||||
}
|
||||
|
||||
bool v8__Data__IsBoolean(const v8::Data& self) {
|
||||
return v8::Utils::OpenHandle(&self)->IsBoolean();
|
||||
return IsBoolean(*v8::Utils::OpenHandle(&self));
|
||||
}
|
||||
|
||||
bool v8__Data__IsContext(const v8::Data& self) { return self.IsContext(); }
|
||||
|
||||
bool v8__Data__IsFixedArray(const v8::Data& self) {
|
||||
return v8::Utils::OpenHandle(&self)->IsFixedArray();
|
||||
return IsFixedArray(*v8::Utils::OpenHandle(&self));
|
||||
}
|
||||
|
||||
bool v8__Data__IsFunctionTemplate(const v8::Data& self) {
|
||||
|
@ -504,15 +504,15 @@ bool v8__Data__IsFunctionTemplate(const v8::Data& self) {
|
|||
bool v8__Data__IsModule(const v8::Data& self) { return self.IsModule(); }
|
||||
|
||||
bool v8__Data__IsModuleRequest(const v8::Data& self) {
|
||||
return v8::Utils::OpenHandle(&self)->IsModuleRequest();
|
||||
return IsModuleRequest(*v8::Utils::OpenHandle(&self));
|
||||
}
|
||||
|
||||
bool v8__Data__IsName(const v8::Data& self) {
|
||||
return v8::Utils::OpenHandle(&self)->IsName();
|
||||
return IsName(*v8::Utils::OpenHandle(&self));
|
||||
}
|
||||
|
||||
bool v8__Data__IsNumber(const v8::Data& self) {
|
||||
return v8::Utils::OpenHandle(&self)->IsNumber();
|
||||
return IsNumber(*v8::Utils::OpenHandle(&self));
|
||||
}
|
||||
|
||||
bool v8__Data__IsObjectTemplate(const v8::Data& self) {
|
||||
|
@ -520,17 +520,17 @@ bool v8__Data__IsObjectTemplate(const v8::Data& self) {
|
|||
}
|
||||
|
||||
bool v8__Data__IsPrimitive(const v8::Data& self) {
|
||||
return v8::Utils::OpenHandle(&self)->IsPrimitive() && !self.IsPrivate();
|
||||
return IsPrimitive(*v8::Utils::OpenHandle(&self)) && !self.IsPrivate();
|
||||
}
|
||||
|
||||
bool v8__Data__IsPrivate(const v8::Data& self) { return self.IsPrivate(); }
|
||||
|
||||
bool v8__Data__IsString(const v8::Data& self) {
|
||||
return v8::Utils::OpenHandle(&self)->IsString();
|
||||
return IsString(*v8::Utils::OpenHandle(&self));
|
||||
}
|
||||
|
||||
bool v8__Data__IsSymbol(const v8::Data& self) {
|
||||
return v8::Utils::OpenHandle(&self)->IsPublicSymbol();
|
||||
return IsPublicSymbol(*v8::Utils::OpenHandle(&self));
|
||||
}
|
||||
|
||||
bool v8__Data__IsValue(const v8::Data& self) { return self.IsValue(); }
|
||||
|
@ -3060,11 +3060,19 @@ void v8__HeapProfiler__TakeHeapSnapshot(v8::Isolate* isolate,
|
|||
const_cast<v8::HeapSnapshot*>(snapshot)->Delete();
|
||||
}
|
||||
|
||||
// This is necessary for v8__internal__GetIsolateFromHeapObject() to be
|
||||
// reliable enough for our purposes.
|
||||
#if UINTPTR_MAX == 0xffffffffffffffff && \
|
||||
!(defined V8_SHARED_RO_HEAP or defined V8_COMPRESS_POINTERS)
|
||||
#error V8 must be built with either the 'v8_enable_pointer_compression' or \
|
||||
'v8_enable_shared_ro_heap' feature enabled.
|
||||
#endif
|
||||
|
||||
v8::Isolate* v8__internal__GetIsolateFromHeapObject(const v8::Data& data) {
|
||||
namespace i = v8::internal;
|
||||
i::Object object(reinterpret_cast<const i::Address&>(data));
|
||||
i::Isolate* isolate;
|
||||
return object.IsHeapObject() &&
|
||||
return IsHeapObject(object) &&
|
||||
i::GetIsolateFromHeapObject(object.GetHeapObject(), &isolate)
|
||||
? reinterpret_cast<v8::Isolate*>(isolate)
|
||||
: nullptr;
|
||||
|
@ -3074,10 +3082,10 @@ int v8__Value__GetHash(const v8::Value& data) {
|
|||
namespace i = v8::internal;
|
||||
i::Object object(reinterpret_cast<const i::Address&>(data));
|
||||
i::Isolate* isolate;
|
||||
int hash = object.IsHeapObject() && i::GetIsolateFromHeapObject(
|
||||
int hash = IsHeapObject(object) && i::GetIsolateFromHeapObject(
|
||||
object.GetHeapObject(), &isolate)
|
||||
? object.GetOrCreateHash(isolate).value()
|
||||
: i::Smi::ToInt(object.GetHash());
|
||||
? i::Object::GetOrCreateHash(object, isolate).value()
|
||||
: i::Smi::ToInt(i::Object::GetHash(object));
|
||||
assert(hash != 0);
|
||||
return hash;
|
||||
}
|
||||
|
@ -3401,8 +3409,8 @@ void v8__CompiledWasmModule__DELETE(v8::CompiledWasmModule* self) {
|
|||
extern "C" {
|
||||
|
||||
size_t icu_get_default_locale(char* output, size_t output_len) {
|
||||
const icu_72::Locale& default_locale = icu::Locale::getDefault();
|
||||
icu_72::CheckedArrayByteSink sink(output, static_cast<uint32_t>(output_len));
|
||||
const icu_73::Locale& default_locale = icu::Locale::getDefault();
|
||||
icu_73::CheckedArrayByteSink sink(output, static_cast<uint32_t>(output_len));
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
default_locale.toLanguageTag(sink, status);
|
||||
assert(status == U_ZERO_ERROR);
|
||||
|
|
|
@ -5,7 +5,7 @@ use std::ffi::CString;
|
|||
extern "C" {
|
||||
fn icu_get_default_locale(output: *mut char, output_len: usize) -> usize;
|
||||
fn icu_set_default_locale(locale: *const char);
|
||||
fn udata_setCommonData_72(this: *const u8, error_code: *mut i32);
|
||||
fn udata_setCommonData_73(this: *const u8, error_code: *mut i32);
|
||||
}
|
||||
|
||||
/// This function bypasses the normal ICU data loading process and allows you to force ICU's system
|
||||
|
@ -42,10 +42,10 @@ extern "C" {
|
|||
/// functionality for application data.
|
||||
// TODO(ry) Map error code to something useful.
|
||||
#[inline(always)]
|
||||
pub fn set_common_data_72(data: &'static [u8]) -> Result<(), i32> {
|
||||
pub fn set_common_data_73(data: &'static [u8]) -> Result<(), i32> {
|
||||
let mut error_code = 0i32;
|
||||
unsafe {
|
||||
udata_setCommonData_72(data.as_ptr(), &mut error_code);
|
||||
udata_setCommonData_73(data.as_ptr(), &mut error_code);
|
||||
}
|
||||
if error_code == 0 {
|
||||
Ok(())
|
||||
|
|
|
@ -543,7 +543,7 @@ impl Isolate {
|
|||
// Byte offset inside `Isolate` where the isolate data slots are stored. This
|
||||
// should be the same as the value of `kIsolateEmbedderDataOffset` which is
|
||||
// defined in `v8-internal.h`.
|
||||
const EMBEDDER_DATA_OFFSET: usize = size_of::<[*const (); 62]>();
|
||||
const EMBEDDER_DATA_OFFSET: usize = size_of::<[*const (); 67]>();
|
||||
|
||||
// Isolate data slots used internally by rusty_v8.
|
||||
const ANNEX_SLOT: u32 = 0;
|
||||
|
|
|
@ -46,7 +46,7 @@ mod setup {
|
|||
fn initialize_once() {
|
||||
static START: Once = Once::new();
|
||||
START.call_once(|| {
|
||||
assert!(v8::icu::set_common_data_72(align_data::include_aligned!(
|
||||
assert!(v8::icu::set_common_data_73(align_data::include_aligned!(
|
||||
align_data::Align16,
|
||||
"../third_party/icu/common/icudtl.dat"
|
||||
))
|
||||
|
@ -8193,7 +8193,7 @@ fn icu_date() {
|
|||
|
||||
#[test]
|
||||
fn icu_set_common_data_fail() {
|
||||
assert!(v8::icu::set_common_data_72(&[1, 2, 3]).is_err());
|
||||
assert!(v8::icu::set_common_data_73(&[1, 2, 3]).is_err());
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
1
third_party/abseil-cpp
vendored
Submodule
1
third_party/abseil-cpp
vendored
Submodule
|
@ -0,0 +1 @@
|
|||
Subproject commit 583dc6d1b3a0dd44579718699e37cad2f0c41a26
|
2
third_party/icu
vendored
2
third_party/icu
vendored
|
@ -1 +1 @@
|
|||
Subproject commit 629a4bb99bf9f088120a2435deb6f630fc30f351
|
||||
Subproject commit a22a8f24224ddda8b856437d7e8560de1da3f8e1
|
2
v8
2
v8
|
@ -1 +1 @@
|
|||
Subproject commit 41f3d89183173cccefd080647299ac3ab58ba214
|
||||
Subproject commit 5163da1ee15f95956b1cf8da5b0a91e7470f4b0f
|
Loading…
Reference in a new issue