You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How easy/hard is it to introduce write barriers to the language? Just wondering if there was a simple way to enable write barriers so that I could experiment with different GC schemes outside of the current conservative GC.
What I'm thinking is that there'd be some kind of compiler hook, perhaps a template in druntime, that gets instantiated when a pointer is written to. This lets druntime code decide how exactly to implement the write barrier -- depending on what kind of GC is implemented and what it needs -- without needing to change the compiler all the time. Ideally something like GC.writeBarrier(prevptr, newptr); or something like that.
In a more advanced iteration we might add annotations (UDAs perhaps) to tell the compiler where write barriers may be elided, and other such characteristics that may help the optimizer eliminate them where they're not necessary for correct GC operation.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
How easy/hard is it to introduce write barriers to the language? Just wondering if there was a simple way to enable write barriers so that I could experiment with different GC schemes outside of the current conservative GC.
What I'm thinking is that there'd be some kind of compiler hook, perhaps a template in druntime, that gets instantiated when a pointer is written to. This lets druntime code decide how exactly to implement the write barrier -- depending on what kind of GC is implemented and what it needs -- without needing to change the compiler all the time. Ideally something like
GC.writeBarrier(prevptr, newptr);
or something like that.In a more advanced iteration we might add annotations (UDAs perhaps) to tell the compiler where write barriers may be elided, and other such characteristics that may help the optimizer eliminate them where they're not necessary for correct GC operation.
Beta Was this translation helpful? Give feedback.
All reactions