author Nicholas D. Matsakis <>
Tue, 06 Nov 2012 22:32:01 -0500
changeset 120446 651dc9d52259884f7c3924334581530a85fa2dcb
parent 114326 acd23e460291f32a881c994ec6d0374df3e00cb0
permissions -rw-r--r--
Bug 807480 - Add Rooted<T> roots to PerThread state. r=luke Currently there are a number of global fields in JSRuntime* which are basically tracking per-thread state. This makes sense on the current trunk since there is only ever a single thread associated with a runtime, but as Parallel JS (nee Rivertrail) starts to land this assumption no longer holds. This patch makes a struct, currently called |JS::PerThreadData|, that stores per-thread data from the runtime. There is one instance of this struct embedded in "Runtime" itself (the field |mainThread|). For now I have only migrated the debug GC fields into |PerThread|, those are the ones causing me immediate pain. Eventually more fields will want to move into there. The eventual goal is to distinguish thread-safe code, which will take as argument a |JS::PerThread*|, from non-thread-safe code, which will take a |JSRuntime*| or |JSContext*|.

# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at

# empty file to block B2G/Gonk from trying to build anything inside mozilla-central