-
Notifications
You must be signed in to change notification settings - Fork 75
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
Require ObjectReference to point inside object #1195
Conversation
This makes changes for upstream API changes. Upstream PR: mmtk/mmtk-core#1195
This makes changes for upstream API changes. Upstream PR: mmtk/mmtk-core#1195
This makes changes for upstream API changes. Upstream PR: mmtk/mmtk-core#1195 Fixes: mmtk#178
This section in the porting guide should be updated: https://docs.mmtk.io/portingguide/howto/nogc.html#objectreference-vs-address. It would be better to add an example to reference the pattern in JikesRVM to deal with different language/VM-level object reference and MMTK-level object reference. |
This makes changes for upstream API changes. Upstream PR: mmtk/mmtk-core#1195
This makes changes for upstream API changes. Upstream PR: mmtk/mmtk-core#1195
This makes changes for upstream API changes. Upstream PR: mmtk/mmtk-core#1195
This makes changes for upstream API changes. Upstream PR: mmtk/mmtk-core#1195
binding-refs |
More details about Address vs ObjectReference Emphasize that ObjectReference is nominated by the binding
I added more details to that section. I also changed the "Allocation" section below to emphasize that the VM binding shall nominate an address used for |
With the change of this PR, It may be more costly for VMs like JikesRVM to convert between VM-level object reference and Anyway, this is just some thoughts. I will review the PRs tomorrow. |
It may be easy to compute the starting address from the ObjectReference (which usually points at the header, or at a constant offset from the header), but the other way (i.e. computing the ObjectReference, the header, or whatever needed to access in-object metadata) may not be easy, if possible at all. One example is JikesRVM. Given the staring address, MMTk may call Another example is SableVM. Its header is in the middle of the object. Reference and non-reference fields span towards both directions. In this case, it is impossible to find the header when given the starting address because the fields can simply contain arbitrary data that may look like the header. So it has to be decided by the VM binding for now, to find a middle ground between a simple API and make it efficient to find object metadata. Speaking of metadata, I think |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code is good. The document needs a bit improvement to make it clear about our reuirement for ObjectReference
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This makes changes for upstream API changes. Upstream PR: mmtk/mmtk-core#1195 --------- Co-authored-by: mmtkgc-bot <mmtkgc.bot@gmail.com>
This makes changes for upstream API changes. Upstream PR: mmtk/mmtk-core#1195 --------- Co-authored-by: mmtkgc-bot <mmtkgc.bot@gmail.com>
This makes changes for upstream API changes. Upstream PR: mmtk/mmtk-core#1195 --------- Co-authored-by: mmtkgc-bot <mmtkgc.bot@gmail.com>
This makes changes for upstream API changes. Upstream PR: mmtk/mmtk-core#1195 Fixes: #178 --------- Co-authored-by: mmtkgc-bot <mmtkgc.bot@gmail.com>
This makes changes for upstream API changes. Upstream PR: mmtk/mmtk-core#1195 --------- Co-authored-by: mmtkgc-bot <mmtkgc.bot@gmail.com>
This makes changes for upstream API changes. Upstream PR: mmtk/mmtk-core#1195 --------- Co-authored-by: mmtkgc-bot <mmtkgc.bot@gmail.com>
This makes changes for upstream API changes. Upstream PR: mmtk/mmtk-core#1195 --------- Co-authored-by: mmtkgc-bot <mmtkgc.bot@gmail.com>
Require the raw address of
ObjectReference
to be within the address range of the object it refers to. The raw address is now used directly for side metadata access and SFT dispatching. This makes "in-object address" unnecessary, and we removed the concept of "in-object address" and related constants and methods.Methods which use the "in-object address" for SFT dispatching or side-metadata access used to have a
<VM: VMBinding>
type parameter. This PR removes that type parameter.Because
ObjectReference
is now both within an object an word-aligned, the algorithm for searching for VO bits from internal pointers is slightly simplified. The methodis_mmtk_object
now has undefined behavior for arguments that are zero or misaligned because they are obviously illegal addresses forObjectReference
, and the user should have filtered them out in the first place.Fixes: #1170