@@ -3,11 +3,10 @@ use std::sync::atomic::Ordering;
3
3
use super :: UPCALLS ;
4
4
use crate :: { vm_metadata, OpenJDK } ;
5
5
use mmtk:: util:: alloc:: fill_alignment_gap;
6
+ use mmtk:: util:: copy:: * ;
6
7
use mmtk:: util:: metadata:: header_metadata:: HeaderMetadataSpec ;
7
8
use mmtk:: util:: { Address , ObjectReference } ;
8
9
use mmtk:: vm:: * ;
9
- use mmtk:: AllocationSemantics ;
10
- use mmtk:: CopyContext ;
11
10
12
11
pub struct VMObjectModel { }
13
12
@@ -87,19 +86,18 @@ impl ObjectModel<OpenJDK> for VMObjectModel {
87
86
#[ inline]
88
87
fn copy (
89
88
from : ObjectReference ,
90
- allocator : AllocationSemantics ,
91
- copy_context : & mut impl CopyContext ,
89
+ copy : CopySemantics ,
90
+ copy_context : & mut GCWorkerCopyContext < OpenJDK > ,
92
91
) -> ObjectReference {
93
92
let bytes = unsafe { ( ( * UPCALLS ) . get_object_size ) ( from) } ;
94
- let dst =
95
- copy_context. alloc_copy ( from, bytes, :: std:: mem:: size_of :: < usize > ( ) , 0 , allocator) ;
93
+ let dst = copy_context. alloc_copy ( from, bytes, :: std:: mem:: size_of :: < usize > ( ) , 0 , copy) ;
96
94
// Copy
97
95
let src = from. to_address ( ) ;
98
96
for i in 0 ..bytes {
99
97
unsafe { ( dst + i) . store ( ( src + i) . load :: < u8 > ( ) ) } ;
100
98
}
101
99
let to_obj = unsafe { dst. to_object_reference ( ) } ;
102
- copy_context. post_copy ( to_obj, unsafe { Address :: zero ( ) } , bytes, allocator ) ;
100
+ copy_context. post_copy ( to_obj, bytes, copy ) ;
103
101
to_obj
104
102
}
105
103
0 commit comments