[wasm] Disable dynamic tiering for the c-api

With dynamic tiering, the "serialize" function provided by the c-api
does not work anymore, and it is unclear how it should work.

R=jkummerow@chromium.org

Bug: v8:12281
Change-Id: Ib70bf118ba42b0752eb5dab5f43893da0404931e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3338657
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78369}
This commit is contained in:
Andreas Haas 2021-12-14 15:11:30 +01:00 committed by V8 LUCI CQ
parent 8c0b9b3b49
commit dad520133c

View File

@ -391,7 +391,6 @@ Engine::~Engine() { impl(this)->~EngineImpl(); }
void Engine::operator delete(void* p) { ::operator delete(p); }
auto Engine::make(own<Config>&& config) -> own<Engine> {
i::FLAG_expose_gc = true;
auto engine = new (std::nothrow) EngineImpl;
if (!engine) return own<Engine>();
engine->platform = v8::platform::NewDefaultPlatform();
@ -402,6 +401,16 @@ auto Engine::make(own<Config>&& config) -> own<Engine> {
}
#endif
v8::V8::Initialize();
// The commandline flags get loaded in V8::Initialize(), so we can override
// the flag values only afterwards.
i::FLAG_expose_gc = true;
// We disable dynamic tiering because it interferes with serialization. We
// only serialize optimized code, but with dynamic tiering not all code gets
// optimized. It is then unclear what we should serialize in the first place.
i::FLAG_wasm_dynamic_tiering = false;
// We disable speculative inlining, because speculative inlining depends on
// dynamic tiering.
i::FLAG_wasm_speculative_inlining = false;
return make_own(seal<Engine>(engine));
}