Skip to content

Commit

Permalink
Merge branch 'dragonwell-project:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
Accelerator1996 authored Oct 17, 2024
2 parents bd986bf + abd83af commit c19db11
Show file tree
Hide file tree
Showing 167 changed files with 11,846 additions and 628 deletions.
2 changes: 1 addition & 1 deletion make.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ if [ $# != 1 ]; then
fi

# incr by every Dragonwell release
DRAGONWELL_VERSION=20
DRAGONWELL_VERSION=21
LC_ALL=C
BUILD_MODE=$1
arch=$(uname -m)
Expand Down
4 changes: 4 additions & 0 deletions make/CompileDemos.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,10 @@ $(eval $(call SetupBuildDemo, TransparentRuler, \
MAIN_CLASS := transparentruler.Ruler, \
))

$(eval $(call SetupBuildDemo, JavaCompilerCRaC, \
DEMO_SUBDIR := crac, \
))

################################################################################
# Copy html and README files.

Expand Down
9 changes: 9 additions & 0 deletions make/autoconf/libraries.m4
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,15 @@ AC_DEFUN_ONCE([LIB_SETUP_LIBRARIES],
BASIC_JVM_LIBS="$BASIC_JVM_LIBS -lthread"
fi
# librt for legacy clock_gettime
if test "x$OPENJDK_TARGET_OS" = xlinux; then
# Hotspot needs to link librt to get the clock_* functions.
# But once our supported minimum build and runtime platform
# has glibc 2.17, this can be removed as the functions are
# in libc.
BASIC_JVM_LIBS="$BASIC_JVM_LIBS -lrt"
fi
# Because RISC-V only has word-sized atomics, it requries libatomic where
# other common architectures do not. So link libatomic by default.
if test "x$OPENJDK_TARGET_OS" = xlinux && test "x$OPENJDK_TARGET_CPU" = xriscv64; then
Expand Down
5 changes: 5 additions & 0 deletions make/hotspot/symbols/symbols-shared
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,8 @@ JNI_GetDefaultJavaVMInitArgs
JVM_FindClassFromBootLoader
JVM_GetVersionInfo
JVM_InitAgentProperties
JVM_Checkpoint
JVM_RegisterPersistent
JVM_DeregisterPersistent
JVM_RegisterPseudoPersistent
JVM_UnregisterPseudoPersistent
2 changes: 2 additions & 0 deletions make/hotspot/symbols/symbols-unix
Original file line number Diff line number Diff line change
Expand Up @@ -199,3 +199,5 @@ JVM_AddModuleExportsToAllUnnamed
JVM_AddReadsModule
JVM_DefineModule
JVM_SetBootLoaderUnnamedModule

JVM_CheckpointEnabled
38 changes: 38 additions & 0 deletions make/launcher/Launcher-java.base.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,41 @@ ifeq ($(call isTargetOs, macosx solaris aix linux), true)
endif

################################################################################

ifeq ($(OPENJDK_TARGET_OS), linux)
$(eval $(call SetupJdkExecutable, BUILD_CRIUENGINE, \
NAME := criuengine, \
SRC := $(TOPDIR)/src/$(MODULE)/unix/native/criuengine, \
INCLUDE_FILES := criuengine.c, \
OPTIMIZATION := HIGH, \
CFLAGS := $(CFLAGS_JDKEXE), \
LDFLAGS := $(LDFLAGS), \
OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/modules_libs/$(MODULE), \
))
TARGETS += $(BUILD_CRIUENGINE)

$(eval $(call SetupJdkExecutable, BUILD_PAUSEENGINE, \
NAME := pauseengine, \
SRC := $(TOPDIR)/src/$(MODULE)/unix/native/pauseengine, \
INCLUDE_FILES := pauseengine.c, \
OPTIMIZATION := LOW, \
CFLAGS := $(CFLAGS_JDKEXE), \
LDFLAGS := $(LDFLAGS), \
OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/modules_libs/$(MODULE), \
))
TARGETS += $(BUILD_PAUSEENGINE)

$(eval $(call SetupJdkExecutable, BUILD_SIMENGINE, \
NAME := simengine, \
SRC := $(TOPDIR)/src/$(MODULE)/unix/native/simengine, \
INCLUDE_FILES := simengine.c, \
OPTIMIZATION := LOW, \
CFLAGS := $(CFLAGS_JDKEXE), \
LDFLAGS := $(LDFLAGS), \
OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/modules_libs/$(MODULE), \
))
TARGETS += $(BUILD_SIMENGINE)

endif

################################################################################
5 changes: 5 additions & 0 deletions src/demo/share/crac/JavaCompilerCRaC/Compile.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
public class Compile {
public static void main(String... args) throws Exception {
JavaCompilerCRaC.runJavac(args);
}
}
29 changes: 29 additions & 0 deletions src/demo/share/crac/JavaCompilerCRaC/JavaCompilerCRaC.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import java.util.Arrays;
import jdk.crac.Core;

public class JavaCompilerCRaC {

static void runJavac(String... args) {
System.out.println("javac " + String.join(" ", args));
int status = com.sun.tools.javac.Main.compile(args);
if (status != 0) {
System.exit(status);
}
}

public static void main(String... args) throws Exception {
int startIdx = 0;
for (int endIdx = 1; endIdx < args.length; ++endIdx) {
if (args[endIdx].equals("--")) {
runJavac(Arrays.copyOfRange(args, startIdx, endIdx));
startIdx = endIdx + 1;
}
}

if (startIdx < args.length) {
runJavac(Arrays.copyOfRange(args, startIdx, args.length));
}

Core.checkpointRestore();
}
}
46 changes: 39 additions & 7 deletions src/hotspot/cpu/riscv/riscv.ad
Original file line number Diff line number Diff line change
Expand Up @@ -9921,6 +9921,23 @@ instruct cmovI_cmpL(iRegINoSp dst, iRegI src, iRegL op1, iRegL op2, cmpOp cop) %
ins_pipe(pipe_slow);
%}

instruct cmovI_cmpUL(iRegINoSp dst, iRegI src, iRegL op1, iRegL op2, cmpOpU cop) %{
match(Set dst (CMoveI (Binary cop (CmpUL op1 op2)) (Binary dst src)));
ins_cost(ALU_COST + BRANCH_COST);

format %{
"CMove $dst, ($op1 $cop $op2), $dst, $src\t#@cmovI_cmpUL\n\t"
%}

ins_encode %{
__ enc_cmove($cop$$cmpcode | MacroAssembler::unsigned_branch_mask,
as_Register($op1$$reg), as_Register($op2$$reg),
as_Register($dst$$reg), as_Register($src$$reg));
%}

ins_pipe(pipe_class_compare);
%}

instruct cmovL_cmpL(iRegLNoSp dst, iRegL src, iRegL op1, iRegL op2, cmpOp cop) %{
match(Set dst (CMoveL (Binary cop (CmpL op1 op2)) (Binary dst src)));
ins_cost(ALU_COST + BRANCH_COST);
Expand Down Expand Up @@ -9959,14 +9976,30 @@ instruct cmovL_cmpUL(iRegLNoSp dst, iRegL src, iRegL op1, iRegL op2, cmpOpU cop)
ins_pipe(pipe_slow);
%}

instruct cmovI_cmpUL(iRegINoSp dst, iRegI src, iRegL op1, iRegL op2, cmpOpU cop) %{
match(Set dst (CMoveI (Binary cop (CmpUL op1 op2)) (Binary dst src)));
instruct cmovL_cmpI(iRegLNoSp dst, iRegL src, iRegI op1, iRegI op2, cmpOp cop) %{
match(Set dst (CMoveL (Binary cop (CmpI op1 op2)) (Binary dst src)));
ins_cost(ALU_COST + BRANCH_COST);

format %{
"CMove $dst, ($op1 $cop $op2), $dst, $src\t#@cmovL_cmpI\n\t"
%}

ins_encode %{
__ enc_cmove($cop$$cmpcode,
as_Register($op1$$reg), as_Register($op2$$reg),
as_Register($dst$$reg), as_Register($src$$reg));
%}

ins_pipe(pipe_class_compare);
%}

instruct cmovL_cmpU(iRegLNoSp dst, iRegL src, iRegI op1, iRegI op2, cmpOpU cop) %{
match(Set dst (CMoveL (Binary cop (CmpU op1 op2)) (Binary dst src)));
ins_cost(ALU_COST + BRANCH_COST);

format %{
"bneg$cop $op1, $op2\t#@cmovI_cmpUL\n\t"
"mv $dst, $src\n\t"
"skip:"
%}
"CMove $dst, ($op1 $cop $op2), $dst, $src\t#@cmovL_cmpU\n\t"
%}

ins_encode %{
__ enc_cmove($cop$$cmpcode | MacroAssembler::unsigned_branch_mask,
Expand All @@ -9977,7 +10010,6 @@ instruct cmovI_cmpUL(iRegINoSp dst, iRegI src, iRegL op1, iRegL op2, cmpOpU cop)
ins_pipe(pipe_slow);
%}


// ============================================================================
// Procedure Call/Return Instructions

Expand Down
Loading

0 comments on commit c19db11

Please sign in to comment.