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
17 changes: 9 additions & 8 deletions gc/gc_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,15 @@ GC_IMPL_FN VALUE rb_gc_impl_new_obj(void *objspace_ptr, void *cache_ptr, VALUE k
* generated instruction sequence; see zjit/src/gc_fastpath.rs.
*/
GC_IMPL_FN bool rb_gc_impl_zjit_new_obj_fastpath(void *objspace_ptr, size_t alloc_size, VALUE flags, VALUE klass, struct rb_gc_zjit_fastpath *fastpath);
/* Returns a pointer to a word that is nonzero while incremental marking is in
* progress, or NULL if the implementation does not support ZJIT's inline write
* barrier fast path. ZJIT-generated code skips the call to rb_gc_writebarrier()
* when the receiver has neither RUBY_FL_PROMOTED nor RUBY_FL_SHAREABLE set and
* this word is zero, so only implementations whose write barrier is a no-op
* under exactly those conditions may return non-NULL.
/* Returns the offset of a word inside the objspace that is nonzero while that
* objspace is incremental-marking, or -1 if the implementation does not support
* ZJIT's inline write barrier fast path. ZJIT-generated code skips the call to
* rb_gc_writebarrier() when the receiver has neither RUBY_FL_PROMOTED nor
* RUBY_FL_SHAREABLE set and the word of the current Ractor's objspace is zero,
* so only implementations whose write barrier is a no-op under exactly those
* conditions may return a nonnegative offset.
*/
GC_IMPL_FN const uintptr_t *rb_gc_impl_zjit_writebarrier_required_p_ptr(void *objspace_ptr);
GC_IMPL_FN int32_t rb_gc_impl_zjit_writebarrier_required_offset(void);
GC_IMPL_FN size_t rb_gc_impl_obj_slot_size(VALUE obj);
GC_IMPL_FN size_t rb_gc_impl_size_slot_size(void *objspace_ptr, size_t size);
GC_IMPL_FN bool rb_gc_impl_size_allocatable_p(size_t size);
Expand Down Expand Up @@ -152,7 +153,7 @@ GC_IMPL_FN bool rb_gc_impl_during_postmortem_p(void *objspace_ptr);
* objspace impl. */
GC_IMPL_FN bool rb_gc_impl_obj_foreign_p(void *objspace_ptr, VALUE obj);
GC_IMPL_FN bool rb_gc_impl_shref_marked_p(void *objspace_ptr, VALUE obj);
GC_IMPL_FN size_t rb_gc_impl_heap_page_count(void *objspace_ptr);
GC_IMPL_FN size_t rb_gc_impl_zombie_heap_page_count(void *objspace_ptr);
GC_IMPL_FN void rb_gc_impl_objspace_absorb(void *dst_ptr, void *src_ptr);
GC_IMPL_FN void rb_gc_impl_each_object(void *objspace_ptr, void (*func)(VALUE obj, void *data), void *data);
// Finalizers
Expand Down
8 changes: 4 additions & 4 deletions gc/mmtk/mmtk.c
Original file line number Diff line number Diff line change
Expand Up @@ -742,12 +742,12 @@ rb_gc_impl_zjit_new_obj_fastpath(void *objspace_ptr, size_t alloc_size, VALUE fl
#endif
}

const uintptr_t *
rb_gc_impl_zjit_writebarrier_required_p_ptr(void *objspace_ptr)
int32_t
rb_gc_impl_zjit_writebarrier_required_offset(void)
{
/* MMTk's write barrier is not a no-op for young, unshareable receivers,
* so ZJIT must always call rb_gc_writebarrier(). */
return NULL;
return -1;
}

void
Expand Down Expand Up @@ -1859,7 +1859,7 @@ rb_gc_impl_shref_marked_p(void *objspace_ptr, VALUE obj)
}

size_t
rb_gc_impl_heap_page_count(void *objspace_ptr)
rb_gc_impl_zombie_heap_page_count(void *objspace_ptr)
{
/* With a single objspace zombie_objspaces is always empty. */
return 0;
Expand Down
Loading