-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ObjectReference should be opaque #686
Comments
I grepped all use cases of
These can be categorised:
So MMTk core attempts to get the address of |
How to get the SFT without We can use the
I think this is enough. The SFTMap maps much coarser regions (chunks, spaces) to SFT instances. As long as no object crosses chunks, it is OK to use any bytes within an object. We use SFT during tracing, and it is performance critical. I don't think a subtraction matters that much (as long as |
For metadata access, I think it depends on the granularity of the metadata, and whether it is header metadata and side metadata. The finest grain metadata I know is the field logging bitmap. It has one bit per word, or half of a word if OpenJDK uses compressed OOPS. It has nothing to do with ObjectReference itself. It is indexed from field addresses. Per-object header metadata are already implemented by the VM. Currently we allows the VM to configure its
Because Per-object side metadata needs to be implemented with MMTk core's aid. Side metadata essentially maps addresses in MMTk spaces to metadata bits, not objects. So the mapping from
To make it "per-object", there must be a one-to-one correspondence (bijection) between ObjectReference and the "address in an object". While the result of
But it does not require I suggest we do introduce a concept. I made up the term "canonical object reference address", or "canonical in-object address", or "canonical side metadata data address of an object". Whatever, that address shall satisfy:
So we can lookup per-object side metadata like Coarser grain side metadata include page-granular or space-granular metadata. MallocSpace has an "active pages" metadata, but it is currently unused. I don't know what should be the replacement. If we consider SFT table as one-word-per-chunk metadata, we can use |
Summarizing comments I've made elsewhere: We should have two opaque types:
Both of these types should have functions to load a value from the heap and store to the heap:
The above functions deal with the likelihood that the in-heap representation of each type differs from the default value representation. For example, these functions can abstract over pointer compression. Both of these types should have a Additionally, The implementation of the types (data and function) is left to the VM binding. The core must treat them as opaque. When enqueuing edges to be traced, these may either be pointers to |
When you say 'the address of the start of the underlying object', is it the same as the allocation address that we return from our |
We discussed this. Our I feel this would cause some confusion as well: our With |
We need to be clear about what needs to be done for this issue. |
ObjectReference is supposed to be an opaque type defined by the VM.
However, it has not been consistently implemented this way, with some points in the code assuming that it is an address.
This is a case of abstraction leakage. The way the runtime encodes an object reference should be opaque to MMTk. This has been the design intention since the original MMTk. This opacity should not come at any cost due to MMTk's design. In the case of a VM for which an ObjectReference encoded as the address of the start of the object, then the conversion will cost nothing. For other VMs (such as JikesRVM) which have a constant offset, then the conversion will cost an addition. For VMs that use an indirection (ie a handle) the conversion will cost an indirection.
The text was updated successfully, but these errors were encountered: