Currently JSRuntime::rtLock is only used to protect the management of JSRuntime::state. The latter in turn exists only to support embedding that can create their first JSContext instance and destroy the last instance from an arbitrary thread. As neither browser nor shell needs this functionality, we can remove the rtLock and any related fields.
AFAICS it should be possible to do that now even if we would need to postpone a switch to single-threaded runtime due to potential compatibility concerns.
Created attachment 589301 [details] [diff] [review]
The patch replaces JSRuntime::state checks with a query on whether the runtime has any contexts.
Comment on attachment 589301 [details] [diff] [review]