Skip to content

Commit

Permalink
Merge pull request #4736 from jason-hall/metadata
Browse files Browse the repository at this point in the history
Move object meta data flag defines to omrgcconsts.h
  • Loading branch information
youngar authored Jan 21, 2020
2 parents 6fbe0ff + f764995 commit b08cdd2
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 26 deletions.
25 changes: 0 additions & 25 deletions gc/base/ObjectModelBase.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,31 +51,6 @@ struct OMR_VMThread;
#define OMR_MINIMUM_OBJECT_ALIGNMENT_SHIFT 3 /* base 2 log of heap alignment */
#define OMR_MINIMUM_OBJECT_SIZE 16 /* size of smallest possible object allocation, in bytes */

/**
* Bit geometry within header flags byte.
*
* NOTE: These are normalized to low-order byte. Object header flags must be right-shifted to low-order
* byte (see GC_ObjectModelBase::getObjectHeaderSlotFlagsShift()) before applying these masks/shifts and
* subsets of these masks must be left-shifted to align with object header flags.
*/
#define OMR_OBJECT_METADATA_FLAGS_BIT_COUNT 8
#define OMR_OBJECT_METADATA_FLAGS_MASK 0xFF
#define OMR_OBJECT_METADATA_AGE_MASK 0xF0
#define OMR_OBJECT_METADATA_AGE_SHIFT 4

#if (0 != (OMR_OBJECT_METADATA_FLAGS_MASK & COPY_PROGRESS_INFO_MASK))
#error "mask overlap: OMR_OBJECT_METADATA_FLAGS_MASK, COPY_PROGRESS_INFO_MASK"
#endif

/**
* Remembered bit states overlay tenured header age flags. These are normalized to low-order byte, as above.
*/
#define OMR_OBJECT_METADATA_REMEMBERED_BITS OMR_OBJECT_METADATA_AGE_MASK
#define STATE_NOT_REMEMBERED 0x00
#define STATE_REMEMBERED 0x10
#define OMR_TENURED_STACK_OBJECT_RECENTLY_REFERENCED (STATE_REMEMBERED + (1 << OMR_OBJECT_METADATA_AGE_SHIFT))
#define OMR_TENURED_STACK_OBJECT_CURRENTLY_REFERENCED (STATE_REMEMBERED + (2 << OMR_OBJECT_METADATA_AGE_SHIFT))

/**
* Provides information for a given object.
* @ingroup GC_Base
Expand Down
27 changes: 26 additions & 1 deletion include_core/omrgcconsts.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 1991, 2019 IBM Corp. and others
* Copyright (c) 1991, 2020 IBM Corp. and others
*
* This program and the accompanying materials are made available under
* the terms of the Eclipse Public License 2.0 which accompanies this
Expand Down Expand Up @@ -531,4 +531,29 @@ typedef enum {
#define ZTPF_MEMORY_RESERVE_RATIO .8
#endif /* defined(J9ZTPF) */

/**
* Bit geometry within header flags byte.
*
* NOTE: These are normalized to low-order byte. Object header flags must be right-shifted to low-order
* byte (see GC_ObjectModelBase::getObjectHeaderSlotFlagsShift()) before applying these masks/shifts and
* subsets of these masks must be left-shifted to align with object header flags.
*/
#define OMR_OBJECT_METADATA_FLAGS_BIT_COUNT 8
#define OMR_OBJECT_METADATA_FLAGS_MASK 0xFF
#define OMR_OBJECT_METADATA_AGE_MASK 0xF0
#define OMR_OBJECT_METADATA_AGE_SHIFT 4

#if (0 != (OMR_OBJECT_METADATA_FLAGS_MASK & COPY_PROGRESS_INFO_MASK))
#error "mask overlap: OMR_OBJECT_METADATA_FLAGS_MASK, COPY_PROGRESS_INFO_MASK"
#endif

/**
* Remembered bit states overlay tenured header age flags. These are normalized to low-order byte, as above.
*/
#define OMR_OBJECT_METADATA_REMEMBERED_BITS OMR_OBJECT_METADATA_AGE_MASK
#define STATE_NOT_REMEMBERED 0x00
#define STATE_REMEMBERED 0x10
#define OMR_TENURED_STACK_OBJECT_RECENTLY_REFERENCED (STATE_REMEMBERED + (1 << OMR_OBJECT_METADATA_AGE_SHIFT))
#define OMR_TENURED_STACK_OBJECT_CURRENTLY_REFERENCED (STATE_REMEMBERED + (2 << OMR_OBJECT_METADATA_AGE_SHIFT))

#endif /* OMRGCCONSTS_H_ */

0 comments on commit b08cdd2

Please sign in to comment.