0
0
Fork 0
mirror of https://github.com/denoland/rusty_v8.git synced 2024-11-27 16:11:06 -05:00

chore: small clean ups (#1073)

This commit is contained in:
Ryan Dahl 2022-09-19 03:33:58 -04:00 committed by GitHub
parent 5cc0a8556a
commit 0d1ada4387
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 9 deletions

6
.gn
View file

@ -39,6 +39,12 @@ default_args = {
v8_use_external_startup_data = false v8_use_external_startup_data = false
v8_use_snapshot = true v8_use_snapshot = true
# Ensure allocation of typed arrays and arraybuffers always goes through
# the embedder's ArrayBufferAllocator, otherwise small buffers get moved
# around by the garbage collector but embedders normally want them to have
# fixed addresses.
v8_typed_array_max_size_in_heap = 0
# To avoid test failure: # To avoid test failure:
# Fatal error in ../../../v8/src/heap/read-only-spaces.cc, line 69 # Fatal error in ../../../v8/src/heap/read-only-spaces.cc, line 69
# Check failed: read_only_blob_checksum_ == snapshot_checksum (<unprintable> # Check failed: read_only_blob_checksum_ == snapshot_checksum (<unprintable>

View file

@ -204,12 +204,6 @@ fn build_v8() {
gn_args.push(r#"target_cpu="x86""#.to_string()); gn_args.push(r#"target_cpu="x86""#.to_string());
} }
// Ensure allocation of typed arrays and arraybuffers always goes through
// the embedder's ArrayBufferAllocator, otherwise small buffers get moved
// around by the garbage collector but embedders normally want them to have
// fixed addresses.
gn_args.push(r#"v8_typed_array_max_size_in_heap=0"#.into());
let gn_root = env::var("CARGO_MANIFEST_DIR").unwrap(); let gn_root = env::var("CARGO_MANIFEST_DIR").unwrap();
let gn_out = maybe_gen(&gn_root, gn_args); let gn_out = maybe_gen(&gn_root, gn_args);

View file

@ -22,7 +22,7 @@
using namespace support; using namespace support;
template<typename T> template <typename T>
constexpr size_t align_to(size_t size) { constexpr size_t align_to(size_t size) {
return (size + sizeof(T) - 1) & ~(sizeof(T) - 1); return (size + sizeof(T) - 1) & ~(sizeof(T) - 1);
} }
@ -45,7 +45,8 @@ static_assert(sizeof(v8::PromiseRejectMessage) == sizeof(size_t) * 3,
static_assert(sizeof(v8::Locker) == sizeof(size_t) * 2, "Locker size mismatch"); static_assert(sizeof(v8::Locker) == sizeof(size_t) * 2, "Locker size mismatch");
static_assert(sizeof(v8::ScriptCompiler::Source) == align_to<size_t>(sizeof(size_t) * 6 + sizeof(int) * 3), static_assert(sizeof(v8::ScriptCompiler::Source) ==
align_to<size_t>(sizeof(size_t) * 6 + sizeof(int) * 3),
"Source size mismatch"); "Source size mismatch");
static_assert(sizeof(v8::FunctionCallbackInfo<v8::Value>) == sizeof(size_t) * 3, static_assert(sizeof(v8::FunctionCallbackInfo<v8::Value>) == sizeof(size_t) * 3,