Skip to content

Commit

Permalink
Merge branch 'openjdk:master' into jbs8332535
Browse files Browse the repository at this point in the history
  • Loading branch information
sendaoYan committed May 28, 2024
2 parents 9879aab + 86eb5d9 commit 3f4d450
Show file tree
Hide file tree
Showing 624 changed files with 15,983 additions and 7,821 deletions.
3 changes: 3 additions & 0 deletions make/InitSupport.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -501,9 +501,12 @@ else # $(HAS_SPEC)=true
# Failure logs are only supported for "parallel" main targets, not the
# (trivial) sequential make targets (such as clean and reconfigure),
# since the failure-logs directory creation will conflict with clean.
# We also make sure the javatmp directory exists, which is needed if a java
# process (like javac) is using java.io.tmpdir.
define PrepareFailureLogs
$(RM) -r $(MAKESUPPORT_OUTPUTDIR)/failure-logs 2> /dev/null && \
$(MKDIR) -p $(MAKESUPPORT_OUTPUTDIR)/failure-logs
$(MKDIR) -p $(JAVA_TMP_DIR)
$(RM) $(MAKESUPPORT_OUTPUTDIR)/exit-with-error 2> /dev/null
endef

Expand Down
5 changes: 4 additions & 1 deletion make/autoconf/spec.gmk.template
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,8 @@ BUNDLES_OUTPUTDIR = $(OUTPUTDIR)/bundles
TESTMAKE_OUTPUTDIR = $(OUTPUTDIR)/test-make
MAKESUPPORT_OUTPUTDIR = $(OUTPUTDIR)/make-support

JAVA_TMP_DIR = $(SUPPORT_OUTPUTDIR)/javatmp

# This does not get overridden in a bootcycle build
CONFIGURESUPPORT_OUTPUTDIR := @CONFIGURESUPPORT_OUTPUTDIR@
BUILDJDK_OUTPUTDIR = $(OUTPUTDIR)/buildjdk
Expand Down Expand Up @@ -634,7 +636,8 @@ STATIC_BUILD := @STATIC_BUILD@

STRIPFLAGS := @STRIPFLAGS@

JAVA_FLAGS := @JAVA_FLAGS@
JAVA_FLAGS_TMPDIR := -Djava.io.tmpdir=$(JAVA_TMP_DIR)
JAVA_FLAGS := @JAVA_FLAGS@ $(JAVA_FLAGS_TMPDIR)
JAVA_FLAGS_BIG := @JAVA_FLAGS_BIG@
JAVA_FLAGS_SMALL := @JAVA_FLAGS_SMALL@
BUILD_JAVA_FLAGS_SMALL := @BUILD_JAVA_FLAGS_SMALL@
Expand Down
4 changes: 2 additions & 2 deletions make/common/JavaCompilation.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ define SetupJavaCompilationBody

ifeq ($$($1_COMPILER), bootjdk)
# Javac server is not available when using the bootjdk compiler.
$1_JAVAC_CMD := $$(JAVAC)
$1_JAVAC_CMD := $$(JAVAC) -J$$(JAVA_FLAGS_TMPDIR)

ifeq ($$($1_SMALL_JAVA), true)
$1_FLAGS += $$(addprefix -J, $$(JAVA_FLAGS_SMALL))
Expand All @@ -211,7 +211,7 @@ define SetupJavaCompilationBody
$1_TARGET_RELEASE := $$(TARGET_RELEASE_BOOTJDK)
endif
else ifeq ($$($1_COMPILER), buildjdk)
$1_JAVAC_CMD := $$(BUILD_JAVAC)
$1_JAVAC_CMD := $$(BUILD_JAVAC) -J$$(JAVA_FLAGS_TMPDIR)

ifeq ($$($1_TARGET_RELEASE), )
# If unspecified, default to the new jdk we're building
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
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: 4 additions & 0 deletions make/test/BuildFailureHandler.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ IMAGES_TARGETS += $(COPY_FH)
# Use JTREG_TEST_OPTS for test VM options
# Use JTREG_TESTS for jtreg tests parameter
#
# Most likely you want to select a specific test from test/failure_handler/test
# and manually inspect the results. This target does not actually verify
# anything about the failure_handler's output or even if it ran at all.
#
RUN_DIR := $(FH_SUPPORT)/test

test:
Expand Down
2 changes: 2 additions & 0 deletions make/test/BuildMicrobenchmark.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Loading

0 comments on commit 3f4d450

Please sign in to comment.