Skip to content

Commit

Permalink
Add more descriptive comment for OMR_SELF_FORWARDED_TAG
Browse files Browse the repository at this point in the history
Signed-off-by: Igor Braga <higorb1@gmail.com>
  • Loading branch information
bragaigor committed Jan 27, 2021
1 parent 0495e7a commit 4d3c039
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion gc/structs/ForwardedHeader.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,14 @@
This hint is not necessary for correctness of copying protocol, it's just an optimization to avoid visiting destination object header
in cases when it's likely not in data cash (GC thread encountering already forwarded object) */
#define OMR_BEING_COPIED_HINT 2
/* We define OMR_SELF_FORWARDED_TAG as 1 and not as J9_GC_MULTI_SLOT_HOLE (due to DDR pre-preprocessor limitation of not processing #includes properly) */
/* OMR_SELF_FORWARDED_TAG overloads existing J9_GC_MULTI_SLOT_HOLE 0x1. In a rare case, we may need iterating a
* Evacuate area, that may have all combinations of: non-forwarded objects (0x4 not set, 0x1 not set), strictly
* forwarded objects (0x4 set, 0x1 not set), self forwarded objects (0x4 set, 0x1 set) and free memory chunks
* (0x4 not set and 0x1 set). GC_ObjectHeapIteratorAddressOrderedList is aware of this overloading and will
* properly interpret when 0x1 flag is set.
*
* However, here we define OMR_SELF_FORWARDED_TAG directly as 1 and not as J9_GC_MULTI_SLOT_HOLE (due to DDR
* pre-preprocessor limitation of not processing #includes properly) */
#define OMR_SELF_FORWARDED_TAG 1
/* combine OMR_FORWARDED_TAG with OMR_BEING_COPIED_HINT and OMR_SELF_FORWARDED_TAG into one mask which should be stripped from the pointer in order to remove all tags */
#define OMR_FORWARDED_TAG_MASK (OMR_FORWARDED_TAG | OMR_BEING_COPIED_HINT | OMR_SELF_FORWARDED_TAG)
Expand Down

0 comments on commit 4d3c039

Please sign in to comment.