Skip to content

Commit

Permalink
Rename LightweightNonReentrantReaderWriterLock to avoid HLASM errors
Browse files Browse the repository at this point in the history
If the file name of the compilation unit is greater than 38 characters
and the compilation unit uses inline assembly HLASM will fail with the
following message:

```
INFORMATIONAL CCN1149: Inline assembly statements caused HLASM RC=4 with the following messages:
WARNING CCN1150: Inline assembly statements caused HLASM RC=4.
```

The listing file says the assembler has succeeded so this error message
is quite puzzling and seems to go away when the file name is shortened.
It is likely the CSECT name is too long for HLASM to handle, although
changing the CSECT name does not alleviate the problem.

The simplest solution seems to be to truncate the name a little bit
which is what we've done here.
  • Loading branch information
fjeremic committed Aug 18, 2021
1 parent 926386e commit cc1d056
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion gc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ set(omrgc_sources
base/HeapRegionManagerTarok.cpp
base/HeapVirtualMemory.cpp
base/LightweightNonReentrantLock.cpp
base/LightweightNonReentrantReaderWriterLock.cpp
base/LightweightNonReentrantRWLock.cpp
base/MarkedObjectPopulator.cpp
base/MarkingScheme.cpp
base/MarkMap.cpp
Expand Down
4 changes: 2 additions & 2 deletions gc/base/HeapRegionManager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

#include "BaseVirtual.hpp"
#include "HeapRegionDescriptor.hpp"
#include "LightweightNonReentrantReaderWriterLock.hpp"
#include "LightweightNonReentrantRWLock.hpp"
#include "ModronAssertions.h"

class MM_EnvironmentBase;
Expand Down Expand Up @@ -67,7 +67,7 @@ class MM_HeapRegionManager : public MM_BaseVirtual {
public:
protected:
friend class MM_InterRegionRememberedSet;
MM_LightweightNonReentrantReaderWriterLock _heapRegionListMonitor; /**< monitor that controls modification of the heap region linked list */
MM_LightweightNonReentrantRWLock _heapRegionListMonitor; /**< monitor that controls modification of the heap region linked list */
MM_HeapRegionDescriptor* _auxRegionDescriptorList; /**< address ordered doubly linked list for auxiliary heap regions */
uintptr_t _auxRegionCount; /**< number of heap regions on the auxiliary list */

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
#include <assert.h>

#include "AtomicOperations.hpp"
#include "LightweightNonReentrantReaderWriterLock.hpp"
#include "LightweightNonReentrantRWLock.hpp"

intptr_t
MM_LightweightNonReentrantReaderWriterLock::initialize(uintptr_t spinCount)
MM_LightweightNonReentrantRWLock::initialize(uintptr_t spinCount)
{
intptr_t ret = LWRW_OK;
_spinCount = spinCount;
Expand All @@ -35,15 +35,15 @@ MM_LightweightNonReentrantReaderWriterLock::initialize(uintptr_t spinCount)
_status = LWRW_READER_MODE;
MM_AtomicOperations::writeBarrier();
#else /* defined(J9MODRON_USE_CUSTOM_READERWRITERLOCK) */
if (J9THREAD_RWMUTEX_OK != omrthread_rwmutex_init( &_rwmutex, 0, "MM_LightweightNonReentrantReaderWriterLock::_rwmutex" )) {
if (J9THREAD_RWMUTEX_OK != omrthread_rwmutex_init( &_rwmutex, 0, "MM_LightweightNonReentrantRWLock::_rwmutex" )) {
ret = LWRW_FAILED_INIT;
}
#endif /* defined(J9MODRON_USE_CUSTOM_READERWRITERLOCK) */
return ret;
}

intptr_t
MM_LightweightNonReentrantReaderWriterLock::tearDown()
MM_LightweightNonReentrantRWLock::tearDown()
{
intptr_t ret = LWRW_OK;
#if !defined(J9MODRON_USE_CUSTOM_READERWRITERLOCK)
Expand All @@ -53,7 +53,7 @@ MM_LightweightNonReentrantReaderWriterLock::tearDown()
}

intptr_t
MM_LightweightNonReentrantReaderWriterLock::enterRead()
MM_LightweightNonReentrantRWLock::enterRead()
{
intptr_t ret = LWRW_OK;
#if defined(J9MODRON_USE_CUSTOM_READERWRITERLOCK)
Expand Down Expand Up @@ -96,7 +96,7 @@ MM_LightweightNonReentrantReaderWriterLock::enterRead()
}

intptr_t
MM_LightweightNonReentrantReaderWriterLock::exitRead()
MM_LightweightNonReentrantRWLock::exitRead()
{
intptr_t ret = LWRW_OK;
#if defined(J9MODRON_USE_CUSTOM_READERWRITERLOCK)
Expand All @@ -119,7 +119,7 @@ MM_LightweightNonReentrantReaderWriterLock::exitRead()
}

intptr_t
MM_LightweightNonReentrantReaderWriterLock::enterWrite()
MM_LightweightNonReentrantRWLock::enterWrite()
{
intptr_t ret = LWRW_OK;
#if defined(J9MODRON_USE_CUSTOM_READERWRITERLOCK)
Expand Down Expand Up @@ -171,7 +171,7 @@ MM_LightweightNonReentrantReaderWriterLock::enterWrite()
}

intptr_t
MM_LightweightNonReentrantReaderWriterLock::exitWrite()
MM_LightweightNonReentrantRWLock::exitWrite()
{
intptr_t ret = LWRW_OK;
#if defined(J9MODRON_USE_CUSTOM_READERWRITERLOCK)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
* The lock is not re-entrant, can be extended to support re-entrant in future
* it would not provide realtime locking.
*/
class MM_LightweightNonReentrantReaderWriterLock : public MM_BaseNonVirtual {
class MM_LightweightNonReentrantRWLock : public MM_BaseNonVirtual {
private:
uintptr_t _spinCount;

Expand All @@ -58,7 +58,7 @@ class MM_LightweightNonReentrantReaderWriterLock : public MM_BaseNonVirtual {
#endif /* defined(J9MODRON_USE_CUSTOM_READERWRITERLOCK) */
protected:
public:
MM_LightweightNonReentrantReaderWriterLock() :
MM_LightweightNonReentrantRWLock() :
MM_BaseNonVirtual()
,_spinCount(1)
#if defined(J9MODRON_USE_CUSTOM_READERWRITERLOCK)
Expand Down

0 comments on commit cc1d056

Please sign in to comment.