@@ -79,7 +79,7 @@ impl Scanning<JuliaVM> for VMScanning {
7979 TASK_ROOTS . lock ( ) . unwrap ( ) . insert (
8080 ObjectReference :: from_raw_address_unchecked ( Address :: from_ptr ( task) ) ,
8181 ) ;
82- log:: info !(
82+ log:: debug !(
8383 "Processing root task: {:?}" ,
8484 ObjectReference :: from_raw_address_unchecked( Address :: from_ptr( task) )
8585 ) ;
@@ -120,43 +120,33 @@ impl Scanning<JuliaVM> for VMScanning {
120120 use crate :: conservative:: is_potential_mmtk_object;
121121 use crate :: conservative:: CONSERVATIVE_ROOTS ;
122122
123- let mut eh = ( * task) . eh ;
124- loop {
125- if !eh. is_null ( ) {
126- // conservatively deal with the scope objects
127- // FIXME: we could potentially just add them to the node_buffer
128- let scope_address = Address :: from_ptr ( ( * eh) . scope ) ;
129- if let Some ( obj) = is_potential_mmtk_object ( scope_address) {
130- CONSERVATIVE_ROOTS . lock ( ) . unwrap ( ) . insert ( obj) ;
131- }
123+ // NB: task.eh has a field `struct _jl_handler_t *prev` but it does not seem
124+ // like we need to traverse the whole list to capture all the handlers.
125+ // We might need to confirm this with the Julia devs.
126+ let eh = ( * task) . eh ;
127+
128+ if !eh. is_null ( ) {
129+ // FIXME: we could potentially just add these to the node_buffer
130+ let scope_address = Address :: from_ptr ( ( * eh) . scope ) ;
131+ if let Some ( obj) = is_potential_mmtk_object ( scope_address) {
132+ CONSERVATIVE_ROOTS . lock ( ) . unwrap ( ) . insert ( obj) ;
133+ }
132134
133- // conservatively scan eh_ctx and potentially traverse the list of handlers (_jl_handler_t *prev)
134- let sigjump_buf = ( * eh) . eh_ctx [ 0 ] . __jmpbuf ;
135- for buff in sigjump_buf {
135+ if let Some ( jmpbuf) = ( * eh) . eh_ctx . get ( 0 ) {
136+ for buff in jmpbuf. __jmpbuf {
136137 if let Some ( obj) =
137138 is_potential_mmtk_object ( Address :: from_usize ( buff as usize ) )
138139 {
139- // println!(
140- // "buf_addr (mmtk object) = {:x} from root task = {:?}, type = {}",
141- // buff,
142- // task,
143- // crate::julia_scanning::get_julia_object_type(
144- // Address::from_usize(buff as usize)
145- // )
146- // );
147140 CONSERVATIVE_ROOTS . lock ( ) . unwrap ( ) . insert ( obj) ;
148141 }
149142 }
143+ } ;
150144
151- // Another option, call conservative_scan_range on the __jmpbuf array
152- // use crate::conservative::conservative_scan_range;
153- // use crate::conservative::get_range;
154- // let (lo, hi) = get_range(&(*eh).eh_ctx[0].__jmpbuf);
155- // conservative_scan_range(lo, hi);
156- eh = ( * eh) . prev ;
157- } else {
158- break ;
159- }
145+ // // Another option, call conservative_scan_range on the __jmpbuf array
146+ // use crate::conservative::conservative_scan_range;
147+ // use crate::conservative::get_range;
148+ // let (lo, hi) = get_range(&(*eh).eh_ctx[0].__jmpbuf);
149+ // conservative_scan_range(lo, hi);
160150 }
161151 }
162152
0 commit comments