Skip to content

Commit 741422b

Browse files
authored
Merge pull request #20492 from LinHu2016/coding-std-update5
Clean up ConstantPoolClassSlotIterator class
2 parents 1b61bae + 8f14967 commit 741422b

File tree

2 files changed

+14
-15
lines changed

2 files changed

+14
-15
lines changed

runtime/gc_structs/ConstantPoolClassSlotIterator.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@ GC_ConstantPoolClassSlotIterator::nextSlot()
4747
_cpDescriptionIndex = J9_CP_DESCRIPTIONS_PER_U32;
4848
}
4949

50-
U_32 slotType = _cpDescription & J9_CP_DESCRIPTION_MASK;
50+
uint32_t slotType = _cpDescription & J9_CP_DESCRIPTION_MASK;
5151
J9Object **slotPtr = _cpEntry;
5252

5353
/* Adjust the CP slot and description information */
54-
_cpEntry = (J9Object **)( ((U_8 *)_cpEntry) + sizeof(J9RAMConstantPoolItem) );
54+
_cpEntry = (J9Object **)(((uint8_t *)_cpEntry) + sizeof(J9RAMConstantPoolItem));
5555
_cpEntryCount -= 1;
5656

5757
_cpDescription >>= J9_CP_BITS_PER_DESCRIPTION;

runtime/gc_structs/ConstantPoolClassSlotIterator.hpp

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -44,31 +44,30 @@ class GC_ConstantPoolClassSlotIterator
4444
{
4545

4646
J9Object **_cpEntry;
47-
U_32 _cpEntryCount;
48-
U_32 _cpEntryTotal;
49-
U_32 *_cpDescriptionSlots;
50-
U_32 _cpDescription;
51-
UDATA _cpDescriptionIndex;
47+
uint32_t _cpEntryCount;
48+
uint32_t _cpEntryTotal;
49+
uint32_t *_cpDescriptionSlots;
50+
uint32_t _cpDescription;
51+
uintptr_t _cpDescriptionIndex;
5252

5353
public:
54-
GC_ConstantPoolClassSlotIterator(J9Class *clazz) :
55-
_cpEntry((J9Object **)J9_CP_FROM_CLASS(clazz)),
56-
_cpEntryCount(clazz->romClass->ramConstantPoolCount)
54+
GC_ConstantPoolClassSlotIterator(J9Class *clazz)
55+
: _cpEntry((J9Object **)J9_CP_FROM_CLASS(clazz))
56+
, _cpEntryCount(clazz->romClass->ramConstantPoolCount)
5757
{
5858
_cpEntryTotal = _cpEntryCount;
59-
if(_cpEntryCount) {
60-
_cpDescriptionSlots = SRP_PTR_GET(&clazz->romClass->cpShapeDescription, U_32 *);
59+
if (0 != _cpEntryCount) {
60+
_cpDescriptionSlots = SRP_PTR_GET(&clazz->romClass->cpShapeDescription, uint32_t *);
6161
_cpDescriptionIndex = 0;
6262
}
63-
64-
};
63+
}
6564

6665
/**
6766
* Gets the current constant pool index.
6867
* @return zero based constant pool index of the entry returned by the last call of nextSlot.
6968
* @return -1 if nextSlot has yet to be called.
7069
*/
71-
MMINLINE IDATA getIndex() {
70+
MMINLINE intptr_t getIndex() {
7271
return _cpEntryTotal - _cpEntryCount - 1;
7372
}
7473

0 commit comments

Comments
 (0)