Bug 170027 - Consider changing MachineThreads::m_registeredThreads to be a linked list of WTFThreadData.
Summary: Consider changing MachineThreads::m_registeredThreads to be a linked list of ...
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Yusuke Suzuki
Depends on: 170502
  Show dependency treegraph
Reported: 2017-03-23 15:07 PDT by Mark Lam
Modified: 2018-04-01 12:27 PDT (History)
6 users (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Mark Lam 2017-03-23 15:07:32 PDT
Currently, MachineThreads instantiates MachineThreads::Thread (which is just a linked list node) that points to MachineThreads::ThreadData (a thread specific record that basically copies the content of WTFThreadData i.e. the stack bounds, and adds a few other things).  In order to instantiate the MachineThreads::ThreadData, the code needs to consult (and thereby create) the WTFThreadData instance anyway.

If we can lower PlatformThread to the WTF layer (and unify it with whatever representation of a thread id we have there e.g. that which is returned by currentThread()), then we can add that to WTFThreadData.  I think it is also fine to add the other platform specific MachineThreads::ThreadData fields to WTFThreadData as well.

Note: a side detail, we used to copy the stack bounds base and end.  Instead, we can change MachineStackMarker.cpp to use StackBounds::contains() instead to check the stack bounds.
Comment 1 Yusuke Suzuki 2018-04-01 12:27:16 PDT
MachineThreads are converted to WTF::ThreadGroup.