Skip to content

Commit

Permalink
Merge branch 'master' into zfhmin
Browse files Browse the repository at this point in the history
  • Loading branch information
robehn committed Jan 18, 2025
2 parents 586225e + 1f0efc0 commit cafa804
Show file tree
Hide file tree
Showing 454 changed files with 6,608 additions and 2,763 deletions.
4 changes: 2 additions & 2 deletions bin/idea.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh
#
# Copyright (c) 2009, 2020, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2009, 2025, 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 @@ -99,7 +99,7 @@ if [ "$VERBOSE" = "true" ] ; then
echo "idea template dir: $IDEA_TEMPLATE"
fi

cd $TOP ; make -f "$IDEA_MAKE/idea.gmk" -I $MAKE_DIR/.. idea MAKEOVERRIDES= OUT=$IDEA_OUTPUT/env.cfg MODULES="$*" $CONF_ARG || exit 1
cd $TOP ; make idea-gen-config IDEA_OUTPUT=$IDEA_OUTPUT MODULES="$*" $CONF_ARG || exit 1
cd $SCRIPT_DIR

. $IDEA_OUTPUT/env.cfg
Expand Down
10 changes: 9 additions & 1 deletion make/Main.gmk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 2025, 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 @@ -356,6 +356,14 @@ $(eval $(call SetupTarget, vscode-project-ccls, \
DEPS := compile-commands, \
))

################################################################################
# IDEA IntelliJ projects

$(eval $(call SetupTarget, idea-gen-config, \
MAKEFILE := ide/idea/jdk/IdeaGenConfig, \
ARGS := IDEA_OUTPUT="$(IDEA_OUTPUT)" MODULES="$(MODULES)", \
))

################################################################################
# Build demos targets

Expand Down
3 changes: 2 additions & 1 deletion make/autoconf/jdk-options.m4
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 2025, 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 @@ -446,6 +446,7 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_ADDRESS_SANITIZER],
fi
if test "x$TOOLCHAIN_TYPE" = "xclang"; then
ASAN_CFLAGS="$ASAN_CFLAGS -fsanitize-address-use-after-return=never"
ASAN_LDFLAGS="$ASAN_LDFLAGS -shared-libasan"
fi
elif test "x$TOOLCHAIN_TYPE" = "xmicrosoft"; then
# -Oy- is equivalent to -fno-omit-frame-pointer in GCC/Clang.
Expand Down
55 changes: 27 additions & 28 deletions make/ide/idea/jdk/idea.gmk → make/ide/idea/jdk/IdeaGenConfig.gmk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2016, 2025, 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,36 +23,35 @@
# questions.
#

include Makefile
include make/MainSupport.gmk

.PHONY: idea

ifeq ($(SPEC), )
ifneq ($(words $(SPECS)), 1)
@echo "Error: Multiple build specification files found. Please select one explicitly."
@exit 2
endif
idea:
@cd $(topdir)
@$(MAKE) $(MFLAGS) $(MAKE_LOG_FLAGS) -r -R -j 1 -f $(topdir)/make/ide/idea/jdk/idea.gmk SPEC=$(SPECS) HAS_SPEC=true ACTUAL_TOPDIR=$(topdir) MODULES="$(MODULES)" idea
else #with SPEC
include make/common/Modules.gmk

ifeq ($(MODULES), )
SEL_MODULES := $(call FindAllModules)
else
SEL_MODULES := $(MODULES)
endif

idea:
default: all

include $(SPEC)
include MakeBase.gmk

include Modules.gmk

# MODULES and IDEA_OUTPUT is passed on the command line
ifeq ($(MODULES), )
override MODULES := $(call FindAllModules)
endif

ifeq ($(IDEA_OUTPUT), )
override IDEA_OUTPUT := $(WORKSPACE_ROOT)/.idea
endif

OUT := $(IDEA_OUTPUT)/env.cfg

idea:
$(RM) $(OUT)
$(ECHO) "SUPPORT=$(SUPPORT_OUTPUTDIR)" >> $(OUT)
$(ECHO) "MODULE_ROOTS=\"$(foreach mod, $(SEL_MODULES), $(call FindModuleSrcDirs, $(mod)))\"" >> $(OUT)
$(ECHO) "MODULE_NAMES=\"$(strip $(foreach mod, $(SEL_MODULES), $(mod)))\"" >> $(OUT)
$(ECHO) "SEL_MODULES=\"$(SEL_MODULES)\"" >> $(OUT)
$(ECHO) "MODULE_ROOTS=\"$(foreach mod, $(MODULES), $(call FindModuleSrcDirs, $(mod)))\"" >> $(OUT)
$(ECHO) "MODULE_NAMES=\"$(strip $(foreach mod, $(MODULES), $(mod)))\"" >> $(OUT)
$(ECHO) "SEL_MODULES=\"$(MODULES)\"" >> $(OUT)
$(ECHO) "BOOT_JDK=\"$(BOOT_JDK)\"" >> $(OUT)
$(ECHO) "CYGPATH=\"$(PATHTOOL)\"" >> $(OUT)
$(ECHO) "SPEC=\"$(SPEC)\"" >> $(OUT)
$(ECHO) "JT_HOME=\"$(JT_HOME)\"" >> $(OUT)

endif
all: idea

.PHONY: default all idea
3 changes: 1 addition & 2 deletions make/test/BuildTestLib.gmk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2015, 2025, 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 @@ -64,7 +64,6 @@ $(eval $(call SetupJavaCompilation, BUILD_TEST_LIB_JAR, \
BIN := $(TEST_LIB_SUPPORT)/test-lib_classes, \
HEADERS := $(TEST_LIB_SUPPORT)/test-lib_headers, \
JAR := $(TEST_LIB_SUPPORT)/test-lib.jar, \
DISABLED_WARNINGS := try deprecation rawtypes unchecked serial cast removal preview restricted dangling-doc-comments, \
JAVAC_FLAGS := --add-exports java.base/sun.security.util=ALL-UNNAMED \
--add-exports java.base/jdk.internal.classfile=ALL-UNNAMED \
--add-exports java.base/jdk.internal.classfile.attribute=ALL-UNNAMED \
Expand Down
4 changes: 2 additions & 2 deletions src/hotspot/cpu/aarch64/gc/z/zAddress_aarch64.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2017, 2025, 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 @@ -85,7 +85,7 @@ static size_t probe_valid_max_address_bit() {
munmap(result_addr, page_size);
}
}
log_info_p(gc, init)("Probing address space for the highest valid bit: " SIZE_FORMAT, max_address_bit);
log_info_p(gc, init)("Probing address space for the highest valid bit: %zu", max_address_bit);
return MAX2(max_address_bit, MINIMUM_MAX_ADDRESS_BIT);
#else // LINUX
return DEFAULT_MAX_ADDRESS_BIT;
Expand Down
6 changes: 3 additions & 3 deletions src/hotspot/cpu/arm/arm.ad
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Copyright (c) 2008, 2024, Oracle and/or its affiliates. All rights reserved.
// Copyright (c) 2008, 2025, 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 @@ -283,7 +283,7 @@ void MachPrologNode::format( PhaseRegAlloc *ra_, outputStream *st ) const {
}
st->print_cr("PUSH R_FP|R_LR_LR"); st->print("\t");
if (framesize != 0) {
st->print ("SUB R_SP, R_SP, " SIZE_FORMAT,framesize);
st->print ("SUB R_SP, R_SP, %zu", framesize);
}

if (C->stub_function() == nullptr && BarrierSet::barrier_set()->barrier_set_nmethod() != nullptr) {
Expand Down Expand Up @@ -362,7 +362,7 @@ void MachEpilogNode::format( PhaseRegAlloc *ra_, outputStream *st ) const {
framesize -= 2*wordSize;

if (framesize != 0) {
st->print("ADD R_SP, R_SP, " SIZE_FORMAT "\n\t",framesize);
st->print("ADD R_SP, R_SP, %zu\n\t",framesize);
}
st->print("POP R_FP|R_LR_LR");

Expand Down
4 changes: 2 additions & 2 deletions src/hotspot/cpu/ppc/gc/z/zAddress_ppc.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2017, 2025, 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 @@ -82,7 +82,7 @@ static size_t probe_valid_max_address_bit() {
munmap(result_addr, page_size);
}
}
log_info_p(gc, init)("Probing address space for the highest valid bit: " SIZE_FORMAT, max_address_bit);
log_info_p(gc, init)("Probing address space for the highest valid bit: %zu", max_address_bit);
return MAX2(max_address_bit, MINIMUM_MAX_ADDRESS_BIT);
#else // LINUX
return DEFAULT_MAX_ADDRESS_BIT;
Expand Down
81 changes: 51 additions & 30 deletions src/hotspot/cpu/riscv/assembler_riscv.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3231,42 +3231,63 @@ enum Nf {
#undef INSN

// Cache Management Operations
#define INSN(NAME, funct) \
void NAME(Register Rs1) { \
unsigned insn = 0; \
patch((address)&insn, 6, 0, 0b0001111); \
patch((address)&insn, 14, 12, 0b010); \
patch_reg((address)&insn, 15, Rs1); \
patch((address)&insn, 31, 20, funct); \
emit(insn); \
// These instruction may be turned off for user space.
private:
enum CBO_FUNCT : unsigned int {
CBO_INVAL = 0b0000000000000,
CBO_CLEAN = 0b0000000000001,
CBO_FLUSH = 0b0000000000010,
CBO_ZERO = 0b0000000000100
};

template <CBO_FUNCT FUNCT>
void cbo_base(Register Rs1) {
assert((UseZicbom && FUNCT != CBO_ZERO) || UseZicboz, "sanity");
unsigned insn = 0;
patch((address)&insn, 6, 0, 0b0001111);
patch((address)&insn, 14, 12, 0b010);
patch_reg((address)&insn, 15, Rs1);
patch((address)&insn, 31, 20, FUNCT);
emit(insn);
}

INSN(cbo_inval, 0b0000000000000);
INSN(cbo_clean, 0b0000000000001);
INSN(cbo_flush, 0b0000000000010);
INSN(cbo_zero, 0b0000000000100);
// This instruction have some security implication.
// At this time it's not likely to be enabled for user mode.
void cbo_inval(Register Rs1) { cbo_base<CBO_INVAL>(Rs1); }
public:
// Zicbom
void cbo_clean(Register Rs1) { cbo_base<CBO_CLEAN>(Rs1); }
void cbo_flush(Register Rs1) { cbo_base<CBO_FLUSH>(Rs1); }
// Zicboz
void cbo_zero(Register Rs1) { cbo_base<CBO_ZERO>(Rs1); }

#undef INSN
private:
enum PREFETCH_FUNCT : unsigned int {
PREFETCH_I = 0b0000000000000,
PREFETCH_R = 0b0000000000001,
PREFETCH_W = 0b0000000000011
};

#define INSN(NAME, funct) \
void NAME(Register Rs1, int32_t offset) { \
guarantee((offset & 0x1f) == 0, "offset lowest 5 bits must be zero"); \
int32_t upperOffset = offset >> 5; \
unsigned insn = 0; \
patch((address)&insn, 6, 0, 0b0010011); \
patch((address)&insn, 14, 12, 0b110); \
patch_reg((address)&insn, 15, Rs1); \
patch((address)&insn, 24, 20, funct); \
upperOffset &= 0x7f; \
patch((address)&insn, 31, 25, upperOffset); \
emit(insn); \
template <PREFETCH_FUNCT FUNCT>
void prefetch_base(Register Rs1, int32_t offset) {
assert_cond(UseZicbop);
guarantee((offset & 0x1f) == 0, "offset lowest 5 bits must be zero");
int32_t upperOffset = offset >> 5;
unsigned insn = 0;
patch((address)&insn, 6, 0, 0b0010011);
patch((address)&insn, 14, 12, 0b110);
patch_reg((address)&insn, 15, Rs1);
patch((address)&insn, 24, 20, FUNCT);
upperOffset &= 0x7f;
patch((address)&insn, 31, 25, upperOffset);
emit(insn);
}

INSN(prefetch_i, 0b0000000000000);
INSN(prefetch_r, 0b0000000000001);
INSN(prefetch_w, 0b0000000000011);

#undef INSN
public:
// Zicbop
void prefetch_i(Register Rs1, int32_t offset) { prefetch_base<PREFETCH_I>(Rs1, offset); }
void prefetch_r(Register Rs1, int32_t offset) { prefetch_base<PREFETCH_R>(Rs1, offset); }
void prefetch_w(Register Rs1, int32_t offset) { prefetch_base<PREFETCH_W>(Rs1, offset); }

// -------------- Zicond Instruction Definitions --------------
// Zicond conditional operations extension
Expand Down
8 changes: 7 additions & 1 deletion src/hotspot/cpu/riscv/c1_Runtime1_riscv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -883,7 +883,13 @@ OopMapSet* Runtime1::generate_code_for(C1StubId id, StubAssembler* sasm) {
__ ld(x10, Address(sp, (sup_k_off) * VMRegImpl::stack_slot_size)); // super klass

Label miss;
__ check_klass_subtype_slow_path(x14, x10, x12, x15, nullptr, &miss);
__ check_klass_subtype_slow_path(x14, /*sub_klass*/
x10, /*super_klass*/
x12, /*tmp1_reg*/
x15, /*tmp2_reg*/
nullptr, /*L_success*/
&miss /*L_failure*/);
// Need extras for table lookup: x7, x11, x13

// fallthrough on success:
__ mv(t0, 1);
Expand Down
4 changes: 2 additions & 2 deletions src/hotspot/cpu/riscv/gc/z/zAddress_riscv.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2017, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2023, Huawei Technologies Co., Ltd. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
Expand Down Expand Up @@ -84,7 +84,7 @@ static size_t probe_valid_max_address_bit() {
munmap(result_addr, page_size);
}
}
log_info_p(gc, init)("Probing address space for the highest valid bit: " SIZE_FORMAT, max_address_bit);
log_info_p(gc, init)("Probing address space for the highest valid bit: %zu", max_address_bit);
return MAX2(max_address_bit, MINIMUM_MAX_ADDRESS_BIT);
#else // LINUX
return DEFAULT_MAX_ADDRESS_BIT;
Expand Down
Loading

0 comments on commit cafa804

Please sign in to comment.