Skip to content

Commit 2b5b3b7

Browse files
authored
Merge pull request #19843 from keithc-ca/dtfj-whitespace
Remove trailing whitespace
2 parents d400c62 + c3d3135 commit 2b5b3b7

File tree

343 files changed

+3481
-3921
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

343 files changed

+3481
-3921
lines changed

jcl/src/openj9.dtfj/share/classes/com/ibm/dtfj/addressspace/CommonAddressSpace.java

Lines changed: 41 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -38,29 +38,29 @@
3838
public abstract class CommonAddressSpace implements IAbstractAddressSpace {
3939
private static final int BUFFER_MAX = 4096;
4040
private static final int MEMORY_CHECK_THRESHOLD = 0x100000;
41-
41+
4242
private MemoryRange[] _translations;
4343
private Integer _lastTranslationUsed = Integer.valueOf(0);
4444
private boolean _isLittleEndian;
4545
private boolean _is64Bit;
4646
private int lastAsid;
4747
private int _is64BitAsid[];
48-
48+
4949
protected CommonAddressSpace(MemoryRange[] translations, boolean isLittleEndian, boolean is64Bit)
5050
{
5151
_translations = _sortRanges(translations);
5252
_isLittleEndian = isLittleEndian;
5353
_is64Bit = is64Bit;
5454
set64Bitness();
5555
}
56-
56+
5757
private static MemoryRange[] _sortRanges(MemoryRange[] ranges)
5858
{
5959
Arrays.sort(ranges, new Comparator<MemoryRange>() {
6060
@Override
6161
public int compare(MemoryRange one, MemoryRange two)
6262
{
63-
return compareAddress(one.getAsid(), one.getVirtualAddress(), two.getAsid(), two.getVirtualAddress());
63+
return compareAddress(one.getAsid(), one.getVirtualAddress(), two.getAsid(), two.getVirtualAddress());
6464
}
6565
});
6666
return ranges;
@@ -78,17 +78,17 @@ private void set64Bitness() {
7878
if (_translations[i].getVirtualAddress()+_translations[i].getSize() >= 0x100000000L) {
7979
// Found 64-bit entry
8080
int asid = _translations[i].getAsid();
81-
81+
8282
// Remember the ASID
8383
int newa[] = new int[count+1];
8484
for (int j = 0; j < count; ++j) {
8585
newa[j] = _is64BitAsid[j];
8686
}
8787
newa[count] = asid;
8888
_is64BitAsid = newa;
89-
89+
9090
++count;
91-
91+
9292
// Skip to the end of the ASID range
9393
while (i < _translations.length && _translations[i].getAsid() == asid) ++i;
9494
}
@@ -106,59 +106,59 @@ public Iterator getMemoryRanges()
106106
protected MemoryRange _residentRange(int asid, long address) throws MemoryAccessException
107107
{
108108
int range = findWhichMemoryRange(asid, address, _translations, _lastTranslationUsed, true);
109-
109+
110110
if (range >= 0) {
111111
return _translations[range];
112112
} else {
113113
throw new MemoryAccessException(asid, address);
114114
}
115115
}
116-
116+
117117
/**
118-
*
118+
*
119119
* This searches memory ranges for an addr using a binary chop and returns an int indicating the memory range
120-
* or -1 if address is not within any memory range......
120+
* or -1 if address is not within any memory range......
121121
* @param asid TODO
122122
*/
123123
protected static int findWhichMemoryRange(int asid, long addr, MemoryRange[] ranges, Integer lastRange, boolean doLinearIfNotFound)
124124
{
125125
int retI=-1; //assume we won't find it
126126
int last = lastRange.intValue();
127127
int lastPlusOne = last+1;
128-
129-
if ((last < ranges.length) &&
130-
(ranges[last].contains(asid, addr)) &&
128+
129+
if ((last < ranges.length) &&
130+
(ranges[last].contains(asid, addr)) &&
131131
(ranges[last].isInCoreFile() || (!ranges[last].isInCoreFile() && ranges[last].getLibraryReader() != null))) { //TLB hit
132132
retI = last;
133-
} else if ((lastPlusOne < ranges.length) &&
134-
(ranges[lastPlusOne].contains(asid, addr)) &&
133+
} else if ((lastPlusOne < ranges.length) &&
134+
(ranges[lastPlusOne].contains(asid, addr)) &&
135135
(ranges[last].isInCoreFile() || (!ranges[last].isInCoreFile() && ranges[last].getLibraryReader() != null))) { //TLB hit
136136
retI = lastPlusOne;
137137
} else {
138138
// TLB failed to do the search
139-
139+
140140
// Now effectively do a binary search find the right range....
141141
// note: on some platforms we can have overlapping memory ranges!!
142142
// (ie. AIX, zOs and linux) so we always give back the first
143143

144144
int highpos = ranges.length-1;
145145
int lowpos = 0;
146-
146+
147147
while (lowpos <= highpos) {
148148
int currentPos = lowpos + ((highpos-lowpos) >>> 1);
149149
long mraStartAddr = ranges[currentPos].getVirtualAddress();
150150
int mraAsid = ranges[currentPos].getAsid();
151151

152152
if (compareAddress(asid, addr, mraAsid, mraStartAddr) >= 0) { //addr above base of range
153-
if(compareAddress(asid, addr, mraAsid, mraStartAddr + ranges[currentPos].getSize()) < 0 &&
153+
if(compareAddress(asid, addr, mraAsid, mraStartAddr + ranges[currentPos].getSize()) < 0 &&
154154
(ranges[currentPos].isInCoreFile() || !ranges[currentPos].isInCoreFile() && ranges[currentPos].getLibraryReader() != null)) {
155155
retI = currentPos;
156156
break;
157157
}
158158
lowpos = currentPos + 1;
159159
} else {
160160
highpos = currentPos-1;
161-
}
161+
}
162162
}
163163

164164
// No match using binary chop, probably due to overlapping ranges => revert to a linear search
@@ -168,8 +168,8 @@ protected static int findWhichMemoryRange(int asid, long addr, MemoryRange[] ran
168168
for (int i = 0; i < lowpos; i++) {
169169
long mraStartAddr = ranges[i].getVirtualAddress();
170170
int mraAsid = ranges[i].getAsid();
171-
if ((compareAddress(asid, addr, mraAsid, mraStartAddr) >= 0) &&
172-
(compareAddress(asid, addr, mraAsid, mraStartAddr + ranges[i].getSize()) < 0) &&
171+
if ((compareAddress(asid, addr, mraAsid, mraStartAddr) >= 0) &&
172+
(compareAddress(asid, addr, mraAsid, mraStartAddr + ranges[i].getSize()) < 0) &&
173173
(ranges[i].isInCoreFile() || (!ranges[i].isInCoreFile() && ranges[i].getLibraryReader() != null))) {
174174
retI = i;
175175
break;
@@ -182,7 +182,7 @@ protected static int findWhichMemoryRange(int asid, long addr, MemoryRange[] ran
182182
}
183183
return retI;
184184
}
185-
185+
186186
protected static int compareAddress(int lasid, long lhs, int rasid, long rhs) {
187187
if (lasid < rasid) return -1;
188188
if (lasid > rasid) return 1;
@@ -194,7 +194,7 @@ protected static int compareAddress(int lasid, long lhs, int rasid, long rhs) {
194194
return lhs < rhs ? 1 : -1;
195195
}
196196
}
197-
197+
198198
private boolean isMemoryAccessible(int asid, long address, int size)
199199
{
200200
// CMVC 125071 - jextract failing with OOM error
@@ -205,13 +205,13 @@ private boolean isMemoryAccessible(int asid, long address, int size)
205205
int startRange;
206206
long hi;
207207
long memhi;
208-
208+
209209
startRange = findWhichMemoryRange(asid, address, _translations, _lastTranslationUsed, true);
210210
if (startRange == -1) {
211211
// Range not found, so return false
212212
return rc;
213213
}
214-
214+
215215
// Now we have a start range, check if the size fits
216216
hi = _translations[startRange].getVirtualAddress() + _translations[startRange].getSize();
217217
memhi = address + size;
@@ -222,12 +222,12 @@ private boolean isMemoryAccessible(int asid, long address, int size)
222222
// size goes beyond the end of this range, so walk the contiguous
223223
// ranges to find if it will still fit
224224
cumulativeSize = hi - address;
225-
225+
226226
for (int i = startRange+1; i < _translations.length; i++) {
227227
long rangeBaseAddress = _translations[i].getVirtualAddress();
228228
long rangeSize = _translations[i].getSize();
229229
long rangeTopAddress = rangeBaseAddress + rangeSize;
230-
230+
231231
if (rangeBaseAddress == hi) {
232232
// contiguous range
233233
cumulativeSize += rangeSize;
@@ -279,23 +279,23 @@ public byte[] getMemoryBytes(int asid, long vaddr, int size)
279279
{
280280
// CMVC 125071 - jextract failing with OOM error
281281
// This check is to help protect from OOM situations where a damaged core
282-
// has given us a ridiculously large memory size to allocate. If size is
282+
// has given us a ridiculously large memory size to allocate. If size is
283283
// sufficiently large, then check if the memory really exists before trying
284284
// to allocate it. Obviously, this does not stop OOM occurring, if the memory
285285
// exists in the core file we may pass the test and still OOM on the allocation.
286286
boolean getMem = true;
287287
lastAsid = asid;
288288
byte[] buffer = null;
289-
289+
290290
if (size < 0) {
291291
return null;
292292
}
293-
293+
294294
if (0 != vaddr) {
295295
if (size > MEMORY_CHECK_THRESHOLD) {
296296
getMem = isMemoryAccessible(0, vaddr, size);
297297
}
298-
298+
299299
if (getMem) {
300300
buffer = new byte[size];
301301

@@ -321,7 +321,7 @@ else if (0 != bufferMax % align)
321321

322322
long location = -1;
323323
Iterator ranges = getMemoryRanges();
324-
324+
325325
while ((-1 == location) && ranges.hasNext()) {
326326
MemoryRange range = (MemoryRange) ranges.next();
327327
// Skip over previous asids
@@ -334,15 +334,15 @@ else if (0 != bufferMax % align)
334334
if (location == -1) lastAsid = 0;
335335
return location;
336336
}
337-
337+
338338
private static int match(byte[] whatBytes, int matchedSoFar, byte[] buffer, int index) {
339339
int matched = matchedSoFar;
340340
for (int i = index; i < buffer.length && matched < whatBytes.length; i++, matched++)
341341
if (buffer[i] != whatBytes[matched])
342342
return 0;
343343
return matched;
344344
}
345-
345+
346346
private long findPatternInRange(byte[] whatBytes, int alignment, long start, MemoryRange range, int bufferMax) {
347347
if (range.getVirtualAddress() >= start || range.contains(start)) {
348348
// Ensure the address is within the range and aligned
@@ -353,7 +353,7 @@ private long findPatternInRange(byte[] whatBytes, int alignment, long start, Mem
353353
addr += alignment - (addr % alignment);
354354

355355
long edge = range.getVirtualAddress() + range.getSize();
356-
356+
357357
int asid = range.getAsid();
358358

359359
// FIXME this is somewhat inefficient - should use Boyer-Moore
@@ -362,22 +362,22 @@ private long findPatternInRange(byte[] whatBytes, int alignment, long start, Mem
362362
while (addr < edge) {
363363
long bytesLeftInRange = edge - addr;
364364
long count = bufferMax < bytesLeftInRange ? bufferMax : bytesLeftInRange;
365-
365+
366366
if (0 != addr) {
367367
byte[] buffer = getMemoryBytes(asid, addr, (int)count);
368-
368+
369369
if (null != buffer) {
370370
// Handle partial match
371371
if (0 != matched) {
372372
matched = match(whatBytes, matched, buffer, 0);
373373
}
374-
374+
375375
// Handle no match
376376
for (int i = 0; i < buffer.length && 0 == matched; i += alignment) {
377377
matchAddr = addr + i;
378378
matched = match(whatBytes, 0, buffer, i);
379379
}
380-
380+
381381
// Check for a full match
382382
if (whatBytes.length == matched) {
383383
return matchAddr;
@@ -392,7 +392,7 @@ private long findPatternInRange(byte[] whatBytes, int alignment, long start, Mem
392392
}
393393
return -1;
394394
}
395-
395+
396396
/* (non-Javadoc)
397397
* @see com.ibm.dtfj.addressspace.IAbstractAddressSpace#getLongAt(int, long)
398398
*/

jcl/src/openj9.dtfj/share/classes/com/ibm/dtfj/addressspace/DumpReaderAddressSpace.java

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,13 @@
3535
public class DumpReaderAddressSpace extends CommonAddressSpace
3636
{
3737
private DumpReader _reader;
38-
38+
3939
public DumpReaderAddressSpace(MemoryRange[] ranges, DumpReader reader, boolean isLittleEndian, boolean is64Bit)
4040
{
4141
super(ranges, isLittleEndian, is64Bit);
4242
_reader = reader;
4343
}
44-
44+
4545
/* (non-Javadoc)
4646
* @see com.ibm.dtfj.addressspace.IAbstractAddressSpace#isExecutable(int, long)
4747
*/
@@ -71,8 +71,7 @@ public boolean isShared(int asid, long address)
7171
MemoryRange match = _residentRange(asid, address);
7272
return match.isShared();
7373
}
74-
75-
74+
7675
/* (non-Javadoc)
7776
* @see com.ibm.dtfj.addressspace.IAbstractAddressSpace#getBytesAt(int, long, byte[])
7877
*/
@@ -118,15 +117,14 @@ public int getBytesAt(int asid, long address, byte[] buffer) throws MemoryAccess
118117
}
119118
return bytesRead;
120119
}
121-
122-
120+
123121
/* (non-Javadoc)
124122
* @see com.ibm.dtfj.addressspace.IAbstractAddressSpace#getLongAt(int, long)
125123
*/
126124
public long getLongAt(int asid, long address) throws MemoryAccessException
127125
{
128126
MemoryRange match = _residentRange(asid, address);
129-
127+
130128
if (null != match) {
131129
if (match.isInCoreFile()) {
132130
long fileOffset = match.getFileOffset() + (address - match.getVirtualAddress());
@@ -143,14 +141,14 @@ public long getLongAt(int asid, long address) throws MemoryAccessException
143141
throw new MemoryAccessException(asid, address);
144142
}
145143
}
146-
144+
147145
/* (non-Javadoc)
148146
* @see com.ibm.dtfj.addressspace.IAbstractAddressSpace#getIntAt(int, long)
149147
*/
150148
public int getIntAt(int asid, long address) throws MemoryAccessException
151149
{
152150
MemoryRange match = _residentRange(asid, address);
153-
151+
154152
if (null != match) {
155153
if (match.isInCoreFile()) {
156154
long fileOffset = match.getFileOffset() + (address - match.getVirtualAddress());
@@ -175,7 +173,7 @@ public short getShortAt(int asid, long address)
175173
throws MemoryAccessException
176174
{
177175
MemoryRange match = _residentRange(asid, address);
178-
176+
179177
if (null != match) {
180178
if (match.isInCoreFile()) {
181179
long fileOffset = match.getFileOffset() + (address - match.getVirtualAddress());
@@ -198,9 +196,9 @@ public short getShortAt(int asid, long address)
198196
*/
199197
public byte getByteAt(int asid, long address) throws MemoryAccessException
200198
{
201-
199+
202200
MemoryRange match = _residentRange(asid, address);
203-
201+
204202
if (null != match) {
205203
if (match.isInCoreFile()) {
206204
long fileOffset = match.getFileOffset() + (address - match.getVirtualAddress());

0 commit comments

Comments
 (0)