Skip to content

Commit

Permalink
V8 12.3.219.1 (#1402)
Browse files Browse the repository at this point in the history
Rolling to V8 12.3.219.1


Co-authored-by: denobot <[email protected]>
  • Loading branch information
littledivy and denobot authored Feb 20, 2024
1 parent 07436bd commit f30c18c
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 11 deletions.
12 changes: 12 additions & 0 deletions .gn
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,18 @@ default_args = {

# Enable V8 object print for debugging.
# v8_enable_object_print = true

# V8 12.3 added google/fuzztest as a third party dependency.
# https://chromium.googlesource.com/v8/v8.git/+/d5acece0c9b89b18716c177d1fcc8f734191e1e2%5E%21/#F4
#
# This flag disables it.
v8_enable_fuzztest = false

# Disable v8::HandleScope LIFO checks.
# https://chromium-review.googlesource.com/c/v8/v8/+/5110566
#
# rusty_v8 scopes are not on the stack.
v8_enable_v8_checks = false

# Enable Deno-specific extra bindings
deno_enable_extras = true
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Rusty V8 Binding

V8 Version: 12.1.285.27
V8 Version: 12.3.219.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)
Expand Down
4 changes: 2 additions & 2 deletions src/binding.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3073,9 +3073,9 @@ int v8__ModuleRequest__GetSourceOffset(const v8::ModuleRequest& self) {
return self.GetSourceOffset();
}

const v8::FixedArray* v8__ModuleRequest__GetImportAssertions(
const v8::FixedArray* v8__ModuleRequest__GetImportAttributes(
const v8::ModuleRequest& self) {
return local_to_ptr(self.GetImportAssertions());
return local_to_ptr(self.GetImportAttributes());
}

struct WasmStreamingSharedPtr {
Expand Down
2 changes: 1 addition & 1 deletion src/isolate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,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 (); 65]>();
const EMBEDDER_DATA_OFFSET: usize = size_of::<[*const (); 67]>();

// Isolate data slots used internally by rusty_v8.
const ANNEX_SLOT: u32 = 0;
Expand Down
14 changes: 10 additions & 4 deletions src/module.rs
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ extern "C" {
this: *const ModuleRequest,
) -> *const String;
fn v8__ModuleRequest__GetSourceOffset(this: *const ModuleRequest) -> int;
fn v8__ModuleRequest__GetImportAssertions(
fn v8__ModuleRequest__GetImportAttributes(
this: *const ModuleRequest,
) -> *const FixedArray;
fn v8__Module__GetStalledTopLevelAwaitMessage(
Expand Down Expand Up @@ -480,7 +480,7 @@ impl ModuleRequest {
unsafe { v8__ModuleRequest__GetSourceOffset(self) }
}

/// Contains the import assertions for this request in the form:
/// Contains the import attributes for this request in the form:
/// [key1, value1, source_offset1, key2, value2, source_offset2, ...].
/// The keys and values are of type v8::String, and the source offsets are of
/// type Int32. Use Module::source_offset_to_location to convert the source
Expand All @@ -493,8 +493,14 @@ impl ModuleRequest {
/// opposed to, for example, triggering an error if an unsupported assertion is
/// present).
#[inline(always)]
pub fn get_import_assertions(&self) -> Local<FixedArray> {
unsafe { Local::from_raw(v8__ModuleRequest__GetImportAssertions(self)) }
pub fn get_import_attributes(&self) -> Local<FixedArray> {
unsafe { Local::from_raw(v8__ModuleRequest__GetImportAttributes(self)) }
.unwrap()
}

#[inline(always)]
#[deprecated(note = "Use get_import_attributes instead")]
pub fn get_import_assertions(&self) -> Local<FixedArray> {
self.get_import_attributes()
}
}
4 changes: 2 additions & 2 deletions tests/test_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4693,7 +4693,7 @@ fn module_instantiation_failures1() {
let loc = module.source_offset_to_location(mr1.get_source_offset());
assert_eq!(0, loc.get_line_number());
assert_eq!(7, loc.get_column_number());
assert_eq!(0, mr1.get_import_assertions().length());
assert_eq!(0, mr1.get_import_attributes().length());

let mr2 = v8::Local::<v8::ModuleRequest>::try_from(
module_requests.get(scope, 1).unwrap(),
Expand All @@ -4703,7 +4703,7 @@ fn module_instantiation_failures1() {
let loc = module.source_offset_to_location(mr2.get_source_offset());
assert_eq!(1, loc.get_line_number());
assert_eq!(15, loc.get_column_number());
assert_eq!(0, mr2.get_import_assertions().length());
assert_eq!(0, mr2.get_import_attributes().length());

// Instantiation should fail.
{
Expand Down
2 changes: 1 addition & 1 deletion v8
Submodule v8 updated 1757 files

0 comments on commit f30c18c

Please sign in to comment.