@@ -72,21 +72,20 @@ typedef struct _jl_tls_states_t *jl_ptls_t;
7272#endif 
7373#include  "gc-interface.h" 
7474#include  "julia_atomics.h" 
75- #include  "julia_threads.h" 
7675#include  "julia_assert.h" 
7776
77+ // the common fields are hidden before the pointer, but the following macro is 
78+ // used to indicate which types below are subtypes of jl_value_t 
79+ #define  JL_DATA_TYPE 
80+ typedef  struct  _jl_value_t  jl_value_t ;
81+ #include  "julia_threads.h" 
82+ 
7883#ifdef  __cplusplus 
7984extern  "C"  {
8085#endif 
8186
8287// core data types ------------------------------------------------------------ 
8388
84- // the common fields are hidden before the pointer, but the following macro is 
85- // used to indicate which types below are subtypes of jl_value_t 
86- #define  JL_DATA_TYPE 
87- 
88- typedef  struct  _jl_value_t  jl_value_t ;
89- 
9089struct  _jl_taggedvalue_bits  {
9190    uintptr_t  gc :2 ;
9291    uintptr_t  in_image :1 ;
@@ -484,9 +483,6 @@ typedef struct _jl_abi_override_t {
484483    jl_method_instance_t  * def ;
485484} jl_abi_override_t ;
486485
487- // all values are callable as Functions 
488- typedef  jl_value_t  jl_function_t ;
489- 
490486typedef  struct  {
491487    JL_DATA_TYPE 
492488    jl_sym_t  * name ;
@@ -2263,12 +2259,8 @@ JL_DLLEXPORT void jl_sigatomic_end(void);
22632259
22642260// tasks and exceptions ------------------------------------------------------- 
22652261
2266- typedef  struct  _jl_timing_block_t  jl_timing_block_t ;
2267- typedef  struct  _jl_timing_event_t  jl_timing_event_t ;
2268- typedef  struct  _jl_excstack_t  jl_excstack_t ;
2269- 
22702262// info describing an exception handler 
2271- typedef   struct  _jl_handler_t  {
2263+ struct  _jl_handler_t  {
22722264    jl_jmp_buf  eh_ctx ;
22732265    jl_gcframe_t  * gcstack ;
22742266    jl_value_t  * scope ;
@@ -2278,68 +2270,7 @@ typedef struct _jl_handler_t {
22782270    sig_atomic_t  defer_signal ;
22792271    jl_timing_block_t  * timing_stack ;
22802272    size_t  world_age ;
2281- } jl_handler_t ;
2282- 
2283- #define  JL_RNG_SIZE  5 // xoshiro 4 + splitmix 1
2284- 
2285- typedef  struct  _jl_task_t  {
2286-     JL_DATA_TYPE 
2287-     jl_value_t  * next ; // invasive linked list for scheduler 
2288-     jl_value_t  * queue ; // invasive linked list for scheduler 
2289-     jl_value_t  * tls ;
2290-     jl_value_t  * donenotify ;
2291-     jl_value_t  * result ;
2292-     jl_value_t  * scope ;
2293-     jl_function_t  * start ;
2294-     _Atomicuint8_t ) _state ;
2295-     uint8_t  sticky ; // record whether this Task can be migrated to a new thread 
2296-     uint16_t  priority ;
2297-     _Atomicuint8_t ) _isexception ; // set if `result` is an exception to throw or that we exited with 
2298-     uint8_t  pad0 [3 ];
2299-     // === 64 bytes (cache line) 
2300-     uint64_t  rngState [JL_RNG_SIZE ];
2301-     // flag indicating whether or not to record timing metrics for this task 
2302-     uint8_t  metrics_enabled ;
2303-     uint8_t  pad1 [3 ];
2304-     // timestamp this task first entered the run queue 
2305-     _Atomicuint64_t ) first_enqueued_at ;
2306-     // timestamp this task was most recently scheduled to run 
2307-     _Atomicuint64_t ) last_started_running_at ;
2308-     // time this task has spent running; updated when it yields or finishes. 
2309-     _Atomicuint64_t ) running_time_ns ;
2310-     // === 64 bytes (cache line) 
2311-     // timestamp this task finished (i.e. entered state DONE or FAILED). 
2312-     _Atomicuint64_t ) finished_at ;
2313- 
2314- // hidden state: 
2315- 
2316-     // id of owning thread - does not need to be defined until the task runs 
2317-     _Atomicint16_t ) tid ;
2318-     // threadpool id 
2319-     int8_t  threadpoolid ;
2320-     // Reentrancy bits 
2321-     // Bit 0: 1 if we are currently running inference/codegen 
2322-     // Bit 1-2: 0-3 counter of how many times we've reentered inference 
2323-     // Bit 3: 1 if we are writing the image and inference is illegal 
2324-     uint8_t  reentrant_timing ;
2325-     // 2 bytes of padding on 32-bit, 6 bytes on 64-bit 
2326-     // uint16_t padding2_32; 
2327-     // uint48_t padding2_64; 
2328-     // saved gc stack top for context switches 
2329-     jl_gcframe_t  * gcstack ;
2330-     size_t  world_age ;
2331-     // quick lookup for current ptls 
2332-     jl_ptls_t  ptls ; // == jl_all_tls_states[tid] 
2333- #ifdef  USE_TRACY 
2334-     const  char  * name ;
2335- #endif 
2336-     // saved exception stack 
2337-     jl_excstack_t  * excstack ;
2338-     // current exception handler 
2339-     jl_handler_t  * eh ;
2340-     // saved thread state 
2341-     jl_ucontext_t  ctx ; // pointer into stkbuf, if suspended 
2342- } jl_task_t ;
2273+ };
23432274
23442275#define  JL_TASK_STATE_RUNNABLE  0
23452276#define  JL_TASK_STATE_DONE      1
0 commit comments