@@ -1182,37 +1182,11 @@ JL_DLLEXPORT void jl_free_stack(void *stkbuf, size_t bufsz);
1182
1182
// thread-local allocator of the current thread.
1183
1183
JL_DLLEXPORT jl_weakref_t * jl_gc_new_weakref (jl_value_t * value );
1184
1184
1185
- // GC write barriers
1186
-
1187
- STATIC_INLINE void jl_gc_wb (const void * parent , const void * ptr ) JL_NOTSAFEPOINT
1188
- {
1189
- // parent and ptr isa jl_value_t*
1190
- if (__unlikely (jl_astaggedvalue (parent )-> bits .gc == 3 /* GC_OLD_MARKED */ && // parent is old and not in remset
1191
- (jl_astaggedvalue (ptr )-> bits .gc & 1 /* GC_MARKED */ ) == 0 )) // ptr is young
1192
- jl_gc_queue_root ((jl_value_t * )parent );
1193
- }
1194
-
1195
- STATIC_INLINE void jl_gc_wb_back (const void * ptr ) JL_NOTSAFEPOINT // ptr isa jl_value_t*
1196
- {
1197
- // if ptr is old
1198
- if (__unlikely (jl_astaggedvalue (ptr )-> bits .gc == 3 /* GC_OLD_MARKED */ )) {
1199
- jl_gc_queue_root ((jl_value_t * )ptr );
1200
- }
1201
- }
1202
-
1203
- STATIC_INLINE void jl_gc_multi_wb (const void * parent , const jl_value_t * ptr ) JL_NOTSAFEPOINT
1204
- {
1205
- // 3 == GC_OLD_MARKED
1206
- // ptr is an immutable object
1207
- if (__likely (jl_astaggedvalue (parent )-> bits .gc != 3 ))
1208
- return ; // parent is young or in remset
1209
- if (__likely (jl_astaggedvalue (ptr )-> bits .gc == 3 ))
1210
- return ; // ptr is old and not in remset (thus it does not point to young)
1211
- jl_datatype_t * dt = (jl_datatype_t * )jl_typeof (ptr );
1212
- const jl_datatype_layout_t * ly = dt -> layout ;
1213
- if (ly -> npointers )
1214
- jl_gc_queue_multiroot ((jl_value_t * )parent , ptr , dt );
1215
- }
1185
+ #ifndef MMTK_GC
1186
+ #include "gc-wb-stock.h"
1187
+ #else
1188
+ #include "gc-wb-mmtk.h"
1189
+ #endif
1216
1190
1217
1191
JL_DLLEXPORT void jl_gc_safepoint (void );
1218
1192
JL_DLLEXPORT int jl_safepoint_suspend_thread (int tid , int waitstate );
0 commit comments