Last Comment Bug 718600 - remove JSRuntime::(rtLock, state)
: remove JSRuntime::(rtLock, state)
Product: Core
Classification: Components
Component: JavaScript Engine (show other bugs)
: unspecified
: All All
-- normal (vote)
: mozilla12
Assigned To: Igor Bukanov
: Jason Orendorff [:jorendorff]
Depends on:
  Show dependency treegraph
Reported: 2012-01-17 04:03 PST by Igor Bukanov
Modified: 2012-01-19 02:38 PST (History)
2 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

v1 (23.80 KB, patch)
2012-01-17 14:26 PST, Igor Bukanov
luke: review+
Details | Diff | Splinter Review

Description User image Igor Bukanov 2012-01-17 04:03:36 PST
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.
Comment 1 User image Igor Bukanov 2012-01-17 14:26:00 PST
Created attachment 589301 [details] [diff] [review]

The patch replaces JSRuntime::state checks with a query on whether the runtime has any contexts.
Comment 2 User image Luke Wagner [:luke] 2012-01-17 16:29:42 PST
Comment on attachment 589301 [details] [diff] [review]

Right on.
Comment 4 User image Marco Bonardo [::mak] 2012-01-19 02:38:37 PST

Note You need to log in before you can comment on or make changes to this bug.