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
For simple/most VMs, ObjectReference == Address so the object.to_address::<VM>() function call is unnecessary in ObjectReference methods. Indeed I have found cases where we don't have a VM type parameter but want to print the liveness of an object for debugging. Smuggling the VM type parameter into such places may require changing many places or just be impossible because nothing in the call stack above has a VM type parameter.
I think we should provide alternative methods in ObjectReference that remove the use of to_address::<VM>() in favour of directly using Address(self.0.get()) where self is an ObjectReference.
We can add debug asserts to these functions which assert that the object reference and address are indeed the same to prevent developers from misusing this API.