Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions gc/mmtk/mmtk.c
Original file line number Diff line number Diff line change
Expand Up @@ -439,16 +439,15 @@ rb_mmtk_update_global_tables_replace_i(VALUE *ptr, void *data)
}

static void
rb_mmtk_update_global_tables(int table)
rb_mmtk_update_global_tables(int table, bool moving)
{
MMTK_ASSERT(table < RB_GC_VM_WEAK_TABLE_COUNT);

// TODO: set weak_only to true for non-moving GC
rb_gc_vm_weak_table_foreach(
rb_mmtk_update_global_tables_i,
rb_mmtk_update_global_tables_replace_i,
NULL,
false,
!moving,
(enum rb_gc_vm_weak_tables)table
);
}
Expand Down
2 changes: 1 addition & 1 deletion gc/mmtk/mmtk.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ typedef struct MMTk_RubyUpcalls {
void (*handle_weak_references)(MMTk_ObjectReference object, bool moving);
void (*call_obj_free)(MMTk_ObjectReference object);
size_t (*vm_live_bytes)(void);
void (*update_global_tables)(int tbl_idx);
void (*update_global_tables)(int tbl_idx, bool moving);
int (*global_tables_count)(void);
void (*update_finalizer_table)(void);
bool (*special_const_p)(MMTk_ObjectReference object);
Expand Down
2 changes: 1 addition & 1 deletion gc/mmtk/src/abi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ pub struct RubyUpcalls {
pub handle_weak_references: extern "C" fn(object: ObjectReference, moving: bool),
pub call_obj_free: extern "C" fn(object: ObjectReference),
pub vm_live_bytes: extern "C" fn() -> usize,
pub update_global_tables: extern "C" fn(tbl_idx: c_int),
pub update_global_tables: extern "C" fn(tbl_idx: c_int, moving: bool),
pub global_tables_count: extern "C" fn() -> c_int,
pub update_finalizer_table: extern "C" fn(),
pub special_const_p: extern "C" fn(object: ObjectReference) -> bool,
Expand Down
5 changes: 4 additions & 1 deletion gc/mmtk/src/weak_proc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,10 @@ struct UpdateGlobalTables {
}
impl GlobalTableProcessingWork for UpdateGlobalTables {
fn process_table(&mut self) {
(crate::upcalls().update_global_tables)(self.idx)
(crate::upcalls().update_global_tables)(
self.idx,
crate::mmtk().get_plan().current_gc_may_move_object(),
)
}
}
impl GCWork<Ruby> for UpdateGlobalTables {
Expand Down
Loading