@@ -1502,8 +1502,13 @@ JL_DLLEXPORT jl_value_t *jl_debug_method_invalidation(int state)
1502
1502
static void invalidate_method_instance (jl_method_instance_t * replaced , size_t max_world , int depth )
1503
1503
{
1504
1504
if (_jl_debug_method_invalidation ) {
1505
+ jl_value_t * boxeddepth = NULL ;
1506
+ JL_GC_PUSH2 (& _jl_debug_method_invalidation , boxeddepth );
1505
1507
jl_array_ptr_1d_push (_jl_debug_method_invalidation , (jl_value_t * )replaced );
1506
- jl_array_ptr_1d_push (_jl_debug_method_invalidation , jl_box_int32 (depth ));
1508
+ boxeddepth = jl_box_int32 (depth );
1509
+ jl_array_ptr_1d_push (_jl_debug_method_invalidation , boxeddepth );
1510
+ jl_gc_wb (_jl_debug_method_invalidation , boxeddepth );
1511
+ JL_GC_POP ();
1507
1512
}
1508
1513
if (!jl_is_method (replaced -> def .method ))
1509
1514
return ; // shouldn't happen, but better to be safe
@@ -1631,8 +1636,13 @@ static int invalidate_mt_cache(jl_typemap_entry_t *oldentry, void *closure0)
1631
1636
}
1632
1637
if (intersects ) {
1633
1638
if (_jl_debug_method_invalidation ) {
1639
+ jl_value_t * loctag = NULL ;
1640
+ JL_GC_PUSH2 (& _jl_debug_method_invalidation , & loctag );
1634
1641
jl_array_ptr_1d_push (_jl_debug_method_invalidation , (jl_value_t * )mi );
1635
- jl_array_ptr_1d_push (_jl_debug_method_invalidation , jl_cstr_to_string ("mt" ));
1642
+ loctag = jl_cstr_to_string ("mt" );
1643
+ jl_gc_wb (_jl_debug_method_invalidation , loctag );
1644
+ jl_array_ptr_1d_push (_jl_debug_method_invalidation , loctag );
1645
+ JL_GC_POP ();
1636
1646
}
1637
1647
oldentry -> max_world = env -> max_world ;
1638
1648
}
@@ -1700,7 +1710,7 @@ JL_DLLEXPORT void jl_method_table_insert(jl_methtable_t *mt, jl_method_t *method
1700
1710
method -> primary_world = ++ jl_world_counter ;
1701
1711
size_t max_world = method -> primary_world - 1 ;
1702
1712
int invalidated = 0 ;
1703
- JL_GC_PUSH1 (& oldvalue );
1713
+ JL_GC_PUSH2 (& oldvalue , & _jl_debug_method_invalidation );
1704
1714
JL_LOCK (& mt -> writelock );
1705
1715
// first delete the existing entry (we'll disable it later)
1706
1716
struct jl_typemap_assoc search = {(jl_value_t * )type , method -> primary_world , NULL , 0 , ~(size_t )0 };
0 commit comments