File tree 3 files changed +11
-11
lines changed
3 files changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -262,7 +262,7 @@ impl<VM: VMBinding> crate::plan::generational::global::GenerationalPlanExt<VM> f
262
262
self . immix
263
263
. immix_space
264
264
. trace_object_without_moving ( queue, object)
265
- } else if self . immix . immix_space . is_nursery_copy_enabled ( ) {
265
+ } else if self . immix . immix_space . prefer_copy_on_nursery_gc ( ) {
266
266
let ret = self . immix . immix_space . trace_object_with_opportunistic_copy (
267
267
queue,
268
268
object,
Original file line number Diff line number Diff line change @@ -65,18 +65,20 @@ impl Defrag {
65
65
/// Determine whether the current GC should do defragmentation.
66
66
pub fn decide_whether_to_defrag (
67
67
& self ,
68
+ defrag_enabled : bool ,
68
69
emergency_collection : bool ,
69
70
collect_whole_heap : bool ,
70
71
collection_attempts : usize ,
71
72
user_triggered : bool ,
72
73
exhausted_reusable_space : bool ,
73
74
full_heap_system_gc : bool ,
74
75
) {
75
- let in_defrag = emergency_collection
76
- || ( collection_attempts > 1 )
77
- || !exhausted_reusable_space
78
- || super :: STRESS_DEFRAG
79
- || ( collect_whole_heap && user_triggered && full_heap_system_gc) ;
76
+ let in_defrag = defrag_enabled
77
+ && ( emergency_collection
78
+ || ( collection_attempts > 1 )
79
+ || !exhausted_reusable_space
80
+ || super :: STRESS_DEFRAG
81
+ || ( collect_whole_heap && user_triggered && full_heap_system_gc) ) ;
80
82
info ! ( "Defrag: {}" , in_defrag) ;
81
83
probe ! ( mmtk, immix_defrag, in_defrag) ;
82
84
self . in_defrag_collection
Original file line number Diff line number Diff line change @@ -124,7 +124,7 @@ impl<VM: VMBinding> SFT for ImmixSpace<VM> {
124
124
VM :: VMObjectModel :: LOCAL_PINNING_BIT_SPEC . is_object_pinned :: < VM > ( object)
125
125
}
126
126
fn is_movable ( & self ) -> bool {
127
- !self . is_defrag_enabled ( ) && ! self . is_nursery_copy_enabled ( )
127
+ !self . space_args . never_move_objects
128
128
}
129
129
130
130
#[ cfg( feature = "sanity" ) ]
@@ -369,10 +369,8 @@ impl<VM: VMBinding> ImmixSpace<VM> {
369
369
user_triggered_collection : bool ,
370
370
full_heap_system_gc : bool ,
371
371
) -> bool {
372
- if !self . is_defrag_enabled ( ) {
373
- return false ;
374
- }
375
372
self . defrag . decide_whether_to_defrag (
373
+ self . is_defrag_enabled ( ) ,
376
374
emergency_collection,
377
375
collect_whole_heap,
378
376
collection_attempts,
@@ -896,7 +894,7 @@ impl<VM: VMBinding> GCWork<VM> for PrepareBlockState<VM> {
896
894
continue ;
897
895
}
898
896
// Check if this block needs to be defragmented.
899
- let is_defrag_source = if self . space . space_args . never_move_objects {
897
+ let is_defrag_source = if ! self . space . is_defrag_enabled ( ) {
900
898
// Do not set any block as defrag source if defrag is disabled.
901
899
false
902
900
} else if super :: DEFRAG_EVERY_BLOCK {
You can’t perform that action at this time.
0 commit comments