1
- use crate :: scanning:: EDGES_BUFFER_CAPACITY ;
1
+ use crate :: scanning:: SLOTS_BUFFER_CAPACITY ;
2
2
use crate :: unboxed_size_constants:: * ;
3
3
use crate :: JikesRVM ;
4
- use crate :: JikesRVMEdge ;
4
+ use crate :: JikesRVMSlot ;
5
5
use entrypoint:: * ;
6
6
use java_size_constants:: * ;
7
7
use mmtk:: scheduler:: * ;
@@ -26,7 +26,7 @@ static REFS: AtomicUsize = AtomicUsize::new(0);
26
26
27
27
pub fn scan_boot_image (
28
28
_tls : OpaquePointer ,
29
- factory : & mut impl RootsWorkFactory < JikesRVMEdge > ,
29
+ factory : & mut impl RootsWorkFactory < JikesRVMSlot > ,
30
30
subwork_id : usize ,
31
31
total_subwork : usize ,
32
32
) {
@@ -48,22 +48,22 @@ pub fn scan_boot_image(
48
48
ROOTS . store ( 0 , Ordering :: Relaxed ) ;
49
49
REFS . store ( 0 , Ordering :: Relaxed ) ;
50
50
51
- let mut edges = vec ! [ ] ;
51
+ let mut slots = vec ! [ ] ;
52
52
while cursor < map_end {
53
53
trace ! ( "Processing chunk at {:x}" , cursor) ;
54
- process_chunk ( cursor, image_start, map_start, map_end, |edge | {
55
- edges . push ( edge ) ;
56
- if edges . len ( ) >= EDGES_BUFFER_CAPACITY {
57
- let new_edges =
58
- mem:: replace ( & mut edges , Vec :: with_capacity ( EDGES_BUFFER_CAPACITY ) ) ;
59
- factory. create_process_edge_roots_work ( new_edges ) ;
54
+ process_chunk ( cursor, image_start, map_start, map_end, |slot | {
55
+ slots . push ( slot ) ;
56
+ if slots . len ( ) >= SLOTS_BUFFER_CAPACITY {
57
+ let new_slots =
58
+ mem:: replace ( & mut slots , Vec :: with_capacity ( SLOTS_BUFFER_CAPACITY ) ) ;
59
+ factory. create_process_roots_work ( new_slots ) ;
60
60
}
61
61
} ) ;
62
62
trace ! ( "Chunk processed successfully" ) ;
63
63
cursor += stride;
64
64
}
65
- if !edges . is_empty ( ) {
66
- factory. create_process_edge_roots_work ( edges ) ;
65
+ if !slots . is_empty ( ) {
66
+ factory. create_process_roots_work ( slots ) ;
67
67
}
68
68
}
69
69
}
@@ -73,7 +73,7 @@ fn process_chunk(
73
73
image_start : Address ,
74
74
_map_start : Address ,
75
75
map_end : Address ,
76
- mut report_edge : impl FnMut ( Address ) ,
76
+ mut report_slot : impl FnMut ( Address ) ,
77
77
) {
78
78
let mut value: usize ;
79
79
let mut offset: usize = 0 ;
@@ -106,7 +106,7 @@ fn process_chunk(
106
106
if cfg ! ( feature = "debug" ) {
107
107
ROOTS . fetch_add ( 1 , Ordering :: Relaxed ) ;
108
108
}
109
- report_edge ( slot) ;
109
+ report_slot ( slot) ;
110
110
}
111
111
if runlength != 0 {
112
112
for _ in 0 ..runlength {
@@ -121,7 +121,7 @@ fn process_chunk(
121
121
ROOTS . fetch_add ( 1 , Ordering :: Relaxed ) ;
122
122
}
123
123
// TODO: check_reference(slot) ?
124
- report_edge ( slot) ;
124
+ report_slot ( slot) ;
125
125
}
126
126
}
127
127
}
@@ -141,13 +141,13 @@ fn decode_long_encoding(cursor: Address) -> usize {
141
141
}
142
142
}
143
143
144
- pub struct ScanBootImageRoots < F : RootsWorkFactory < JikesRVMEdge > > {
144
+ pub struct ScanBootImageRoots < F : RootsWorkFactory < JikesRVMSlot > > {
145
145
factory : F ,
146
146
subwork_id : usize ,
147
147
total_subwork : usize ,
148
148
}
149
149
150
- impl < F : RootsWorkFactory < JikesRVMEdge > > ScanBootImageRoots < F > {
150
+ impl < F : RootsWorkFactory < JikesRVMSlot > > ScanBootImageRoots < F > {
151
151
pub fn new ( factory : F , subwork_id : usize , total_subwork : usize ) -> Self {
152
152
Self {
153
153
factory,
@@ -157,7 +157,7 @@ impl<F: RootsWorkFactory<JikesRVMEdge>> ScanBootImageRoots<F> {
157
157
}
158
158
}
159
159
160
- impl < F : RootsWorkFactory < JikesRVMEdge > > GCWork < JikesRVM > for ScanBootImageRoots < F > {
160
+ impl < F : RootsWorkFactory < JikesRVMSlot > > GCWork < JikesRVM > for ScanBootImageRoots < F > {
161
161
fn do_work ( & mut self , _worker : & mut GCWorker < JikesRVM > , _mmtk : & ' static MMTK < JikesRVM > ) {
162
162
scan_boot_image (
163
163
OpaquePointer :: UNINITIALIZED ,
0 commit comments