Skip to content

Commit 313e7ee

Browse files
authored
Merge pull request #2021 from SAP/pr-jdk-25+33
Merge to tag jdk-25+33
2 parents 250c69a + 9277212 commit 313e7ee

File tree

23 files changed

+505
-133
lines changed

23 files changed

+505
-133
lines changed

src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1452,27 +1452,23 @@ void ShenandoahHeap::print_heap_regions_on(outputStream* st) const {
14521452
}
14531453
}
14541454

1455-
size_t ShenandoahHeap::trash_humongous_region_at(ShenandoahHeapRegion* start) {
1455+
size_t ShenandoahHeap::trash_humongous_region_at(ShenandoahHeapRegion* start) const {
14561456
assert(start->is_humongous_start(), "reclaim regions starting with the first one");
1457-
1458-
oop humongous_obj = cast_to_oop(start->bottom());
1459-
size_t size = humongous_obj->size();
1460-
size_t required_regions = ShenandoahHeapRegion::required_regions(size * HeapWordSize);
1461-
size_t index = start->index() + required_regions - 1;
1462-
14631457
assert(!start->has_live(), "liveness must be zero");
14641458

1465-
for(size_t i = 0; i < required_regions; i++) {
1466-
// Reclaim from tail. Otherwise, assertion fails when printing region to trace log,
1467-
// as it expects that every region belongs to a humongous region starting with a humongous start region.
1468-
ShenandoahHeapRegion* region = get_region(index --);
1469-
1470-
assert(region->is_humongous(), "expect correct humongous start or continuation");
1459+
// Do not try to get the size of this humongous object. STW collections will
1460+
// have already unloaded classes, so an unmarked object may have a bad klass pointer.
1461+
ShenandoahHeapRegion* region = start;
1462+
size_t index = region->index();
1463+
do {
1464+
assert(region->is_humongous(), "Expect correct humongous start or continuation");
14711465
assert(!region->is_cset(), "Humongous region should not be in collection set");
1472-
14731466
region->make_trash_immediate();
1474-
}
1475-
return required_regions;
1467+
region = get_region(++index);
1468+
} while (region != nullptr && region->is_humongous_continuation());
1469+
1470+
// Return number of regions trashed
1471+
return index - start->index();
14761472
}
14771473

14781474
class ShenandoahCheckCleanGCLABClosure : public ThreadClosure {

src/hotspot/share/gc/shenandoah/shenandoahHeap.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -828,7 +828,7 @@ class ShenandoahHeap : public CollectedHeap {
828828
static inline void atomic_clear_oop(narrowOop* addr, oop compare);
829829
static inline void atomic_clear_oop(narrowOop* addr, narrowOop compare);
830830

831-
size_t trash_humongous_region_at(ShenandoahHeapRegion *r);
831+
size_t trash_humongous_region_at(ShenandoahHeapRegion *r) const;
832832

833833
static inline void increase_object_age(oop obj, uint additional_age);
834834

src/java.base/share/classes/java/io/File.java

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1134,15 +1134,9 @@ public File[] listFiles() {
11341134
if (ss == null) return null;
11351135
int n = ss.length;
11361136
File[] fs = new File[n];
1137-
if (path.isEmpty()) {
1138-
for (int i = 0; i < n; i++) {
1139-
fs[i] = new File(ss[i]);
1140-
}
1141-
} else {
1142-
for (int i = 0; i < n; i++) {
1143-
fs[i] = new File(ss[i], this);
1144-
}
1145-
}
1137+
boolean isEmpty = path.isEmpty();
1138+
for (int i = 0; i < n; i++)
1139+
fs[i] = isEmpty ? new File(ss[i]) : new File(ss[i], this);
11461140
return fs;
11471141
}
11481142

@@ -1175,9 +1169,10 @@ public File[] listFiles(FilenameFilter filter) {
11751169
String[] ss = normalizedList();
11761170
if (ss == null) return null;
11771171
ArrayList<File> files = new ArrayList<>();
1172+
boolean isEmpty = path.isEmpty();
11781173
for (String s : ss)
11791174
if ((filter == null) || filter.accept(this, s))
1180-
files.add(new File(s, this));
1175+
files.add(isEmpty ? new File(s) : new File(s, this));
11811176
return files.toArray(new File[files.size()]);
11821177
}
11831178

@@ -1208,8 +1203,9 @@ public File[] listFiles(FileFilter filter) {
12081203
String[] ss = normalizedList();
12091204
if (ss == null) return null;
12101205
ArrayList<File> files = new ArrayList<>();
1206+
boolean isEmpty = path.isEmpty();
12111207
for (String s : ss) {
1212-
File f = new File(s, this);
1208+
File f = isEmpty ? new File(s) : new File(s, this);
12131209
if ((filter == null) || filter.accept(f))
12141210
files.add(f);
12151211
}

src/java.base/share/man/java.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2817,9 +2817,8 @@ Java HotSpot VM.
28172817
`-XX:+UseNUMA`
28182818
: Enables performance optimization of an application on a machine with
28192819
nonuniform memory architecture (NUMA) by increasing the application's use
2820-
of lower latency memory. By default, this option is disabled and no
2821-
optimization for NUMA is made. The option is available only when the
2822-
parallel garbage collector is used (`-XX:+UseParallelGC`).
2820+
of lower latency memory. The default value for this option depends on the
2821+
garbage collector.
28232822

28242823
`-XX:+UseParallelGC`
28252824
: Enables the use of the parallel scavenge garbage collector (also known as

src/jdk.jfr/share/classes/jdk/jfr/events/FileReadEvent.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,13 @@
3838
@Label("File Read")
3939
@Category("Java Application")
4040
@Description("Reading data from a file")
41-
@StackFilter({"java.io.FileInputStream", "java.io.RandomAccessFile", "sun.nio.ch.FileChannelImpl"})
41+
@StackFilter({"java.nio.channels.FileChannel",
42+
"java.io.DataInputStream",
43+
"java.io.FileInputStream",
44+
"java.io.InputStream",
45+
"java.io.RandomAccessFile",
46+
"sun.nio.ch.ChannelInputStream",
47+
"sun.nio.ch.FileChannelImpl"})
4248
@Throttle
4349
public final class FileReadEvent extends MirrorEvent {
4450

src/jdk.jfr/share/classes/jdk/jfr/events/FileWriteEvent.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,13 @@
3838
@Label("File Write")
3939
@Category("Java Application")
4040
@Description("Writing data to a file")
41-
@StackFilter({"java.io.FileOutputStream", "java.io.RandomAccessFile", "sun.nio.ch.FileChannelImpl"})
41+
@StackFilter({"java.nio.channels.FileChannel",
42+
"java.io.DataOutputStream",
43+
"java.io.FileOutputStream",
44+
"java.io.OutputStream",
45+
"java.io.RandomAccessFile",
46+
"sun.nio.ch.ChannelOutputStream",
47+
"sun.nio.ch.FileChannelImpl"})
4248
@Throttle
4349
public final class FileWriteEvent extends MirrorEvent {
4450

src/jdk.jfr/share/classes/jdk/jfr/events/SocketReadEvent.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@
3939
@Label("Socket Read")
4040
@Category("Java Application")
4141
@Description("Reading data from a socket")
42+
@StackFilter({"java.io.InputStream",
43+
"java.net.Socket$SocketInputStream",
44+
"java.nio.channels.SocketChannel",
45+
"sun.nio.ch.SocketInputStream"})
4246
@Throttle
4347
public final class SocketReadEvent extends MirrorEvent {
4448

src/jdk.jfr/share/classes/jdk/jfr/events/SocketWriteEvent.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@
3838
@Label("Socket Write")
3939
@Category("Java Application")
4040
@Description("Writing data to a socket")
41+
@StackFilter({"java.io.OutputStream",
42+
"java.net.Socket$SocketOutputStream",
43+
"java.nio.channels.SocketChannel",
44+
"sun.nio.ch.SocketOutputStream"})
4145
@Throttle
4246
public final class SocketWriteEvent extends MirrorEvent {
4347

src/jdk.jfr/share/classes/jdk/jfr/internal/PlatformEventType.java

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -95,18 +95,6 @@ private boolean isExceptionEvent() {
9595
return false;
9696
}
9797

98-
private boolean isStaticCommit() {
99-
switch (getName()) {
100-
case Type.EVENT_NAME_PREFIX + "SocketRead" :
101-
case Type.EVENT_NAME_PREFIX + "SocketWrite" :
102-
case Type.EVENT_NAME_PREFIX + "FileRead" :
103-
case Type.EVENT_NAME_PREFIX + "FileWrite" :
104-
case Type.EVENT_NAME_PREFIX + "FileForce" :
105-
return true;
106-
}
107-
return false;
108-
}
109-
11098
private int determineStackTraceOffset() {
11199
if (isJDK) {
112100
// Order matters
@@ -116,9 +104,14 @@ private int determineStackTraceOffset() {
116104
if (getModification() == Modification.TRACING) {
117105
return 5;
118106
}
119-
if (isStaticCommit()) {
120-
return 3;
121-
}
107+
return switch (getName()) {
108+
case Type.EVENT_NAME_PREFIX + "SocketRead",
109+
Type.EVENT_NAME_PREFIX + "SocketWrite",
110+
Type.EVENT_NAME_PREFIX + "FileRead",
111+
Type.EVENT_NAME_PREFIX + "FileWrite" -> 6;
112+
case Type.EVENT_NAME_PREFIX + "FileForce" -> 5;
113+
default -> 3;
114+
};
122115
}
123116
return 3;
124117
}

test/hotspot/jtreg/applications/scimark/Scimark.java

Lines changed: 0 additions & 63 deletions
This file was deleted.

0 commit comments

Comments
 (0)