Skip to content

Commit 16a6349

Browse files
author
Christian Wimmer
committed
Remove unnecessary @Formatter comments
1 parent 83ecae3 commit 16a6349

File tree

12 files changed

+45
-117
lines changed

12 files changed

+45
-117
lines changed

substratevm/src/com.oracle.graal.pointsto/src/com/oracle/graal/pointsto/meta/AnalysisField.java

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -208,38 +208,6 @@ public TypeState getInstanceFieldTypeState() {
208208
return interceptTypeState(instanceFieldFlow.getState());
209209
}
210210

211-
// @formatter:off
212-
// public TypeState getInstanceFieldTypeState() {
213-
// if (instanceFieldTypeState == null) {
214-
//
215-
// /* Collect the types of all instance field flows. */
216-
// HashSet<AnalysisType> fieldTypes = new HashSet<>();
217-
// boolean fieldCanBeNull = false;
218-
//
219-
// fieldCanBeNull = collectInstanceFieldTypes(getDeclaringClass(), fieldTypes);
220-
// instanceFieldTypeState = TypeState.forExactTypes(null, new ArrayList<>(fieldTypes), fieldCanBeNull);
221-
//
222-
// }
223-
// return instanceFieldTypeState;
224-
// }
225-
226-
// private boolean collectInstanceFieldTypes(AnalysisType type, HashSet<AnalysisType> fieldTypes) {
227-
// boolean fieldCanBeNull = false;
228-
//
229-
// TypeFlow<?> fieldFlow = type.getAbstractObject().getInstanceFieldFlow(null, this, false);
230-
// if (fieldFlow != null) {
231-
// TypeState mergedState = fieldFlow.getState();
232-
// mergedState.typesIterator().forEachRemaining(fieldTypes::add);
233-
// fieldCanBeNull |= mergedState.canBeNull();
234-
// }
235-
//
236-
// for (AnalysisType subClass : type.subTypes) {
237-
// fieldCanBeNull |= collectInstanceFieldTypes(subClass, fieldTypes);
238-
// }
239-
// return fieldCanBeNull;
240-
// }
241-
//@formatter:on
242-
243211
public FieldTypeFlow getInitialInstanceFieldFlow() {
244212
return initialInstanceFieldFlow;
245213
}

substratevm/src/com.oracle.objectfile/src/com/oracle/objectfile/elf/ELFObjectFile.java

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -880,15 +880,13 @@ public String toString() {
880880
if (isNullEntry()) {
881881
return "SHT NULL Entry";
882882
}
883-
//@formatter:off
884-
return new StringBuilder("SHT Entry: ").
885-
append(String.format("\n %s", type)).
886-
append(String.format("\n flags %#x", flags)).
887-
append(String.format("\n virtual address %#x", virtualAddress)).
888-
append(String.format("\n offset %#x (%1$d), size %d", fileOffset, sectionSize)).
889-
append(String.format("\n link %#x, info %#x, align %#x, entry size %#x (%4$d)", link, info, addrAlign, entrySize)).
890-
append("\n").toString();
891-
//@formatter:on
883+
return new StringBuilder("SHT Entry: ")
884+
.append(String.format("\n %s", type))
885+
.append(String.format("\n flags %#x", flags))
886+
.append(String.format("\n virtual address %#x", virtualAddress))
887+
.append(String.format("\n offset %#x (%1$d), size %d", fileOffset, sectionSize))
888+
.append(String.format("\n link %#x, info %#x, align %#x, entry size %#x (%4$d)", link, info, addrAlign, entrySize))
889+
.append("\n").toString();
892890
}
893891

894892
public boolean isNullEntry() {

substratevm/src/com.oracle.objectfile/src/com/oracle/objectfile/macho/MachOObjectFile.java

Lines changed: 15 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@
4242
import java.util.stream.Collectors;
4343
import java.util.stream.Stream;
4444

45+
import org.graalvm.nativeimage.ImageSingletons;
46+
import org.graalvm.nativeimage.Platform;
47+
4548
import com.oracle.objectfile.BasicProgbitsSectionImpl;
4649
import com.oracle.objectfile.BuildDependency;
4750
import com.oracle.objectfile.ElementImpl;
@@ -52,8 +55,6 @@
5255
import com.oracle.objectfile.SymbolTable;
5356
import com.oracle.objectfile.io.AssemblyBuffer;
5457
import com.oracle.objectfile.io.OutputAssembler;
55-
import org.graalvm.nativeimage.ImageSingletons;
56-
import org.graalvm.nativeimage.Platform;
5758

5859
/**
5960
* Models a Mach-O relocatable object file.
@@ -1280,28 +1281,12 @@ private int overapproximateSize() {
12801281
return size;
12811282
}
12821283

1283-
//@formatter:off
1284-
// @Override
1285-
// public int getOrDecideSize(Map<Element, LayoutDecisionMap> alreadyDecided, int sizeHint) {
1286-
// /*
1287-
// * HACK HACK HACK: since the content is ULEB128 variable-length-encoded, we need to
1288-
// * compute our content before we can compute our size. BUT this gives us cyclic build
1289-
// * dependencies because of Mach-O's messed-up segment structure (FIXME: find out exactly
1290-
// * what is creating the cycles). So we overapproximate our size based on the biggest
1291-
// * function-to-function offset we think is likely.
1292-
// */
1293-
// return overapproximateSize();
1294-
// }
1295-
//@formatter:on
1296-
1297-
//@formatter:off
12981284
@Override
12991285
public int getOrDecideSize(java.util.Map<Element, LayoutDecisionMap> alreadyDecided, int sizeHint) {
13001286
Object decidedContent = alreadyDecided.get(this).getDecidedValue(LayoutDecision.Kind.CONTENT);
13011287
assert decidedContent != null;
13021288
return ((byte[]) decidedContent).length;
13031289
}
1304-
//@formatter:on
13051290

13061291
@Override
13071292
public Iterable<BuildDependency> getDependencies(Map<Element, LayoutDecisionMap> decisions) {
@@ -1520,8 +1505,7 @@ public long value() {
15201505

15211506
public abstract class MachOSection extends ObjectFile.Section {
15221507

1523-
// @formatter:off
1524-
/* We have no fields except type & flags! Mach-O section64 struct's fields are
1508+
/*- We have no fields except type & flags! Mach-O section64 struct's fields are
15251509
* modelled as follows:
15261510
* sectname: in the ObjectFile's element name map
15271511
* segname: explicitly if relocatable file, else in the ObjectFile's segments list
@@ -1534,7 +1518,6 @@ public abstract class MachOSection extends ObjectFile.Section {
15341518
* flags: we DO have this one
15351519
* reserved1, reserved2: saved for a "symbol stub section" subclass, if we need it
15361520
*/
1537-
// @formatter:on
15381521

15391522
SectionType type;
15401523
EnumSet<SectionFlag> flags;
@@ -2019,20 +2002,18 @@ protected void writePayload(OutputAssembler db, final Map<Element, LayoutDecisio
20192002
*/
20202003
assert s.destinationSegmentName != null;
20212004

2022-
//@formatter:off
20232005
SectionInfoStruct si = new SectionInfoStruct(
2024-
s.getName(),
2025-
s.destinationSegmentName,
2026-
s.getElement().isReferenceable() ? (int) alreadyDecided.get(s).getDecidedValue(LayoutDecision.Kind.VADDR) : 0,
2027-
(int) alreadyDecided.get(s).getDecidedValue(LayoutDecision.Kind.SIZE),
2028-
(int) alreadyDecided.get(s).getDecidedValue(LayoutDecision.Kind.OFFSET),
2029-
logAlignment,
2030-
ourRelocs == null ? 0 : (int) alreadyDecided.get(ourRelocs).getDecidedValue(LayoutDecision.Kind.OFFSET) + ourRelocs.startIndexFor(s) * ourRelocs.encodedEntrySize(),
2031-
ourRelocs == null ? 0 : ourRelocs.countFor(s),
2032-
(int) ObjectFile.flagSetAsLong(s.flags) | s.type.getValue(),
2033-
/* reserved1 */ 0,
2034-
/* reserved2 */ 0);
2035-
//@formatter:on
2006+
s.getName(),
2007+
s.destinationSegmentName,
2008+
s.getElement().isReferenceable() ? (int) alreadyDecided.get(s).getDecidedValue(LayoutDecision.Kind.VADDR) : 0,
2009+
(int) alreadyDecided.get(s).getDecidedValue(LayoutDecision.Kind.SIZE),
2010+
(int) alreadyDecided.get(s).getDecidedValue(LayoutDecision.Kind.OFFSET),
2011+
logAlignment,
2012+
ourRelocs == null ? 0 : (int) alreadyDecided.get(ourRelocs).getDecidedValue(LayoutDecision.Kind.OFFSET) + ourRelocs.startIndexFor(s) * ourRelocs.encodedEntrySize(),
2013+
ourRelocs == null ? 0 : ourRelocs.countFor(s),
2014+
(int) ObjectFile.flagSetAsLong(s.flags) | s.type.getValue(),
2015+
/* reserved1 */ 0,
2016+
/* reserved2 */ 0);
20362017
int startPos = db.pos();
20372018
si.write(db);
20382019
assert db.pos() - startPos == SectionInfoStruct.DEFAULT_SIZE;

substratevm/src/com.oracle.objectfile/src/com/oracle/objectfile/macho/MachORelocationElement.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -322,13 +322,11 @@ public void write(OutputAssembler oa, @SuppressWarnings("unused") Map<Element, L
322322
* case-splitting for endianness.
323323
*/
324324
int remainingWord = 0;
325-
//@formatter:off
326325
remainingWord |= symbolNum & 0x00ffffff;
327326
remainingWord |= (kind.isPCRelative() ? 1 : 0) << 24;
328-
remainingWord |= (log2length & 0x3) << 25;
329-
remainingWord |= (isExtern() ? 1 : 0) << 27;
330-
remainingWord |= (kind.getValue() & 0xf) << 28;
331-
//@formatter:on
327+
remainingWord |= (log2length & 0x3) << 25;
328+
remainingWord |= (isExtern() ? 1 : 0) << 27;
329+
remainingWord |= (kind.getValue() & 0xf) << 28;
332330
oa.write4Byte(remainingWord);
333331
assert oa.pos() - startPos == 8; // check we wrote how much we expected
334332
}

substratevm/src/com.oracle.objectfile/src/com/oracle/objectfile/macho/MachOUserDefinedSection.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,12 +199,10 @@ private void handleAArch64RelocationAddend(MachORelocationElement el, AssemblyBu
199199
case AARCH64_R_AARCH64_LDST8_ABS_LO12_NC:
200200
case AARCH64_R_AARCH64_ADD_ABS_LO12_NC:
201201
if (addend != 0) {
202-
/*
202+
/*-
203203
* According to the Mach-O ld code at:
204204
*
205-
* @formatter:off
206205
* https://opensource.apple.com/source/ld64/ld64-274.2/src/ld/parsers/macho_relocatable_file.cpp.auto.html
207-
* @formatter:on
208206
*
209207
* These relocations should use an explicit addend relocation record (ARM64_RELOC_ADDEND) instead of an
210208
* implicit addend.

substratevm/src/com.oracle.objectfile/src/com/oracle/objectfile/pecoff/PECoffMachine.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@
2727

2828
import com.oracle.objectfile.ObjectFile.RelocationKind;
2929
import com.oracle.objectfile.ObjectFile.RelocationMethod;
30-
import com.oracle.objectfile.pecoff.PECoffRelocationTable.PECoffRelocationMethod;
3130
import com.oracle.objectfile.pecoff.PECoff.IMAGE_FILE_HEADER;
3231
import com.oracle.objectfile.pecoff.PECoff.IMAGE_RELOCATION;
32+
import com.oracle.objectfile.pecoff.PECoffRelocationTable.PECoffRelocationMethod;
3333

3434
/**
3535
* PECoff machine type (incomplete). Each machine type also defines its set of relocation types.
@@ -93,8 +93,7 @@ public static PECoffMachine getSystemNativeValue() {
9393
}
9494
}
9595

96-
/**
97-
* @formatter:off
96+
/*-
9897
*
9998
* IMAGE_REL_AMD64_ABSOLUTE 0x0000 // Reference is absolute, no relocation is necessary
10099
* IMAGE_REL_AMD64_ADDR64 0x0001 // 64-bit address (VA).
@@ -112,8 +111,6 @@ public static PECoffMachine getSystemNativeValue() {
112111
* IMAGE_REL_AMD64_TOKEN 0x000D // 32 bit metadata token
113112
* IMAGE_REL_AMD64_SREL32 0x000E // 32 bit signed span-dependent value emitted into object
114113
* IMAGE_REL_AMD64_PAIR 0x000F IMAGE_REL_AMD64_SSPAN32 0x0010 // 32 bit signed span-dependent value applied at link time
115-
*
116-
* @formatter:on
117114
*/
118115
enum PECoffX86_64Relocation implements PECoffRelocationMethod {
119116
ADDR64 {

substratevm/src/com.oracle.svm.core.genscavenge/src/com/oracle/svm/core/genscavenge/HeapImpl.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,6 @@ static Log zapValuesToLog(Log log) {
296296
if (HeapParameters.getZapProducedHeapChunks() || HeapParameters.getZapConsumedHeapChunks()) {
297297
log.string("[Heap Chunk zap values: ").indent(true);
298298
/* Padded with spaces so the columns line up between the int and word variants. */
299-
// @formatter:off
300299
if (HeapParameters.getZapProducedHeapChunks()) {
301300
log.string(" producedHeapChunkZapInt: ")
302301
.string(" hex: ").spaces(8).hex(HeapParameters.getProducedHeapChunkZapInt())
@@ -321,7 +320,6 @@ static Log zapValuesToLog(Log log) {
321320
.string(" unsigned: ").unsigned(HeapParameters.getConsumedHeapChunkZapWord());
322321
}
323322
log.redent(false).string("]");
324-
// @formatter:on
325323
}
326324
return log;
327325
}

substratevm/src/com.oracle.svm.core.genscavenge/src/com/oracle/svm/core/genscavenge/ObjectHeaderImpl.java

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
*/
2525
package com.oracle.svm.core.genscavenge;
2626

27-
import com.oracle.svm.core.annotate.AlwaysInline;
2827
import org.graalvm.compiler.api.directives.GraalDirectives;
2928
import org.graalvm.compiler.api.replacements.Fold;
3029
import org.graalvm.compiler.core.common.CompressEncoding;
@@ -41,6 +40,7 @@
4140
import org.graalvm.word.WordFactory;
4241

4342
import com.oracle.svm.core.SubstrateOptions;
43+
import com.oracle.svm.core.annotate.AlwaysInline;
4444
import com.oracle.svm.core.annotate.Uninterruptible;
4545
import com.oracle.svm.core.config.ConfigurationValues;
4646
import com.oracle.svm.core.config.ObjectLayout;
@@ -62,16 +62,13 @@
6262
* {@link Heap#isInImageHeap}.
6363
*/
6464
public final class ObjectHeaderImpl extends ObjectHeader {
65-
// @formatter:off
66-
// Name Value
67-
private static final UnsignedWord UNALIGNED_BIT = WordFactory.unsigned(0b001);
68-
private static final UnsignedWord REMEMBERED_SET_BIT = WordFactory.unsigned(0b010);
69-
private static final UnsignedWord FORWARDED_BIT = WordFactory.unsigned(0b100);
70-
71-
private static final int RESERVED_BITS_MASK = 0b111;
72-
private static final UnsignedWord MASK_HEADER_BITS = WordFactory.unsigned(RESERVED_BITS_MASK);
73-
private static final UnsignedWord CLEAR_HEADER_BITS = MASK_HEADER_BITS.not();
74-
// @formatter:on
65+
private static final UnsignedWord UNALIGNED_BIT = WordFactory.unsigned(0b001);
66+
private static final UnsignedWord REMEMBERED_SET_BIT = WordFactory.unsigned(0b010);
67+
private static final UnsignedWord FORWARDED_BIT = WordFactory.unsigned(0b100);
68+
69+
private static final int RESERVED_BITS_MASK = 0b111;
70+
private static final UnsignedWord MASK_HEADER_BITS = WordFactory.unsigned(RESERVED_BITS_MASK);
71+
private static final UnsignedWord CLEAR_HEADER_BITS = MASK_HEADER_BITS.not();
7572

7673
@Platforms(Platform.HOSTED_ONLY.class)
7774
ObjectHeaderImpl() {

substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/SubstrateUtil.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -362,16 +362,14 @@ public static String mangleName(String methodName) {
362362
}
363363
String mangled = out.toString();
364364
assert mangled.matches("[a-zA-Z\\._][a-zA-Z0-9_]*");
365-
//@formatter:off
366-
/*
365+
/*-
367366
* To demangle, the following pipeline works for me (assuming no multi-byte characters):
368367
*
369368
* sed -r 's/\_([0-9a-f]{4})/\n\1\n/g' | sed -r 's#^[0-9a-f]{2}([0-9a-f]{2})#/usr/bin/printf "\\x\1"#e' | tr -d '\n'
370369
*
371370
* It's not strictly correct if the first characters after an escape sequence
372371
* happen to match ^[0-9a-f]{2}, but hey....
373372
*/
374-
//@formatter:on
375373
return mangled;
376374
}
377375

substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/JavaAWTSubstitutions.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -212,14 +212,13 @@ public synchronized boolean init() {
212212
fcm.populateFontConfig(fcCompFonts);
213213
}
214214

215-
// @formatter:off
216-
/*
215+
/*-
217216
The below code was part of the original method but has been removed in the substitution. In a native-image,
218217
java.home is set to null, so executing it would result in an exception.
219218
The #getInstalledFallbackFonts method is in charge of installing fallback fonts shipped with the JDK. If the
220219
fallback font directory does not exist, it is a no-op. As we do not have a JDK available at native-image
221220
runtime, we can safely remove the call.
222-
221+
223222
// NB already in a privileged block from SGE
224223
String javaHome = System.getProperty("java.home");
225224
if (javaHome == null) {
@@ -228,7 +227,6 @@ public synchronized boolean init() {
228227
String javaLib = javaHome + File.separator + "lib";
229228
getInstalledFallbackFonts(javaLib);
230229
*/
231-
// @formatter:on
232230

233231
return fcCompFonts != null; // couldn't load fontconfig.
234232
}

0 commit comments

Comments
 (0)