File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change 2828
2929#include " include/proxy-wasm/limits.h"
3030
31+ #include " absl/strings/str_format.h"
32+ #include " include/v8-initialization.h"
3133#include " include/v8-version.h"
3234#include " include/v8.h"
33- #include " src/flags/flags.h"
3435#include " src/wasm/c-api.h"
3536#include " wasm-api/wasm.hh"
3637
@@ -42,10 +43,13 @@ wasm::Engine *engine() {
4243 static wasm::own<wasm::Engine> engine;
4344
4445 std::call_once (init, []() {
45- ::v8::internal::v8_flags.liftoff = false ;
46- ::v8::internal::v8_flags.wasm_max_mem_pages =
47- PROXY_WASM_HOST_MAX_WASM_MEMORY_SIZE_BYTES / PROXY_WASM_HOST_WASM_MEMORY_PAGE_SIZE_BYTES;
46+ // Disable the Liftoff compiler to force optimized JIT up-front.
47+ std::string args = absl::StrFormat (" --wasm_max_mem_pages=%u --no-liftoff" ,
48+ PROXY_WASM_HOST_MAX_WASM_MEMORY_SIZE_BYTES /
49+ PROXY_WASM_HOST_WASM_MEMORY_PAGE_SIZE_BYTES);
50+ ::v8::V8::SetFlagsFromString (args.c_str(), args.size());
4851 ::v8::V8::EnableWebAssemblyTrapHandler (true );
52+
4953 engine = wasm::Engine::make ();
5054 });
5155
You can’t perform that action at this time.
0 commit comments