Commit 6a977bd1 authored by Clemens Backes's avatar Clemens Backes Committed by V8 LUCI CQ

[wasm] Deprecate "dynamic tiering enabled" callback

Dynamic tiering is now enabled by default, and the origin trial is
expired, so the callback can be removed.
The callback was already never called, because the flag value is always
checked first.

R=ahaas@chromium.org, mlippautz@chromium.org

Bug: v8:12281
Change-Id: I58eaa210c86024128328a13ba07bb8fc1b437841
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3644951
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
Reviewed-by: 's avatarJakob Kummerow <jkummerow@chromium.org>
Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/main@{#80633}
parent 15d83bff
......@@ -323,7 +323,9 @@ using WasmSimdEnabledCallback = bool (*)(Local<Context> context);
using WasmExceptionsEnabledCallback = bool (*)(Local<Context> context);
// --- Callback for checking if WebAssembly dynamic tiering is enabled ---
using WasmDynamicTieringEnabledCallback = bool (*)(Local<Context> context);
using WasmDynamicTieringEnabledCallback V8_DEPRECATE_SOON(
"Dynamic tiering is now enabled by default") =
bool (*)(Local<Context> context);
// --- Callback for checking if the SharedArrayBuffer constructor is enabled ---
using SharedArrayBufferConstructorEnabledCallback =
......
......@@ -1538,8 +1538,9 @@ class V8_EXPORT Isolate {
void SetWasmExceptionsEnabledCallback(WasmExceptionsEnabledCallback callback);
void SetWasmDynamicTieringEnabledCallback(
WasmDynamicTieringEnabledCallback callback);
V8_DEPRECATE_SOON("Dynamic tiering is now enabled by default")
void SetWasmDynamicTieringEnabledCallback(WasmDynamicTieringEnabledCallback) {
}
void SetSharedArrayBufferConstructorEnabledCallback(
SharedArrayBufferConstructorEnabledCallback callback);
......
......@@ -9442,10 +9442,6 @@ CALLBACK_SETTER(WasmSimdEnabledCallback, WasmSimdEnabledCallback,
CALLBACK_SETTER(WasmExceptionsEnabledCallback, WasmExceptionsEnabledCallback,
wasm_exceptions_enabled_callback)
CALLBACK_SETTER(WasmDynamicTieringEnabledCallback,
WasmDynamicTieringEnabledCallback,
wasm_dynamic_tiering_enabled_callback)
CALLBACK_SETTER(SharedArrayBufferConstructorEnabledCallback,
SharedArrayBufferConstructorEnabledCallback,
sharedarraybuffer_constructor_enabled_callback)
......
......@@ -2872,19 +2872,6 @@ bool Isolate::AreWasmExceptionsEnabled(Handle<Context> context) {
#endif // V8_ENABLE_WEBASSEMBLY
}
bool Isolate::IsWasmDynamicTieringEnabled() {
#if V8_ENABLE_WEBASSEMBLY
if (FLAG_wasm_dynamic_tiering) return true;
if (wasm_dynamic_tiering_enabled_callback()) {
HandleScope handle_scope(this);
v8::Local<v8::Context> api_context =
v8::Utils::ToLocal(handle(context(), this));
return wasm_dynamic_tiering_enabled_callback()(api_context);
}
#endif // V8_ENABLE_WEBASSEMBLY
return false;
}
Handle<Context> Isolate::GetIncumbentContext() {
JavaScriptFrameIterator it(this);
......
......@@ -502,8 +502,6 @@ using DeprecatedLegacyOOMErrorCallback = void (*)(const char* location,
V(WasmLoadSourceMapCallback, wasm_load_source_map_callback, nullptr) \
V(WasmSimdEnabledCallback, wasm_simd_enabled_callback, nullptr) \
V(WasmExceptionsEnabledCallback, wasm_exceptions_enabled_callback, nullptr) \
V(WasmDynamicTieringEnabledCallback, wasm_dynamic_tiering_enabled_callback, \
nullptr) \
/* State for Relocatable. */ \
V(Relocatable*, relocatable_top, nullptr) \
V(DebugObjectCache*, string_stream_debug_object_cache, nullptr) \
......@@ -780,7 +778,6 @@ class V8_EXPORT_PRIVATE Isolate final : private HiddenFactory {
bool IsWasmSimdEnabled(Handle<Context> context);
bool AreWasmExceptionsEnabled(Handle<Context> context);
bool IsWasmDynamicTieringEnabled();
THREAD_LOCAL_TOP_ADDRESS(Context, pending_handler_context)
THREAD_LOCAL_TOP_ADDRESS(Address, pending_handler_entrypoint)
......
......@@ -1989,10 +1989,10 @@ std::shared_ptr<NativeModule> CompileToNativeModule(
// Create a new {NativeModule} first.
const bool include_liftoff = module->origin == kWasmOrigin && FLAG_liftoff;
DynamicTiering dynamic_tiering{isolate->IsWasmDynamicTieringEnabled()};
size_t code_size_estimate =
wasm::WasmCodeManager::EstimateNativeModuleCodeSize(
module.get(), include_liftoff, dynamic_tiering);
module.get(), include_liftoff,
DynamicTiering{FLAG_wasm_dynamic_tiering});
native_module =
engine->NewNativeModule(isolate, enabled, module, code_size_estimate);
native_module->SetWireBytes(std::move(wire_bytes_copy));
......@@ -2063,7 +2063,7 @@ AsyncCompileJob::AsyncCompileJob(
: isolate_(isolate),
api_method_name_(api_method_name),
enabled_features_(enabled),
dynamic_tiering_(DynamicTiering{isolate_->IsWasmDynamicTieringEnabled()}),
dynamic_tiering_(DynamicTiering{FLAG_wasm_dynamic_tiering}),
wasm_lazy_compilation_(FLAG_wasm_lazy_compilation),
start_time_(base::TimeTicks::Now()),
bytes_copy_(std::move(bytes_copy)),
......
......@@ -2280,8 +2280,7 @@ std::shared_ptr<NativeModule> WasmCodeManager::NewNativeModule(
size_t size = code_space.size();
Address end = code_space.end();
std::shared_ptr<NativeModule> ret;
new NativeModule(enabled,
DynamicTiering{isolate->IsWasmDynamicTieringEnabled()},
new NativeModule(enabled, DynamicTiering{FLAG_wasm_dynamic_tiering},
std::move(code_space), std::move(module),
isolate->async_counters(), &ret);
// The constructor initialized the shared_ptr.
......
......@@ -870,7 +870,7 @@ MaybeHandle<WasmModuleObject> DeserializeNativeModule(
auto shared_native_module = wasm_engine->MaybeGetNativeModule(
module->origin, owned_wire_bytes.as_vector(), isolate);
if (shared_native_module == nullptr) {
bool dynamic_tiering = isolate->IsWasmDynamicTieringEnabled();
const bool dynamic_tiering = FLAG_wasm_dynamic_tiering;
const bool include_liftoff = !dynamic_tiering;
size_t code_size_estimate =
wasm::WasmCodeManager::EstimateNativeModuleCodeSize(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment