@@ -10,6 +10,11 @@ fn test_implicit_this_root_scanner_marks_and_rewrites() {
1010 // when the cell is its only root, and (b) REWRITE the cell to the moved
1111 // copy so the body's next `this`-derived dispatch derefs live memory
1212 // instead of the stale slot (the reported SIGSEGV in js_native_call_method).
13+ // `nursery_user` is live across the `arena_alloc_gc_old` call below (used
14+ // afterwards to build `nursery_hdr`); the block-full slow path in that
15+ // allocation can reach `gc_check_trigger()`, so suppress automatic
16+ // triggers for the setup below.
17+ let _trigger_guard = GcTriggerThresholdTestGuard :: suppress_automatic_triggers ( ) ;
1318 clear_marks ( ) ;
1419 clear_mark_seeds ( ) ;
1520 let prev_this = crate :: object:: js_implicit_this_get ( ) ;
@@ -59,6 +64,12 @@ fn test_implicit_this_root_scanner_marks_and_rewrites() {
5964#[ test]
6065fn test_class_side_table_scanner_marks_values_but_not_function_keys ( ) {
6166 let _guard = GcTestIsolationGuard :: new ( ) ;
67+ // `dynamic_value`/`prototype_value`/`cached_value`/`prototype_object` are
68+ // all live across the two `arena_alloc_gc` calls below (`parent_closure`,
69+ // `function_key`), and `parent_closure` is live across `function_key`'s —
70+ // any of those allocations can reach the block-full slow path's
71+ // `gc_check_trigger()`.
72+ let _trigger_guard = GcTriggerThresholdTestGuard :: suppress_automatic_triggers ( ) ;
6273 clear_marks ( ) ;
6374 clear_mark_seeds ( ) ;
6475 crate :: object:: test_clear_class_side_table_roots ( ) ;
@@ -115,6 +126,10 @@ fn test_class_side_table_scanner_marks_values_but_not_function_keys() {
115126#[ test]
116127fn test_registered_class_side_table_scanner_rewrites_values_and_function_keys ( ) {
117128 let _guard = GcTestIsolationGuard :: new ( ) ;
129+ // `value_user` is live across `key_user`'s `arena_alloc_gc` call, and both
130+ // `value_user`/`key_user` (plus `value_old` once allocated) are live
131+ // across the remaining `arena_alloc_gc`/`arena_alloc_gc_old` calls below.
132+ let _trigger_guard = GcTriggerThresholdTestGuard :: suppress_automatic_triggers ( ) ;
118133 crate :: object:: test_clear_class_side_table_roots ( ) ;
119134 gc_register_mutable_root_scanner ( crate :: object:: scan_class_side_table_roots_mut) ;
120135
@@ -191,6 +206,10 @@ fn test_registered_class_side_table_scanner_rewrites_values_and_function_keys()
191206
192207#[ test]
193208fn test_symbol_side_table_scanner_marks_keys_and_values_without_marking_owner ( ) {
209+ // Not exposed: every allocation here goes through opaque helpers
210+ // (`js_object_alloc`, `alloc_nursery_test_symbol`, `young_leaf`) with no
211+ // direct `arena_alloc_gc`/`arena_alloc_gc_old` call written in this file,
212+ // so there is no in-file call site to guard.
194213 let _guard = GcTestIsolationGuard :: new ( ) ;
195214 clear_marks ( ) ;
196215 clear_mark_seeds ( ) ;
@@ -226,6 +245,10 @@ fn test_symbol_side_table_scanner_marks_keys_and_values_without_marking_owner()
226245#[ test]
227246fn test_symbol_side_table_registered_scanner_rewrites_roots_and_metadata ( ) {
228247 let _guard = GcTestIsolationGuard :: new ( ) ;
248+ // `owner`/`sym_key`/`value`/`static_sym_key`/`static_value` (and the
249+ // `_old` addresses as they're allocated) are all live across the three
250+ // `arena_alloc_gc_old` calls below.
251+ let _trigger_guard = GcTriggerThresholdTestGuard :: suppress_automatic_triggers ( ) ;
229252 crate :: symbol:: test_clear_symbol_side_table_roots ( ) ;
230253 gc_register_mutable_root_scanner ( crate :: symbol:: scan_symbol_side_table_roots_mut) ;
231254
@@ -307,6 +330,8 @@ fn test_symbol_side_table_registered_scanner_rewrites_roots_and_metadata() {
307330
308331#[ test]
309332fn test_runtime_root_visitor_rewrites_raw_pointer_slots ( ) {
333+ // `nursery_user` is live across the `arena_alloc_gc_old` call below.
334+ let _trigger_guard = GcTriggerThresholdTestGuard :: suppress_automatic_triggers ( ) ;
310335 let nursery_user = crate :: arena:: arena_alloc_gc ( 64 , 8 , GC_TYPE_OBJECT ) ;
311336 let valid_ptrs = build_valid_pointer_set ( ) ;
312337 let old_user = crate :: arena:: arena_alloc_gc_old ( 64 , 8 , GC_TYPE_OBJECT ) ;
@@ -353,6 +378,10 @@ fn test_class_inheritance_side_table_roots_mark_and_rewrite() {
353378 const PROTO_CID : u32 = 0xDEAD_0001 ;
354379 const CLOSURE_CID : u32 = 0xDEAD_0002 ;
355380
381+ // `proto_user`/`decl_proto_user`/`closure_user` (and the `_old` addresses
382+ // as they're allocated) are all live across the later `arena_alloc_gc`/
383+ // `arena_alloc_gc_old` calls below.
384+ let _trigger_guard = GcTriggerThresholdTestGuard :: suppress_automatic_triggers ( ) ;
356385 clear_marks ( ) ;
357386 clear_mark_seeds ( ) ;
358387
@@ -432,6 +461,8 @@ fn test_class_inheritance_side_table_roots_mark_and_rewrite() {
432461
433462#[ test]
434463fn test_runtime_root_visitor_rewrites_cell_and_atomic_slots ( ) {
464+ // `nursery_user` is live across the `arena_alloc_gc_old` call below.
465+ let _trigger_guard = GcTriggerThresholdTestGuard :: suppress_automatic_triggers ( ) ;
435466 let nursery_user = crate :: arena:: arena_alloc_gc ( 64 , 8 , GC_TYPE_OBJECT ) ;
436467 let valid_ptrs = build_valid_pointer_set ( ) ;
437468 let old_user = crate :: arena:: arena_alloc_gc_old ( 64 , 8 , GC_TYPE_OBJECT ) ;
@@ -485,6 +516,8 @@ fn test_runtime_root_visitor_rewrites_cell_and_atomic_slots() {
485516
486517#[ test]
487518fn test_runtime_root_visitor_rewrites_metadata_without_marking ( ) {
519+ // `nursery_user` is live across the `arena_alloc_gc_old` call below.
520+ let _trigger_guard = GcTriggerThresholdTestGuard :: suppress_automatic_triggers ( ) ;
488521 let nursery_user = crate :: arena:: arena_alloc_gc ( 64 , 8 , GC_TYPE_OBJECT ) ;
489522 let valid_ptrs = build_valid_pointer_set ( ) ;
490523 let old_user = crate :: arena:: arena_alloc_gc_old ( 64 , 8 , GC_TYPE_OBJECT ) ;
0 commit comments