diff --git a/bazel/external/wee8.patch b/bazel/external/wee8.patch index 152aad34b727..296625778f7a 100644 --- a/bazel/external/wee8.patch +++ b/bazel/external/wee8.patch @@ -1,11 +1,10 @@ -# 1. Fix handling of f64 globals. -# 2. Force full GC when destroying VMs. -# 3. Fix build with -DDEBUG. -# 4. Fix for VMs with overlapping lifetimes (https://crrev.com/c/1698387). -# 5. Fix linking with unbundled toolchain on macOS. +# 1. Force full GC when destroying VMs. +# 2. Fix build with -DDEBUG. +# 3. Fix for VMs with overlapping lifetimes (https://crrev.com/c/1698387). +# 4. Fix linking with unbundled toolchain on macOS. --- a/wee8/build/toolchain/gcc_toolchain.gni +++ b/wee8/build/toolchain/gcc_toolchain.gni -@@ -355,6 +355,8 @@ +@@ -355,6 +355,8 @@ template("gcc_toolchain") { # AIX does not support either -D (deterministic output) or response # files. command = "$ar -X64 {{arflags}} -r -c -s {{output}} {{inputs}}" @@ -14,7 +13,7 @@ } else { rspfile = "{{output}}.rsp" rspfile_content = "{{inputs}}" -@@ -546,7 +548,7 @@ +@@ -546,7 +548,7 @@ template("gcc_toolchain") { start_group_flag = "" end_group_flag = "" @@ -25,16 +24,7 @@ end_group_flag = "-Wl,--end-group " --- a/wee8/src/wasm/c-api.cc +++ b/wee8/src/wasm/c-api.cc -@@ -825,7 +825,7 @@ void global_set_f32(v8::Local global, float val) { - void global_set_f64(v8::Local global, double val) { - auto v8_object = v8::Utils::OpenHandle(global); - auto v8_global = i::Handle::cast(v8_object); -- v8_global->SetF32(val); -+ v8_global->SetF64(val); - } - - // Tables -@@ -985,7 +985,7 @@ auto seal(const typename implement::type* x) -> const C* { +@@ -633,7 +633,7 @@ auto seal(const typename implement::type* x) -> const C* { return reinterpret_cast(x); } @@ -43,22 +33,22 @@ template void vec::make_data() {} -@@ -1107,13 +1107,12 @@ class StoreImpl { - StoreImpl() {} +@@ -708,13 +708,12 @@ auto Engine::make(own&& config) -> own { + // Stores - ~StoreImpl() { + StoreImpl::~StoreImpl() { -#ifdef DEBUG +#if 1 - reinterpret_cast(isolate_)->heap()->PreciseCollectAllGarbage( - i::Heap::kNoGCFlags, i::GarbageCollectionReason::kTesting, - v8::kGCCallbackFlagForced); + reinterpret_cast(isolate_)->heap()->PreciseCollectAllGarbage( + i::Heap::kNoGCFlags, i::GarbageCollectionReason::kTesting, + v8::kGCCallbackFlagForced); #endif - context()->Exit(); -- isolate_->Exit(); - isolate_->Dispose(); - delete create_params_.array_buffer_allocator; - } -@@ -1163,7 +1162,6 @@ auto Store::make(Engine*) -> own { + context()->Exit(); +- isolate_->Exit(); + isolate_->Dispose(); + delete create_params_.array_buffer_allocator; + } +@@ -739,7 +738,6 @@ auto Store::make(Engine*) -> own { if (!isolate) return own(); { @@ -66,11 +56,16 @@ v8::HandleScope handle_scope(isolate); // Create context. -@@ -1246,7 +1244,6 @@ auto Store::make(Engine*) -> own { - store->host_data_map_ = v8::Eternal(isolate, map); +@@ -750,8 +748,10 @@ auto Store::make(Engine*) -> own { + store->isolate_ = isolate; + store->context_ = v8::Eternal(isolate, context); } - +- - store->isolate()->Enter(); ++ // We intentionally do not call isolate->Enter() here, because that would ++ // prevent embedders from using stores with overlapping but non-nested ++ // lifetimes. The consequence is that Isolate::Current() is dysfunctional ++ // and hence must not be called by anything reachable via this file. store->context()->Enter(); isolate->SetData(0, store.get()); diff --git a/bazel/repository_locations.bzl b/bazel/repository_locations.bzl index 0436eacff131..d0b571290765 100644 --- a/bazel/repository_locations.bzl +++ b/bazel/repository_locations.bzl @@ -244,8 +244,8 @@ REPOSITORY_LOCATIONS = dict( com_googlesource_chromium_v8 = dict( # This archive was created using https://storage.googleapis.com/envoyproxy-wee8/wee8-archive.sh # and contains complete checkout of v8 with all dependencies necessary to build wee8. - sha256 = "d59c26ce5d7a2b23fb6251823df700cda0dc9a93086c932be5dfd9048a763d03", - urls = ["https://storage.googleapis.com/envoyproxy-wee8/wee8-7.5.288.22.tar.gz"], + sha256 = "690ca8e3460362fba8e95d94c9325211ad477a4d71a392461f899ec91afd1292", + urls = ["https://storage.googleapis.com/envoyproxy-wee8/wee8-7.6.303.20.tar.gz"], ), io_opencensus_cpp = dict( sha256 = "8d6016e47c2e19e7acbadb6f905b8c422748c64299d71101ac8f28151677e195",