-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Require object reference to be aligned (#1159)
This PR adds some assumptions about object reference, and the conversion between object reference and in-object address. To be specific, this PR requires the following: * Object reference needs to be word aligned * There must be an constant offset between object reference and in-object address. With these requirements, we can do the following computation to find object reference for internal pointers: 1. Use `ref_to_address` with the internal pointer to get the in-object address for the internal pointer. 1. Find the last VO bit that is set. 2. Calculate the data address for the bit. This address is aligned to the VO bit region. 3. Use `address_to_ref` with the data address above. The return value is an object reference, but may not be a valid one. 4. Use the word alignment to find the actual object reference 5. Get the object size from the object reference, and make sure that the internal pointer is actually pointing into the object Step 1 is necessary if the internal pointer is before the in-object address. If we concern about the invalid object reference in `ref_to_address` and `address_to_ref`, we could consider removing the two functions, and use a constant offset instead.
- Loading branch information
Showing
12 changed files
with
147 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.