Skip to content

Commit

Permalink
Merge branch 'master' of https://git.openjdk.org/jdk into JDK-8331947
Browse files Browse the repository at this point in the history
  • Loading branch information
hns committed May 23, 2024
2 parents c3a92a2 + e19a421 commit 89a201d
Show file tree
Hide file tree
Showing 490 changed files with 33,072 additions and 4,154 deletions.
2 changes: 1 addition & 1 deletion make/CompileDemos.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ $(eval $(call SetupBuildDemo, SwingSet2, \
))

$(eval $(call SetupBuildDemo, Font2DTest, \
DISABLED_WARNINGS := rawtypes deprecation unchecked serial cast this-escape, \
DISABLED_WARNINGS := rawtypes deprecation unchecked serial cast this-escape dangling-doc-comments, \
DEMO_SUBDIR := jfc, \
))

Expand Down
2 changes: 1 addition & 1 deletion make/autoconf/spec.gmk.template
Original file line number Diff line number Diff line change
Expand Up @@ -675,7 +675,7 @@ DOCS_REFERENCE_JAVADOC := @DOCS_REFERENCE_JAVADOC@
SOURCE_REVISION_TRACKER := $(SUPPORT_OUTPUTDIR)/src-rev/source-revision-tracker

# Interim langtools modules and arguments
INTERIM_LANGTOOLS_BASE_MODULES := java.compiler jdk.compiler jdk.javadoc
INTERIM_LANGTOOLS_BASE_MODULES := java.compiler jdk.compiler jdk.internal.md jdk.javadoc
INTERIM_LANGTOOLS_MODULES := $(addsuffix .interim, $(INTERIM_LANGTOOLS_BASE_MODULES))
INTERIM_LANGTOOLS_ADD_EXPORTS := \
--add-exports java.base/sun.reflect.annotation=jdk.compiler.interim \
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -54,7 +54,7 @@ public FileTreeCreator(Path startDir, Vector<BuildConfig> allConfigs, WinGammaPl
attributes.push(new DirAttributes());
}

public class DirAttributes {
public static class DirAttributes {

private HashSet<BuildConfig> ignores;
private HashSet<BuildConfig> disablePch;
Expand Down
11 changes: 11 additions & 0 deletions make/jdk/src/classes/build/tools/classlist/HelloClasslist.java
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,17 @@ public static void main(String ... args) throws Throwable {

LOGGER.log(Level.FINE, "New Date: " + newDate + " - old: " + oldDate);

// Pull SwitchBootstraps and associated classes into the classlist
record A(int a) { }
record B(int b) { }
Object o = new A(4711);
int value = switch (o) {
case A a -> a.a;
case B b -> b.b;
default -> 17;
};
LOGGER.log(Level.FINE, "Value: " + value);

// The Striped64$Cell is loaded rarely only when there's a contention among
// multiple threads performing LongAdder.increment(). This results in
// an inconsistency in the classlist between builds (see JDK-8295951).
Expand Down
12 changes: 9 additions & 3 deletions make/jdk/src/classes/build/tools/intpoly/FieldGen.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2018, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2018, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -778,7 +778,7 @@ private String generate(FieldParams params) throws IOException {
result.appendLine("}");

result.appendLine("@Override");
result.appendLine("protected void mult(long[] a, long[] b, long[] r) {");
result.appendLine("protected int mult(long[] a, long[] b, long[] r) {");
result.incrIndent();
for (int i = 0; i < 2 * params.getNumLimbs() - 1; i++) {
result.appendIndent();
Expand All @@ -804,6 +804,9 @@ private String generate(FieldParams params) throws IOException {
}
}
result.append(");\n");
result.appendIndent();
result.append("return 0;");
result.appendLine();
result.decrIndent();
result.appendLine("}");

Expand Down Expand Up @@ -833,7 +836,7 @@ private String generate(FieldParams params) throws IOException {
// }
// }
result.appendLine("@Override");
result.appendLine("protected void square(long[] a, long[] r) {");
result.appendLine("protected int square(long[] a, long[] r) {");
result.incrIndent();
for (int i = 0; i < 2 * params.getNumLimbs() - 1; i++) {
result.appendIndent();
Expand Down Expand Up @@ -874,6 +877,9 @@ private String generate(FieldParams params) throws IOException {
}
}
result.append(");\n");
result.appendIndent();
result.append("return 0;");
result.appendLine();
result.decrIndent();
result.appendLine("}");

Expand Down
9 changes: 7 additions & 2 deletions make/jdk/src/classes/build/tools/taglet/JSpec.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -30,6 +30,8 @@
import java.util.Set;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Collectors;

import javax.lang.model.element.Element;

import com.sun.source.doctree.DocTree;
Expand Down Expand Up @@ -157,7 +159,10 @@ public String toString(List<? extends DocTree> tags, Element elem) {
continue;
}

String tagText = contents.toString().trim();
String tagText = contents.stream()
.map(Object::toString)
.collect(Collectors.joining())
.trim();
Matcher m = TAG_PATTERN.matcher(tagText);
if (m.find()) {
String chapter = m.group("chapter");
Expand Down
11 changes: 8 additions & 3 deletions make/jdk/src/classes/build/tools/taglet/ToolGuide.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -30,6 +30,8 @@
import java.util.Set;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Collectors;

import javax.lang.model.element.Element;
import javax.lang.model.element.PackageElement;
import javax.lang.model.element.TypeElement;
Expand Down Expand Up @@ -105,8 +107,11 @@ public String toString(List<? extends DocTree> tags, Element elem) {
continue;
}

UnknownBlockTagTree blockTag = (UnknownBlockTagTree)tag;
String tagText = blockTag.getContent().toString().trim();
UnknownBlockTagTree blockTag = (UnknownBlockTagTree) tag;
String tagText = blockTag.getContent().stream()
.map(Object::toString)
.collect(Collectors.joining())
.trim();
Matcher m = TAG_PATTERN.matcher(tagText);
if (m.matches()) {
String name = m.group("name");
Expand Down
2 changes: 1 addition & 1 deletion make/modules/java.base/Java.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
# new warning is added to javac, it can be temporarily added to the
# disabled warnings list.
#
# DISABLED_WARNINGS_java +=
DISABLED_WARNINGS_java += dangling-doc-comments

DOCLINT += -Xdoclint:all/protected \
'-Xdoclint/package:java.*,javax.*'
Expand Down
4 changes: 3 additions & 1 deletion make/modules/jdk.incubator.vector/Java.gmk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
Expand All @@ -23,4 +23,6 @@
# questions.
#

DISABLED_WARNINGS_java += dangling-doc-comments

DOCLINT += -Xdoclint:all/protected
26 changes: 26 additions & 0 deletions make/modules/jdk.internal.md/Java.gmk
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#
# Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation. Oracle designates this
# particular file as subject to the "Classpath" exception as provided
# by Oracle in the LICENSE file that accompanied this code.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
#

COPY += .txt
4 changes: 3 additions & 1 deletion make/modules/jdk.jpackage/Java.gmk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
Expand All @@ -23,6 +23,8 @@
# questions.
#

DISABLED_WARNINGS_java += dangling-doc-comments

COPY += .gif .png .txt .spec .script .prerm .preinst \
.postrm .postinst .list .sh .desktop .copyright .control .plist .template \
.icns .scpt .wxs .wxl .wxi .ico .bmp .tiff .service
Expand Down
26 changes: 26 additions & 0 deletions make/modules/jdk.unsupported/Java.gmk
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#
# Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation. Oracle designates this
# particular file as subject to the "Classpath" exception as provided
# by Oracle in the LICENSE file that accompanied this code.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
#

DISABLED_WARNINGS_java += dangling-doc-comments
6 changes: 4 additions & 2 deletions make/test/BuildMicrobenchmark.gmk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2018, 2024, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -95,7 +95,7 @@ $(eval $(call SetupJavaCompilation, BUILD_JDK_MICROBENCHMARK, \
SMALL_JAVA := false, \
CLASSPATH := $(JMH_COMPILE_JARS), \
DISABLED_WARNINGS := restricted this-escape processing rawtypes cast \
serial preview, \
serial preview dangling-doc-comments, \
SRC := $(MICROBENCHMARK_SRC), \
BIN := $(MICROBENCHMARK_CLASSES), \
JAVAC_FLAGS := \
Expand All @@ -109,6 +109,8 @@ $(eval $(call SetupJavaCompilation, BUILD_JDK_MICROBENCHMARK, \
--add-exports java.base/jdk.internal.vm=ALL-UNNAMED \
--add-exports java.base/sun.invoke.util=ALL-UNNAMED \
--add-exports java.base/sun.security.util=ALL-UNNAMED \
--add-exports java.base/sun.security.util.math=ALL-UNNAMED \
--add-exports java.base/sun.security.util.math.intpoly=ALL-UNNAMED \
--enable-preview \
-XDsuppressNotes \
-processor org.openjdk.jmh.generators.BenchmarkProcessor, \
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/cpu/aarch64/aarch64.ad
Original file line number Diff line number Diff line change
Expand Up @@ -16230,7 +16230,7 @@ instruct partialSubtypeCheckConstSuper(iRegP_R4 sub, iRegP_R0 super_reg, immP su
effect(KILL cr, TEMP tempR1, TEMP tempR2, TEMP tempR3, TEMP vtemp);

ins_cost(700); // smaller than the next version
format %{ "partialSubtypeCheck $result, $sub, super" %}
format %{ "partialSubtypeCheck $result, $sub, $super_reg, $super_con" %}

ins_encode %{
bool success = false;
Expand Down
15 changes: 0 additions & 15 deletions src/hotspot/cpu/aarch64/gc/shared/barrierSetAssembler_aarch64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -269,21 +269,6 @@ void BarrierSetAssembler::tlab_allocate(MacroAssembler* masm, Register obj,
// verify_tlab();
}

void BarrierSetAssembler::incr_allocated_bytes(MacroAssembler* masm,
Register var_size_in_bytes,
int con_size_in_bytes,
Register t1) {
assert(t1->is_valid(), "need temp reg");

__ ldr(t1, Address(rthread, in_bytes(JavaThread::allocated_bytes_offset())));
if (var_size_in_bytes->is_valid()) {
__ add(t1, t1, var_size_in_bytes);
} else {
__ add(t1, t1, con_size_in_bytes);
}
__ str(t1, Address(rthread, in_bytes(JavaThread::allocated_bytes_offset())));
}

static volatile uint32_t _patching_epoch = 0;

address BarrierSetAssembler::patching_epoch_addr() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,6 @@ enum class NMethodPatchingType {
};

class BarrierSetAssembler: public CHeapObj<mtGC> {
private:
void incr_allocated_bytes(MacroAssembler* masm,
Register var_size_in_bytes, int con_size_in_bytes,
Register t1 = noreg);

public:
virtual void arraycopy_prologue(MacroAssembler* masm, DecoratorSet decorators, bool is_oop,
Register src, Register dst, Register count, RegSet saved_regs) {}
Expand Down
40 changes: 0 additions & 40 deletions src/hotspot/cpu/arm/gc/shared/barrierSetAssembler_arm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,46 +159,6 @@ void BarrierSetAssembler::tlab_allocate(MacroAssembler* masm, Register obj, Regi
__ str(obj_end, Address(Rthread, JavaThread::tlab_top_offset()));
}

void BarrierSetAssembler::incr_allocated_bytes(MacroAssembler* masm, RegisterOrConstant size_in_bytes, Register tmp) {
// Bump total bytes allocated by this thread
Label done;

// Borrow the Rthread for alloc counter
Register Ralloc = Rthread;
__ add(Ralloc, Ralloc, in_bytes(JavaThread::allocated_bytes_offset()));
__ ldr(tmp, Address(Ralloc));
__ adds(tmp, tmp, size_in_bytes);
__ str(tmp, Address(Ralloc), cc);
__ b(done, cc);

// Increment the high word and store single-copy atomically (that is an unlikely scenario on typical embedded systems as it means >4GB has been allocated)
// To do so ldrd/strd instructions used which require an even-odd pair of registers. Such a request could be difficult to satisfy by
// allocating those registers on a higher level, therefore the routine is ready to allocate a pair itself.
Register low, high;
// Select ether R0/R1 or R2/R3

if (size_in_bytes.is_register() && (size_in_bytes.as_register() == R0 || size_in_bytes.as_register() == R1)) {
low = R2;
high = R3;
} else {
low = R0;
high = R1;
}
__ push(RegisterSet(low, high));

__ ldrd(low, Address(Ralloc));
__ adds(low, low, size_in_bytes);
__ adc(high, high, 0);
__ strd(low, Address(Ralloc));

__ pop(RegisterSet(low, high));

__ bind(done);

// Unborrow the Rthread
__ sub(Rthread, Ralloc, in_bytes(JavaThread::allocated_bytes_offset()));
}

void BarrierSetAssembler::nmethod_entry_barrier(MacroAssembler* masm) {

BarrierSetNMethod* bs_nm = BarrierSet::barrier_set()->barrier_set_nmethod();
Expand Down
6 changes: 0 additions & 6 deletions src/hotspot/cpu/arm/gc/shared/barrierSetAssembler_arm.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,6 @@ enum class NMethodPatchingType {
};

class BarrierSetAssembler: public CHeapObj<mtGC> {
private:
void incr_allocated_bytes(MacroAssembler* masm,
RegisterOrConstant size_in_bytes,
Register tmp
);

public:
virtual void arraycopy_prologue(MacroAssembler* masm, DecoratorSet decorators, bool is_oop,
Register addr, Register count, int callee_saved_regs) {}
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/cpu/ppc/c1_MacroAssembler_ppc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ void C1_MacroAssembler::try_allocate(
Register obj, // result: pointer to object after successful allocation
Register var_size_in_bytes, // object size in bytes if unknown at compile time; invalid otherwise
int con_size_in_bytes, // object size in bytes if known at compile time
Register t1, // temp register, must be global register for incr_allocated_bytes
Register t1, // temp register
Register t2, // temp register
Label& slow_case // continuation point if fast allocation fails
) {
Expand Down
3 changes: 0 additions & 3 deletions src/hotspot/cpu/ppc/macroAssembler_ppc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2209,9 +2209,6 @@ void MacroAssembler::tlab_allocate(
std(new_top, in_bytes(JavaThread::tlab_top_offset()), R16_thread);
//verify_tlab(); not implemented
}
void MacroAssembler::incr_allocated_bytes(RegisterOrConstant size_in_bytes, Register t1, Register t2) {
unimplemented("incr_allocated_bytes");
}

address MacroAssembler::emit_trampoline_stub(int destination_toc_offset,
int insts_call_instruction_offset, Register Rtoc) {
Expand Down
Loading

0 comments on commit 89a201d

Please sign in to comment.