diff --git a/src/wasm/code-space-access.cc b/src/wasm/code-space-access.cc index 000582645b..0f71c9a224 100644 --- a/src/wasm/code-space-access.cc +++ b/src/wasm/code-space-access.cc @@ -12,12 +12,6 @@ namespace internal { namespace wasm { thread_local int CodeSpaceWriteScope::code_space_write_nesting_level_ = 0; -// The thread-local counter (above) is only valid if a single thread only works -// on one module at a time. This second thread-local checks that. -#if defined(DEBUG) && (!defined(V8_OS_MACOSX) || !defined(V8_HOST_ARCH_ARM64)) -thread_local NativeModule* CodeSpaceWriteScope::current_native_module_ = - nullptr; -#endif // TODO(jkummerow): Background threads could permanently stay in // writable mode; only the main thread has to switch back and forth. @@ -26,12 +20,6 @@ CodeSpaceWriteScope::CodeSpaceWriteScope(NativeModule*) { #else // !V8_HAS_PTHREAD_JIT_WRITE_PROTECT CodeSpaceWriteScope::CodeSpaceWriteScope(NativeModule* native_module) : native_module_(native_module) { -#ifdef DEBUG - if (code_space_write_nesting_level_ == 0) { - current_native_module_ = native_module; - } - DCHECK_EQ(native_module, current_native_module_); -#endif // DEBUG #endif // !V8_HAS_PTHREAD_JIT_WRITE_PROTECT if (code_space_write_nesting_level_ == 0) SetWritable(); code_space_write_nesting_level_++; diff --git a/src/wasm/code-space-access.h b/src/wasm/code-space-access.h index b76effd08f..96f852e63b 100644 --- a/src/wasm/code-space-access.h +++ b/src/wasm/code-space-access.h @@ -55,9 +55,6 @@ class V8_NODISCARD CodeSpaceWriteScope final { private: static thread_local int code_space_write_nesting_level_; -#if defined(DEBUG) && (!defined(V8_OS_MACOSX) || !defined(V8_HOST_ARCH_ARM64)) - static thread_local NativeModule* current_native_module_; -#endif void SetWritable() const; void SetExecutable() const;