Skip to content

Commit ea5769e

Browse files
authored
Rolling to V8 14.6.202.2 (#1906)
1 parent 8b232b4 commit ea5769e

File tree

26 files changed

+250
-189
lines changed

26 files changed

+250
-189
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Rusty V8 Binding
22

3-
V8 Version: 14.5.201.5
3+
V8 Version: 14.6.202.2
44

55
[![ci](https://github.com/denoland/rusty_v8/workflows/ci/badge.svg?branch=main)](https://github.com/denoland/rusty_v8/actions)
66
[![crates](https://img.shields.io/crates/v/v8.svg)](https://crates.io/crates/v8)

build

Submodule build updated 79 files

build.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,12 +222,14 @@ fn build_binding() {
222222
.generate_cstr(true)
223223
.rustified_enum(".*UseCounterFeature")
224224
.rustified_enum(".*ModuleImportPhase")
225+
.rustified_enum(".*Intercepted")
225226
.bitfield_enum(".*GCType")
226227
.bitfield_enum(".*GCCallbackFlags")
227228
.allowlist_item("v8__.*")
228229
.allowlist_item("cppgc__.*")
229230
.allowlist_item("RustObj")
230231
.allowlist_item("memory_span_t")
232+
.allowlist_item("const_memory_span_t")
231233
.allowlist_item("ExternalConstOneByteStringResource")
232234
.generate()
233235
.expect("Unable to generate bindings");

buildtools

Submodule buildtools updated from 4dc32b3 to 6a18683

examples/process.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -295,8 +295,8 @@ impl<'scope, 'obj, 'isolate> JsHttpRequestProcessor<'scope, 'obj, 'isolate> {
295295
args: v8::PropertyCallbackArguments,
296296
mut rv: v8::ReturnValue,
297297
) {
298-
let this = args.this();
299-
let external = Self::unwrap_request(scope, this);
298+
let holder = args.holder();
299+
let external = Self::unwrap_request(scope, holder);
300300

301301
assert!(
302302
!external.is_null(),

src/binding.cc

Lines changed: 36 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -948,9 +948,8 @@ const v8::Boolean* v8__Boolean__New(v8::Isolate* isolate, bool value) {
948948

949949
int v8__FixedArray__Length(const v8::FixedArray& self) { return self.Length(); }
950950

951-
const v8::Data* v8__FixedArray__Get(const v8::FixedArray& self,
952-
const v8::Context& context, int index) {
953-
return local_to_ptr(ptr_to_local(&self)->Get(ptr_to_local(&context), index));
951+
const v8::Data* v8__FixedArray__Get(const v8::FixedArray& self, int index) {
952+
return local_to_ptr(ptr_to_local(&self)->Get(index));
954953
}
955954

956955
const v8::PrimitiveArray* v8__PrimitiveArray__New(v8::Isolate* isolate,
@@ -1456,14 +1455,15 @@ const v8::Value* v8__Object__GetIndex(const v8::Object& self,
14561455
ptr_to_local(&self)->Get(ptr_to_local(&context), index));
14571456
}
14581457

1459-
void* v8__Object__GetAlignedPointerFromInternalField(const v8::Object& self,
1460-
int index) {
1461-
return ptr_to_local(&self)->GetAlignedPointerFromInternalField(index);
1458+
void* v8__Object__GetAlignedPointerFromInternalField(
1459+
const v8::Object& self, int index, v8::EmbedderDataTypeTag tag) {
1460+
return ptr_to_local(&self)->GetAlignedPointerFromInternalField(index, tag);
14621461
}
14631462

14641463
void v8__Object__SetAlignedPointerInInternalField(const v8::Object& self,
1465-
int index, void* value) {
1466-
ptr_to_local(&self)->SetAlignedPointerInInternalField(index, value);
1464+
int index, void* value,
1465+
v8::EmbedderDataTypeTag tag) {
1466+
ptr_to_local(&self)->SetAlignedPointerInInternalField(index, value, tag);
14671467
}
14681468

14691469
bool v8__Object__IsApiWrapper(const v8::Object& self) {
@@ -1997,12 +1997,14 @@ void DeserializeInternalFields(v8::Local<v8::Object> holder, int index,
19971997
v8::StartupData payload, void* data) {
19981998
assert(data == nullptr);
19991999
if (payload.raw_size == 0) {
2000-
holder->SetAlignedPointerInInternalField(index, nullptr);
2000+
holder->SetAlignedPointerInInternalField(index, nullptr,
2001+
v8::kEmbedderDataTypeTagDefault);
20012002
return;
20022003
}
20032004
InternalFieldData* embedder_field = new InternalFieldData{0};
20042005
memcpy(embedder_field, payload.data, payload.raw_size);
2005-
holder->SetAlignedPointerInInternalField(index, embedder_field);
2006+
holder->SetAlignedPointerInInternalField(index, embedder_field,
2007+
v8::kEmbedderDataTypeTagDefault);
20062008
deserialized_data.push_back(embedder_field);
20072009
}
20082010

@@ -2406,11 +2408,6 @@ const v8::Value* v8__PropertyCallbackInfo__Data(
24062408
return local_to_ptr(self.Data());
24072409
}
24082410

2409-
const v8::Object* v8__PropertyCallbackInfo__This(
2410-
const v8::PropertyCallbackInfo<v8::Value>& self) {
2411-
return local_to_ptr(self.This());
2412-
}
2413-
24142411
const v8::Object* v8__PropertyCallbackInfo__Holder(
24152412
const v8::PropertyCallbackInfo<v8::Value>& self) {
24162413
return local_to_ptr(self.HolderV2());
@@ -2907,7 +2904,8 @@ v8::StartupData SerializeInternalFields(v8::Local<v8::Object> holder, int index,
29072904
void* data) {
29082905
assert(data == nullptr);
29092906
InternalFieldData* embedder_field = static_cast<InternalFieldData*>(
2910-
holder->GetAlignedPointerFromInternalField(index));
2907+
holder->GetAlignedPointerFromInternalField(
2908+
index, v8::kEmbedderDataTypeTagDefault));
29112909
if (embedder_field == nullptr) return {nullptr, 0};
29122910
int size = sizeof(*embedder_field);
29132911
char* payload = new char[size];
@@ -3438,13 +3436,20 @@ void v8__WasmStreaming__shared_ptr_DESTRUCT(WasmStreamingSharedPtr* self) {
34383436
self->~WasmStreamingSharedPtr();
34393437
}
34403438

3439+
void v8__WasmStreaming__SetHasCompiledModuleBytes(
3440+
WasmStreamingSharedPtr* self) {
3441+
self->inner->SetHasCompiledModuleBytes();
3442+
}
3443+
34413444
void v8__WasmStreaming__OnBytesReceived(WasmStreamingSharedPtr* self,
34423445
const uint8_t* data, size_t len) {
34433446
self->inner->OnBytesReceived(data, len);
34443447
}
34453448

3446-
void v8__WasmStreaming__Finish(WasmStreamingSharedPtr* self) {
3447-
self->inner->Finish();
3449+
void v8__WasmStreaming__Finish(
3450+
WasmStreamingSharedPtr* self,
3451+
void (*callback)(v8::WasmStreaming::ModuleCachingInterface&)) {
3452+
self->inner->Finish(callback);
34483453
}
34493454

34503455
void v8__WasmStreaming__Abort(WasmStreamingSharedPtr* self,
@@ -3457,6 +3462,19 @@ void v8__WasmStreaming__SetUrl(WasmStreamingSharedPtr* self, const char* url,
34573462
self->inner->SetUrl(url, len);
34583463
}
34593464

3465+
const_memory_span_t v8__ModuleCachingInterface__GetWireBytes(
3466+
const v8::WasmStreaming::ModuleCachingInterface& self) {
3467+
v8::MemorySpan<const uint8_t> span = self.GetWireBytes();
3468+
return {span.data(), span.size()};
3469+
}
3470+
3471+
bool v8__ModuleCachingInterface__SetCachedCompiledModuleBytes(
3472+
v8::WasmStreaming::ModuleCachingInterface& self,
3473+
const_memory_span_t bytes) {
3474+
v8::MemorySpan<const uint8_t> bytes_span{bytes.data, bytes.size};
3475+
return self.SetCachedCompiledModuleBytes(bytes_span);
3476+
}
3477+
34603478
const v8::ArrayBuffer* v8__WasmMemoryObject__Buffer(
34613479
const v8::WasmMemoryObject& self) {
34623480
return local_to_ptr(ptr_to_local(&self)->Buffer());

src/binding.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ using v8__HeapStatistics = v8::HeapStatistics;
4444
using v8__HeapSpaceStatistics = v8::HeapSpaceStatistics;
4545
using v8__GCType = v8::GCType;
4646
using v8__GCCallbackFlags = v8::GCCallbackFlags;
47+
using v8__Intercepted = v8::Intercepted;
4748

4849
static uint32_t v8__MAJOR_VERSION = V8_MAJOR_VERSION;
4950
static uint32_t v8__MINOR_VERSION = V8_MINOR_VERSION;

src/fixed_array.rs

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,15 @@
1-
use crate::scope::PinScope;
21
// Copyright 2019-2021 the Deno authors. All rights reserved. MIT license.
3-
use crate::Context;
2+
43
use crate::Data;
54
use crate::FixedArray;
65
use crate::Local;
6+
use crate::scope::PinScope;
77
use crate::support::int;
88

99
unsafe extern "C" {
1010
fn v8__FixedArray__Length(this: *const FixedArray) -> int;
1111

12-
fn v8__FixedArray__Get(
13-
this: *const FixedArray,
14-
context: *const Context,
15-
index: int,
16-
) -> *const Data;
12+
fn v8__FixedArray__Get(this: *const FixedArray, index: int) -> *const Data;
1713
}
1814

1915
impl FixedArray {
@@ -32,10 +28,6 @@ impl FixedArray {
3228
return None;
3329
}
3430

35-
unsafe {
36-
scope.cast_local(|sd| {
37-
v8__FixedArray__Get(self, &*sd.get_current_context(), index as int)
38-
})
39-
}
31+
unsafe { scope.cast_local(|_| v8__FixedArray__Get(self, index as int)) }
4032
}
4133
}

src/function.rs

Lines changed: 0 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,6 @@ unsafe extern "C" {
9797
fn v8__PropertyCallbackInfo__Data(
9898
this: *const RawPropertyCallbackInfo,
9999
) -> *const Value;
100-
fn v8__PropertyCallbackInfo__This(
101-
this: *const RawPropertyCallbackInfo,
102-
) -> *const Object;
103100
fn v8__PropertyCallbackInfo__Holder(
104101
this: *const RawPropertyCallbackInfo,
105102
) -> *const Object;
@@ -406,52 +403,6 @@ impl<'s> PropertyCallbackArguments<'s> {
406403
}
407404
}
408405

409-
/// Returns the receiver. In many cases, this is the object on which the
410-
/// property access was intercepted. When using
411-
/// `Reflect.get`, `Function.prototype.call`, or similar functions, it is the
412-
/// object passed in as receiver or thisArg.
413-
///
414-
/// ```c++
415-
/// void GetterCallback(Local<Name> name,
416-
/// const v8::PropertyCallbackInfo<v8::Value>& info) {
417-
/// auto context = info.GetIsolate()->GetCurrentContext();
418-
///
419-
/// v8::Local<v8::Value> a_this =
420-
/// info.This()
421-
/// ->GetRealNamedProperty(context, v8_str("a"))
422-
/// .ToLocalChecked();
423-
/// v8::Local<v8::Value> a_holder =
424-
/// info.Holder()
425-
/// ->GetRealNamedProperty(context, v8_str("a"))
426-
/// .ToLocalChecked();
427-
///
428-
/// CHECK(v8_str("r")->Equals(context, a_this).FromJust());
429-
/// CHECK(v8_str("obj")->Equals(context, a_holder).FromJust());
430-
///
431-
/// info.GetReturnValue().Set(name);
432-
/// }
433-
///
434-
/// v8::Local<v8::FunctionTemplate> templ =
435-
/// v8::FunctionTemplate::New(isolate);
436-
/// templ->InstanceTemplate()->SetHandler(
437-
/// v8::NamedPropertyHandlerConfiguration(GetterCallback));
438-
/// LocalContext env;
439-
/// env->Global()
440-
/// ->Set(env.local(), v8_str("obj"), templ->GetFunction(env.local())
441-
/// .ToLocalChecked()
442-
/// ->NewInstance(env.local())
443-
/// .ToLocalChecked())
444-
/// .FromJust();
445-
///
446-
/// CompileRun("obj.a = 'obj'; var r = {a: 'r'}; Reflect.get(obj, 'x', r)");
447-
/// ```
448-
#[inline(always)]
449-
pub fn this(&self) -> Local<'s, Object> {
450-
unsafe {
451-
Local::from_raw(v8__PropertyCallbackInfo__This(self.0)).unwrap_unchecked()
452-
}
453-
}
454-
455406
/// Returns the data set in the configuration, i.e., in
456407
/// `NamedPropertyHandlerConfiguration` or
457408
/// `IndexedPropertyHandlerConfiguration.`

src/isolate.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1676,7 +1676,7 @@ impl Isolate {
16761676
+ for<'a, 'b, 'c> Fn(
16771677
&'c mut PinScope<'a, 'b>,
16781678
Local<'a, Value>,
1679-
WasmStreaming,
1679+
WasmStreaming<false>,
16801680
),
16811681
{
16821682
unsafe {

0 commit comments

Comments
 (0)