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); ...@@ -323,7 +323,9 @@ using WasmSimdEnabledCallback = bool (*)(Local<Context> context);
using WasmExceptionsEnabledCallback = bool (*)(Local<Context> context); using WasmExceptionsEnabledCallback = bool (*)(Local<Context> context);
// --- Callback for checking if WebAssembly dynamic tiering is enabled --- // --- 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 --- // --- Callback for checking if the SharedArrayBuffer constructor is enabled ---
using SharedArrayBufferConstructorEnabledCallback = using SharedArrayBufferConstructorEnabledCallback =
......
...@@ -1538,8 +1538,9 @@ class V8_EXPORT Isolate { ...@@ -1538,8 +1538,9 @@ class V8_EXPORT Isolate {
void SetWasmExceptionsEnabledCallback(WasmExceptionsEnabledCallback callback); void SetWasmExceptionsEnabledCallback(WasmExceptionsEnabledCallback callback);
void SetWasmDynamicTieringEnabledCallback( V8_DEPRECATE_SOON("Dynamic tiering is now enabled by default")
WasmDynamicTieringEnabledCallback callback); void SetWasmDynamicTieringEnabledCallback(WasmDynamicTieringEnabledCallback) {
}
void SetSharedArrayBufferConstructorEnabledCallback( void SetSharedArrayBufferConstructorEnabledCallback(
SharedArrayBufferConstructorEnabledCallback callback); SharedArrayBufferConstructorEnabledCallback callback);
......
...@@ -9442,10 +9442,6 @@ CALLBACK_SETTER(WasmSimdEnabledCallback, WasmSimdEnabledCallback, ...@@ -9442,10 +9442,6 @@ CALLBACK_SETTER(WasmSimdEnabledCallback, WasmSimdEnabledCallback,
CALLBACK_SETTER(WasmExceptionsEnabledCallback, WasmExceptionsEnabledCallback, CALLBACK_SETTER(WasmExceptionsEnabledCallback, WasmExceptionsEnabledCallback,
wasm_exceptions_enabled_callback) wasm_exceptions_enabled_callback)
CALLBACK_SETTER(WasmDynamicTieringEnabledCallback,
WasmDynamicTieringEnabledCallback,
wasm_dynamic_tiering_enabled_callback)
CALLBACK_SETTER(SharedArrayBufferConstructorEnabledCallback, CALLBACK_SETTER(SharedArrayBufferConstructorEnabledCallback,
SharedArrayBufferConstructorEnabledCallback, SharedArrayBufferConstructorEnabledCallback,
sharedarraybuffer_constructor_enabled_callback) sharedarraybuffer_constructor_enabled_callback)
......
...@@ -2872,19 +2872,6 @@ bool Isolate::AreWasmExceptionsEnabled(Handle<Context> context) { ...@@ -2872,19 +2872,6 @@ bool Isolate::AreWasmExceptionsEnabled(Handle<Context> context) {
#endif // V8_ENABLE_WEBASSEMBLY #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() { Handle<Context> Isolate::GetIncumbentContext() {
JavaScriptFrameIterator it(this); JavaScriptFrameIterator it(this);
......
...@@ -502,8 +502,6 @@ using DeprecatedLegacyOOMErrorCallback = void (*)(const char* location, ...@@ -502,8 +502,6 @@ using DeprecatedLegacyOOMErrorCallback = void (*)(const char* location,
V(WasmLoadSourceMapCallback, wasm_load_source_map_callback, nullptr) \ V(WasmLoadSourceMapCallback, wasm_load_source_map_callback, nullptr) \
V(WasmSimdEnabledCallback, wasm_simd_enabled_callback, nullptr) \ V(WasmSimdEnabledCallback, wasm_simd_enabled_callback, nullptr) \
V(WasmExceptionsEnabledCallback, wasm_exceptions_enabled_callback, nullptr) \ V(WasmExceptionsEnabledCallback, wasm_exceptions_enabled_callback, nullptr) \
V(WasmDynamicTieringEnabledCallback, wasm_dynamic_tiering_enabled_callback, \
nullptr) \
/* State for Relocatable. */ \ /* State for Relocatable. */ \
V(Relocatable*, relocatable_top, nullptr) \ V(Relocatable*, relocatable_top, nullptr) \
V(DebugObjectCache*, string_stream_debug_object_cache, nullptr) \ V(DebugObjectCache*, string_stream_debug_object_cache, nullptr) \
...@@ -780,7 +778,6 @@ class V8_EXPORT_PRIVATE Isolate final : private HiddenFactory { ...@@ -780,7 +778,6 @@ class V8_EXPORT_PRIVATE Isolate final : private HiddenFactory {
bool IsWasmSimdEnabled(Handle<Context> context); bool IsWasmSimdEnabled(Handle<Context> context);
bool AreWasmExceptionsEnabled(Handle<Context> context); bool AreWasmExceptionsEnabled(Handle<Context> context);
bool IsWasmDynamicTieringEnabled();
THREAD_LOCAL_TOP_ADDRESS(Context, pending_handler_context) THREAD_LOCAL_TOP_ADDRESS(Context, pending_handler_context)
THREAD_LOCAL_TOP_ADDRESS(Address, pending_handler_entrypoint) THREAD_LOCAL_TOP_ADDRESS(Address, pending_handler_entrypoint)
......
...@@ -1989,10 +1989,10 @@ std::shared_ptr<NativeModule> CompileToNativeModule( ...@@ -1989,10 +1989,10 @@ std::shared_ptr<NativeModule> CompileToNativeModule(
// Create a new {NativeModule} first. // Create a new {NativeModule} first.
const bool include_liftoff = module->origin == kWasmOrigin && FLAG_liftoff; const bool include_liftoff = module->origin == kWasmOrigin && FLAG_liftoff;
DynamicTiering dynamic_tiering{isolate->IsWasmDynamicTieringEnabled()};
size_t code_size_estimate = size_t code_size_estimate =
wasm::WasmCodeManager::EstimateNativeModuleCodeSize( wasm::WasmCodeManager::EstimateNativeModuleCodeSize(
module.get(), include_liftoff, dynamic_tiering); module.get(), include_liftoff,
DynamicTiering{FLAG_wasm_dynamic_tiering});
native_module = native_module =
engine->NewNativeModule(isolate, enabled, module, code_size_estimate); engine->NewNativeModule(isolate, enabled, module, code_size_estimate);
native_module->SetWireBytes(std::move(wire_bytes_copy)); native_module->SetWireBytes(std::move(wire_bytes_copy));
...@@ -2063,7 +2063,7 @@ AsyncCompileJob::AsyncCompileJob( ...@@ -2063,7 +2063,7 @@ AsyncCompileJob::AsyncCompileJob(
: isolate_(isolate), : isolate_(isolate),
api_method_name_(api_method_name), api_method_name_(api_method_name),
enabled_features_(enabled), enabled_features_(enabled),
dynamic_tiering_(DynamicTiering{isolate_->IsWasmDynamicTieringEnabled()}), dynamic_tiering_(DynamicTiering{FLAG_wasm_dynamic_tiering}),
wasm_lazy_compilation_(FLAG_wasm_lazy_compilation), wasm_lazy_compilation_(FLAG_wasm_lazy_compilation),
start_time_(base::TimeTicks::Now()), start_time_(base::TimeTicks::Now()),
bytes_copy_(std::move(bytes_copy)), bytes_copy_(std::move(bytes_copy)),
......
...@@ -2280,8 +2280,7 @@ std::shared_ptr<NativeModule> WasmCodeManager::NewNativeModule( ...@@ -2280,8 +2280,7 @@ std::shared_ptr<NativeModule> WasmCodeManager::NewNativeModule(
size_t size = code_space.size(); size_t size = code_space.size();
Address end = code_space.end(); Address end = code_space.end();
std::shared_ptr<NativeModule> ret; std::shared_ptr<NativeModule> ret;
new NativeModule(enabled, new NativeModule(enabled, DynamicTiering{FLAG_wasm_dynamic_tiering},
DynamicTiering{isolate->IsWasmDynamicTieringEnabled()},
std::move(code_space), std::move(module), std::move(code_space), std::move(module),
isolate->async_counters(), &ret); isolate->async_counters(), &ret);
// The constructor initialized the shared_ptr. // The constructor initialized the shared_ptr.
......
...@@ -870,7 +870,7 @@ MaybeHandle<WasmModuleObject> DeserializeNativeModule( ...@@ -870,7 +870,7 @@ MaybeHandle<WasmModuleObject> DeserializeNativeModule(
auto shared_native_module = wasm_engine->MaybeGetNativeModule( auto shared_native_module = wasm_engine->MaybeGetNativeModule(
module->origin, owned_wire_bytes.as_vector(), isolate); module->origin, owned_wire_bytes.as_vector(), isolate);
if (shared_native_module == nullptr) { if (shared_native_module == nullptr) {
bool dynamic_tiering = isolate->IsWasmDynamicTieringEnabled(); const bool dynamic_tiering = FLAG_wasm_dynamic_tiering;
const bool include_liftoff = !dynamic_tiering; const bool include_liftoff = !dynamic_tiering;
size_t code_size_estimate = size_t code_size_estimate =
wasm::WasmCodeManager::EstimateNativeModuleCodeSize( 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