Skip to content

Commit

Permalink
Merge branch 'upstream-master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Datadog Syncup Service committed Dec 2, 2024
2 parents 7a3d464 + d589baf commit 77da446
Show file tree
Hide file tree
Showing 24 changed files with 750 additions and 198 deletions.
6 changes: 2 additions & 4 deletions make/Docs.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -107,15 +107,13 @@ JAVA_WARNINGS_ARE_ERRORS ?= -Werror
JAVADOC_OPTIONS := -use -keywords -notimestamp \
-encoding ISO-8859-1 -docencoding UTF-8 -breakiterator \
-splitIndex --system none -javafx --expand-requires transitive \
--override-methods=summary \
--no-external-specs-page
--override-methods=summary

# The reference options must stay stable to allow for comparisons across the
# development cycle.
REFERENCE_OPTIONS := -XDignore.symbol.file=true -use -keywords -notimestamp \
-encoding ISO-8859-1 -breakiterator -splitIndex --system none \
-html5 -javafx --expand-requires transitive \
--no-external-specs-page
-html5 -javafx --expand-requires transitive

# Should we add DRAFT stamps to the generated javadoc?
ifeq ($(VERSION_IS_GA), true)
Expand Down
15 changes: 1 addition & 14 deletions make/conf/jib-profiles.js
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ var getJibProfilesCommon = function (input, data) {
// List of the main profile names used for iteration
common.main_profile_names = [
"linux-x64", "linux-x86", "macosx-x64", "macosx-aarch64",
"windows-x64", "windows-x86", "windows-aarch64",
"windows-x64", "windows-aarch64",
"linux-aarch64", "linux-arm32", "linux-ppc64le", "linux-s390x",
"linux-riscv64"
];
Expand Down Expand Up @@ -465,15 +465,6 @@ var getJibProfilesProfiles = function (input, common, data) {
configure_args: concat(common.configure_args_64bit),
},

"windows-x86": {
target_os: "windows",
target_cpu: "x86",
build_cpu: "x64",
dependencies: ["devkit", "gtest"],
configure_args: concat(common.configure_args_32bit,
"--enable-deprecated-ports"),
},

"windows-aarch64": {
target_os: "windows",
target_cpu: "aarch64",
Expand Down Expand Up @@ -716,10 +707,6 @@ var getJibProfilesProfiles = function (input, common, data) {
platform: "windows-x64",
jdk_suffix: "zip",
},
"windows-x86": {
platform: "windows-x86",
jdk_suffix: "zip",
},
"windows-aarch64": {
platform: "windows-aarch64",
jdk_suffix: "zip",
Expand Down
38 changes: 1 addition & 37 deletions src/hotspot/cpu/riscv/macroAssembler_riscv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2461,45 +2461,9 @@ void MacroAssembler::load_long_misaligned(Register dst, Address src, Register tm
}
}

// reverse bytes in halfword in lower 16 bits and zero-extend
// Rd[15:0] = Rs[7:0] Rs[15:8] (zero-extend to 64 bits)
void MacroAssembler::revb_h_h_u(Register Rd, Register Rs, Register tmp) {
if (UseZbb) {
rev8(Rd, Rs);
srli(Rd, Rd, 48);
return;
}
assert_different_registers(Rs, tmp);
assert_different_registers(Rd, tmp);
srli(tmp, Rs, 8);
andi(tmp, tmp, 0xFF);
andi(Rd, Rs, 0xFF);
slli(Rd, Rd, 8);
orr(Rd, Rd, tmp);
}

// reverse bytes in halfwords in lower 32 bits and zero-extend
// Rd[31:0] = Rs[23:16] Rs[31:24] Rs[7:0] Rs[15:8] (zero-extend to 64 bits)
void MacroAssembler::revb_h_w_u(Register Rd, Register Rs, Register tmp1, Register tmp2) {
if (UseZbb) {
rev8(Rd, Rs);
rori(Rd, Rd, 32);
roriw(Rd, Rd, 16);
zero_extend(Rd, Rd, 32);
return;
}
assert_different_registers(Rs, tmp1, tmp2);
assert_different_registers(Rd, tmp1, tmp2);
srli(tmp2, Rs, 16);
revb_h_h_u(tmp2, tmp2, tmp1);
revb_h_h_u(Rd, Rs, tmp1);
slli(tmp2, tmp2, 16);
orr(Rd, Rd, tmp2);
}

// reverse bytes in lower word, sign-extend
// Rd[32:0] = Rs[7:0] Rs[15:8] Rs[23:16] Rs[31:24]
void MacroAssembler::revb_w(Register Rd, Register Rs, Register tmp1, Register tmp2) {
void MacroAssembler::revbw(Register Rd, Register Rs, Register tmp1, Register tmp2) {
if (UseZbb) {
rev8(Rd, Rs);
srai(Rd, Rd, 32);
Expand Down
8 changes: 3 additions & 5 deletions src/hotspot/cpu/riscv/macroAssembler_riscv.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -912,11 +912,9 @@ class MacroAssembler: public Assembler {
void andn(Register Rd, Register Rs1, Register Rs2);
void orn(Register Rd, Register Rs1, Register Rs2);

// revb
void revb_h_h_u(Register Rd, Register Rs, Register tmp = t0); // reverse bytes in halfword in lower 16 bits, zero-extend
void revb_h_w_u(Register Rd, Register Rs, Register tmp1 = t0, Register tmp2 = t1); // reverse bytes in halfwords in lower 32 bits, zero-extend
void revb_w(Register Rd, Register Rs, Register tmp1 = t0, Register tmp2= t1); // reverse bytes in lower word, sign-extend
void revb(Register Rd, Register Rs, Register tmp1 = t0, Register tmp2 = t1); // reverse bytes in doubleword
// reverse bytes
void revbw(Register Rd, Register Rs, Register tmp1 = t0, Register tmp2= t1); // reverse bytes in lower word, sign-extend
void revb(Register Rd, Register Rs, Register tmp1 = t0, Register tmp2 = t1); // reverse bytes in doubleword

void ror_imm(Register dst, Register src, uint32_t shift, Register tmp = t0);
void rolw_imm(Register dst, Register src, uint32_t, Register tmp = t0);
Expand Down
64 changes: 39 additions & 25 deletions src/hotspot/cpu/riscv/templateTable_riscv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -658,8 +658,12 @@ void TemplateTable::aload() {
}

void TemplateTable::locals_index_wide(Register reg) {
__ lhu(reg, at_bcp(2));
__ revb_h_h_u(reg, reg); // reverse bytes in half-word and zero-extend
assert_different_registers(reg, t1);
// Convert the 16-bit value into native byte-ordering and zero-extend
__ lbu(reg, at_bcp(2));
__ lbu(t1, at_bcp(3));
__ slli(reg, reg, 8);
__ orr(reg, reg, t1);
__ neg(reg, reg);
}

Expand All @@ -671,8 +675,12 @@ void TemplateTable::wide_iload() {

void TemplateTable::wide_lload() {
transition(vtos, ltos);
__ lhu(x11, at_bcp(2));
__ revb_h_h_u(x11, x11); // reverse bytes in half-word and zero-extend
// Convert the 16-bit value into native byte-ordering and zero-extend
__ lbu(x11, at_bcp(2));
__ lbu(t1, at_bcp(3));
__ slli(x11, x11, 8);
__ orr(x11, x11, t1);

__ slli(x11, x11, LogBytesPerWord);
__ sub(x11, xlocals, x11);
__ ld(x10, Address(x11, Interpreter::local_offset_in_bytes(1)));
Expand All @@ -686,8 +694,12 @@ void TemplateTable::wide_fload() {

void TemplateTable::wide_dload() {
transition(vtos, dtos);
__ lhu(x11, at_bcp(2));
__ revb_h_h_u(x11, x11); // reverse bytes in half-word and zero-extend
// Convert the 16-bit value into native byte-ordering and zero-extend
__ lbu(x11, at_bcp(2));
__ lbu(t1, at_bcp(3));
__ slli(x11, x11, 8);
__ orr(x11, x11, t1);

__ slli(x11, x11, LogBytesPerWord);
__ sub(x11, xlocals, x11);
__ fld(f10, Address(x11, Interpreter::local_offset_in_bytes(1)));
Expand Down Expand Up @@ -1471,12 +1483,14 @@ void TemplateTable::iinc() {

void TemplateTable::wide_iinc() {
transition(vtos, vtos);
__ lwu(x11, at_bcp(2)); // get constant and index
__ revb_h_w_u(x11, x11); // reverse bytes in half-word (32bit) and zero-extend
__ zero_extend(x12, x11, 16);
__ neg(x12, x12);
__ slli(x11, x11, 32);
__ srai(x11, x11, 48);
// get constant
// Convert the 16-bit value into native byte-ordering and sign-extend
__ lb(x11, at_bcp(4));
__ lbu(t1, at_bcp(5));
__ slli(x11, x11, 8);
__ orr(x11, x11, t1);

locals_index_wide(x12);
__ ld(x10, iaddress(x12, t0, _masm));
__ addw(x10, x10, x11);
__ sd(x10, iaddress(x12, t0, _masm));
Expand Down Expand Up @@ -1625,10 +1639,10 @@ void TemplateTable::branch(bool is_jsr, bool is_wide) {
__ lb(x12, at_bcp(1));
__ lbu(t1, at_bcp(2));
__ slli(x12, x12, 8);
__ add(x12, x12, t1);
__ orr(x12, x12, t1);
} else {
__ lwu(x12, at_bcp(1));
__ revb_w(x12, x12);
__ revbw(x12, x12);
}

// Handle all the JSR stuff here, then exit.
Expand Down Expand Up @@ -1893,8 +1907,8 @@ void TemplateTable::tableswitch() {
// load lo & hi
__ lwu(x12, Address(x11, BytesPerInt));
__ lwu(x13, Address(x11, 2 * BytesPerInt));
__ revb_w(x12, x12);
__ revb_w(x13, x13);
__ revbw(x12, x12);
__ revbw(x13, x13);
// check against lo & hi
__ blt(x10, x12, default_case);
__ bgt(x10, x13, default_case);
Expand All @@ -1905,7 +1919,7 @@ void TemplateTable::tableswitch() {
__ profile_switch_case(x10, x11, x12);
// continue execution
__ bind(continue_execution);
__ revb_w(x13, x13);
__ revbw(x13, x13);
__ add(xbcp, xbcp, x13);
__ load_unsigned_byte(t0, Address(xbcp));
__ dispatch_only(vtos, /*generate_poll*/true);
Expand All @@ -1925,7 +1939,7 @@ void TemplateTable::fast_linearswitch() {
transition(itos, vtos);
Label loop_entry, loop, found, continue_execution;
// bswap x10 so we can avoid bswapping the table entries
__ revb_w(x10, x10);
__ revbw(x10, x10);
// align xbcp
__ la(x9, at_bcp(BytesPerInt)); // btw: should be able to get rid of
// this instruction (change offsets
Expand All @@ -1936,7 +1950,7 @@ void TemplateTable::fast_linearswitch() {
// Convert the 32-bit npairs (number of pairs) into native byte-ordering
// We can use sign-extension here because npairs must be greater than or
// equal to 0 per JVM spec on 'lookupswitch' bytecode.
__ revb_w(x11, x11);
__ revbw(x11, x11);
__ j(loop_entry);
// table search
__ bind(loop);
Expand All @@ -1957,7 +1971,7 @@ void TemplateTable::fast_linearswitch() {
__ profile_switch_case(x11, x10, x9);
// continue execution
__ bind(continue_execution);
__ revb_w(x13, x13);
__ revbw(x13, x13);
__ add(xbcp, xbcp, x13);
__ lbu(t0, Address(xbcp, 0));
__ dispatch_only(vtos, /*generate_poll*/true);
Expand Down Expand Up @@ -2012,7 +2026,7 @@ void TemplateTable::fast_binaryswitch() {
// Convert the 32-bit npairs (number of pairs) into native byte-ordering
// We can use sign-extension here because npairs must be greater than or
// equal to 0 per JVM spec on 'lookupswitch' bytecode.
__ revb_w(j, j);
__ revbw(j, j);

// And start
Label entry;
Expand All @@ -2030,7 +2044,7 @@ void TemplateTable::fast_binaryswitch() {
// Convert array[h].match to native byte-ordering before compare
__ shadd(temp, h, array, temp, 3);
__ lwu(temp, Address(temp, 0));
__ revb_w(temp, temp);
__ revbw(temp, temp);

Label L_done, L_greater;
__ bge(key, temp, L_greater);
Expand All @@ -2053,14 +2067,14 @@ void TemplateTable::fast_binaryswitch() {
// Convert array[i].match to native byte-ordering before compare
__ shadd(temp, i, array, temp, 3);
__ lwu(temp, Address(temp, 0));
__ revb_w(temp, temp);
__ revbw(temp, temp);
__ bne(key, temp, default_case);

// entry found -> j = offset
__ shadd(temp, i, array, temp, 3);
__ lwu(j, Address(temp, BytesPerInt));
__ profile_switch_case(i, key, array);
__ revb_w(j, j);
__ revbw(j, j);

__ add(temp, xbcp, j);
__ load_unsigned_byte(t0, Address(temp, 0));
Expand All @@ -2073,7 +2087,7 @@ void TemplateTable::fast_binaryswitch() {
__ bind(default_case);
__ profile_switch_default(i);
__ lwu(j, Address(array, -2 * BytesPerInt));
__ revb_w(j, j);
__ revbw(j, j);

__ add(temp, xbcp, j);
__ load_unsigned_byte(t0, Address(temp, 0));
Expand Down
9 changes: 6 additions & 3 deletions src/hotspot/share/gc/serial/tenuredGeneration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -378,11 +378,14 @@ void TenuredGeneration::update_counters() {

bool TenuredGeneration::promotion_attempt_is_safe(size_t max_promotion_in_bytes) const {
size_t available = _the_space->free() + _virtual_space.uncommitted_size();
size_t av_promo = (size_t)_avg_promoted->padded_average();
bool res = (available >= av_promo) || (available >= max_promotion_in_bytes);

size_t avg_promoted = (size_t)_avg_promoted->padded_average();
size_t promotion_estimate = MIN2(avg_promoted, max_promotion_in_bytes);

bool res = (promotion_estimate <= available);

log_trace(gc)("Tenured: promo attempt is%s safe: available(" SIZE_FORMAT ") %s av_promo(" SIZE_FORMAT "), max_promo(" SIZE_FORMAT ")",
res? "":" not", available, res? ">=":"<", av_promo, max_promotion_in_bytes);
res? "":" not", available, res? ">=":"<", avg_promoted, max_promotion_in_bytes);

return res;
}
Expand Down
2 changes: 2 additions & 0 deletions src/hotspot/share/gc/shared/locationPrinter.inline.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@

#include "gc/shared/locationPrinter.hpp"

#include "memory/resourceArea.inline.hpp"
#include "oops/compressedOops.inline.hpp"
#include "oops/oopsHierarchy.hpp"

Expand All @@ -51,6 +52,7 @@ oop BlockLocationPrinter<CollectedHeapT>::base_oop_or_null(void* addr) {

template <typename CollectedHeapT>
bool BlockLocationPrinter<CollectedHeapT>::print_location(outputStream* st, void* addr) {
ResourceMark rm;
// Check if addr points into Java heap.
bool in_heap = CollectedHeapT::heap()->is_in(addr);
if (in_heap) {
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/share/jvmci/jvmciEnv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,7 @@ JVMCIEnv::~JVMCIEnv() {
if (_init_error_msg != nullptr) {
// The memory allocated in libjvmci was not allocated with os::malloc
// so must not be freed with os::free.
ALLOW_C_FUNCTION(::free((void*) _init_error_msg));
ALLOW_C_FUNCTION(::free, ::free((void*) _init_error_msg);)
}
if (_init_error != JNI_OK) {
return;
Expand Down
9 changes: 9 additions & 0 deletions src/java.base/share/classes/sun/launcher/LauncherHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -589,6 +589,15 @@ static void printXUsageMessage(boolean printToStderr) {
}
}

/**
* Prints the short usage text to the desired output stream.
*/
static void printConciseUsageMessage(boolean printToStderr) {
initOutput(printToStderr);
ostream.println(getLocalizedMessage("java.launcher.opt.concise.header",
File.pathSeparator));
}

static void initOutput(boolean printToStderr) {
ostream = (printToStderr) ? System.err : System.out;
}
Expand Down
Loading

0 comments on commit 77da446

Please sign in to comment.