mirror of
https://github.com/servo/servo.git
synced 2025-09-30 00:29:14 +01:00
script: Reduce ScriptThread TLS usage (#38875)
We store a pointer to the ScriptThread singleton for a thread in thread-local storage. While we don't have yet have profiles pointing to this TLS access as a hot spot, we can remove a potential performance footgun without a lot of effort by passing around small pieces of data that we otherwise need to fetch from the ScriptThread. Testing: Existing WPT is sufficient Fixes: part of #37969 --------- Signed-off-by: Josh Matthews <josh@joshmatthews.net>
This commit is contained in:
parent
d1da1a995c
commit
c97ec1b2fb
17 changed files with 129 additions and 68 deletions
|
@ -1044,8 +1044,12 @@ enum BackupElementQueueFlag {
|
|||
}
|
||||
|
||||
/// <https://html.spec.whatwg.org/multipage/#custom-element-reactions-stack>
|
||||
/// # Safety
|
||||
/// This can be shared inside an Rc because one of those Rc copies lives
|
||||
/// inside ScriptThread, so the GC can always reach this structure.
|
||||
#[derive(JSTraceable, MallocSizeOf)]
|
||||
#[cfg_attr(crown, crown::unrooted_must_root_lint::must_root)]
|
||||
#[cfg_attr(crown, crown::unrooted_must_root_lint::allow_unrooted_in_rc)]
|
||||
pub(crate) struct CustomElementReactionStack {
|
||||
stack: DomRefCell<Vec<ElementQueue>>,
|
||||
backup_queue: ElementQueue,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue