Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
77bd767
8372465: Bump update version for OpenJDK: jdk-17.0.19
GoeLin Dec 3, 2025
e853a44
8368882: NPE during text drawing on machine with JP locale
Dec 3, 2025
b123440
8303475: potential null pointer dereference in filemap.cpp
GoeLin Dec 6, 2025
e2c53d9
8301875: java.util.TimeZone.getSystemTimeZoneID uses C library defaul…
GoeLin Dec 6, 2025
084c4b5
6899304: java.awt.Toolkit.getScreenInsets(GraphicsConfiguration) retu…
GoeLin Dec 6, 2025
e904358
8282484: G1: Predicted old time in log always zero
Dec 7, 2025
b6eb8ce
8337681: PNGImageWriter uses much more memory than necessary
cost0much Dec 7, 2025
5014504
8283784: java_lang_String::as_platform_dependent_str stores to oop in…
jyma22 Dec 7, 2025
58dab5e
8361117: SIGSEGV in LShiftLNode::Ideal due to unexpected dead node
TheRealMDoerr Dec 9, 2025
7b541a2
8341779: [REDO BACKPORT] type annotations are not visible to javac pl…
cushon Dec 12, 2025
e12abc7
8357277: Update OpenSSL library for interop tests
GoeLin Dec 12, 2025
454e260
8336695: Update Commons BCEL to Version 6.10.0
GoeLin Dec 12, 2025
403ae7b
8372048: Performance improvement on Linux remote desktop
GoeLin Dec 12, 2025
fc816a5
Merge
GoeLin Dec 17, 2025
e0c50fd
8244400: MenuItem may cache the size and did not update it when the s…
GoeLin Dec 17, 2025
cc60106
8372756: Mouse additional buttons and horizontal scrolling are broken…
GoeLin Dec 17, 2025
5c9fbee
8288556: VM crashes if it gets sent SIGUSR2 from outside
GoeLin Dec 19, 2025
cb09e7b
8347475: GTK: javax/swing/JColorChooser/Test8152419.java there are no…
GoeLin Dec 19, 2025
c228e96
8331431: Update to use jtreg 7.4
GoeLin Dec 19, 2025
f9bb776
8333386: TestAbortOnVMOperationTimeout test fails for client VM
GoeLin Dec 19, 2025
f8c50b8
8349351: Combine Screen Inset Tests into a Single File
GoeLin Dec 19, 2025
708e1a2
8363950: Incorrect jtreg header in TestLayoutVsICU.java
GoeLin Dec 19, 2025
b3527e4
8372977: Unnecessary gthread-2.0 loading
GoeLin Dec 19, 2025
e4dc0cd
8370579: PPC: fix inswri immediate argument order
dbriemann Dec 19, 2025
a81daeb
8353755: Add a helper method to Util - findComponent()
GoeLin Dec 23, 2025
a0ebad3
8367904: Test java/net/InetAddress/ptr/Lookup.java should throw Skipp…
Dec 23, 2025
766ff45
Merge
GoeLin Dec 24, 2025
2088e2a
8030957: AIX: Implement OperatingSystemMXBean.getSystemCpuLoad() and …
Dec 30, 2025
580e494
8337795: Type annotation attached to incorrect type during class reading
cushon Dec 31, 2025
3f9c279
8271396: Spelling errors
Dec 31, 2025
69e83b1
8337102: JITTester: Fix breaks in static initialization blocks
kirill-shirokov Dec 31, 2025
827207b
8369563: Gtest dll_address_to_function_and_library_name has issues wi…
MBaesken Jan 5, 2026
f1b9421
8368960: Adjust java UL logging in the build
MBaesken Jan 9, 2026
4adae74
8368787: Error reporting: hs_err files should show instructions when …
TheRealMDoerr Jan 9, 2026
8ba7c16
8366694: Test JdbStopInNotificationThreadTest.java timed out after 60…
Jan 11, 2026
322760f
8374209: [17u,21u] Backout JDK-8361748 due to JDK-8373727
MBaesken Jan 14, 2026
24fe61e
8371978: tools/jar/ReproducibleJar.java fails on XFS
Jan 15, 2026
8976472
8372857: Improve debuggability of java/rmi/server/RemoteServer/AddrIn…
Jan 18, 2026
f02f962
8342175: MemoryEaterMT fails intermittently with ExceptionInInitializ…
shipilev Jan 19, 2026
d9c8bd2
8346962: Test CRLReadTimeout.java fails with -Xcomp on a fastdebug build
Jan 19, 2026
7d3eabd
8334670: SSLSocketOutputRecord buffer miscalculation
GoeLin Jan 20, 2026
4892ed4
8337998: CompletionFailure in getEnclosingType attaching type annotat…
cushon Jan 20, 2026
4217112
Merge
GoeLin Jan 21, 2026
dbeb994
8343622: AesDkCrypto.stringToKey should not return null
GoeLin Jan 22, 2026
381db13
8355632: WhiteBox.waitForReferenceProcessing() fails assert for retur…
GoeLin Jan 22, 2026
b0196fe
7036144: GZIPInputStream readTrailer uses faulty available() test for…
toddjonker Jan 22, 2026
041058f
8354893: [REDO BACKPORT] javac crashes while adding type annotations …
cushon Jan 22, 2026
80ef28b
8375530: PPC64: incorrect quick verify_method_data_pointer check caus…
dbriemann Jan 23, 2026
aafaadd
8360406: [21u] Disable logic for attaching type annotations to class …
cushon Jan 26, 2026
17151d9
8360539: DTLS handshakes fails due to improper cookie validation logic
GoeLin Jan 26, 2026
13ed988
8374642: EscapeHash macro fails with GNU make 4.3 and 4.4
GoeLin Jan 27, 2026
a6de0c1
8317633: Modernize text.testlib.HexDumpReader
GoeLin Jan 29, 2026
0082bc3
8351639: Improve debuggability of test/langtools/jdk/jshell/JdiHangin…
GoeLin Jan 29, 2026
6dc6add
8375063: Update Libpng to 1.6.54
mrserb Feb 2, 2026
2c8f01b
8366817: test/jdk/javax/net/ssl/TLSCommon/interop/JdkProcServer.java …
Feb 2, 2026
fb8229e
8376270: [21u, 17u] Redo JDK-8361748: Enforce limits on the size of a…
GoeLin Feb 2, 2026
aa29cc6
8373727: New XBM images parser regression: only the first line of the…
GoeLin Feb 2, 2026
2132ad1
8355278: Improve debuggability of com/sun/jndi/ldap/LdapPoolTimeoutTe…
GoeLin Feb 3, 2026
0d49e54
8345578: New test in JDK-8343622 fails with a promoted build
GoeLin Feb 3, 2026
6d95e17
8354219: Automate javax/swing/JComboBox/ComboPopupBug.java
GoeLin Feb 3, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .jcheck/conf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[general]
project=jdk-updates
jbs=JDK
version=17.0.18
version=17.0.19

[checks]
error=author,committer,reviewers,merge,issues,executable,symlink,message,hg-tag,whitespace,problemlists
Expand Down
3 changes: 3 additions & 0 deletions make/autoconf/boot-jdk.m4
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,9 @@ AC_DEFUN_ONCE([BOOTJDK_SETUP_BOOT_JDK_ARGUMENTS],
# Force en-US environment
UTIL_ADD_JVM_ARG_IF_OK([-Duser.language=en -Duser.country=US],boot_jdk_jvmargs,[$JAVA])

UTIL_ADD_JVM_ARG_IF_OK([-Xlog:all=off:stdout],boot_jdk_jvmargs,[$JAVA])
UTIL_ADD_JVM_ARG_IF_OK([-Xlog:all=warning:stderr],boot_jdk_jvmargs,[$JAVA])

if test "x$BOOTJDK_USE_LOCAL_CDS" = xtrue; then
# Use our own CDS archive
UTIL_ADD_JVM_ARG_IF_OK([$boot_jdk_cds_args -Xshare:auto],boot_jdk_jvmargs,[$JAVA])
Expand Down
4 changes: 2 additions & 2 deletions make/autoconf/lib-tests.m4
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 @@ -28,7 +28,7 @@
################################################################################

# Minimum supported versions
JTREG_MINIMUM_VERSION=7.3.1
JTREG_MINIMUM_VERSION=7.4
GTEST_MINIMUM_VERSION=1.13.0

###############################################################################
Expand Down
2 changes: 1 addition & 1 deletion make/common/Utils.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ EscapeDollar = $(subst $$,\$$,$(subst \$$,$$,$(strip $1)))

################################################################################
# This macro works just like EscapeDollar above, but for #.
EscapeHash = $(subst \#,\\\#,$(subst \\\#,\#,$(strip $1)))
EscapeHash = $(subst $(HASH),\$(HASH),$(subst \$(HASH),$(HASH),$(strip $1)))

################################################################################
# This macro translates $ into $$ to protect the string from make itself.
Expand Down
2 changes: 1 addition & 1 deletion make/conf/github-actions.conf
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
# Versions and download locations for dependencies used by GitHub Actions (GHA)

GTEST_VERSION=1.13.0
JTREG_VERSION=7.3.1+1
JTREG_VERSION=7.4+1

LINUX_X64_BOOT_JDK_EXT=tar.gz
LINUX_X64_BOOT_JDK_URL=https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.14%2B7/OpenJDK17U-jdk_x64_linux_hotspot_17.0.14_7.tar.gz
Expand Down
4 changes: 2 additions & 2 deletions make/conf/jib-profiles.js
Original file line number Diff line number Diff line change
Expand Up @@ -1153,9 +1153,9 @@ var getJibProfilesDependencies = function (input, common) {
jtreg: {
server: "jpg",
product: "jtreg",
version: "7.3.1",
version: "7.4",
build_number: "1",
file: "bundles/jtreg-7.3.1+1.zip",
file: "bundles/jtreg-7.4+1.zip",
environment_name: "JT_HOME",
environment_path: input.get("jtreg", "home_path") + "/bin",
configure_args: "--with-jtreg=" + input.get("jtreg", "home_path"),
Expand Down
6 changes: 3 additions & 3 deletions make/conf/version-numbers.conf
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@

DEFAULT_VERSION_FEATURE=17
DEFAULT_VERSION_INTERIM=0
DEFAULT_VERSION_UPDATE=18
DEFAULT_VERSION_UPDATE=19
DEFAULT_VERSION_PATCH=0
DEFAULT_VERSION_EXTRA1=0
DEFAULT_VERSION_EXTRA2=0
DEFAULT_VERSION_EXTRA3=0
DEFAULT_VERSION_DATE=2026-01-20
DEFAULT_VERSION_DATE=2026-04-21
DEFAULT_VERSION_CLASSFILE_MAJOR=61 # "`$EXPR $DEFAULT_VERSION_FEATURE + 44`"
DEFAULT_VERSION_CLASSFILE_MINOR=0
DEFAULT_VERSION_DOCS_API_SINCE=11
DEFAULT_ACCEPTABLE_BOOT_VERSIONS="16 17"
DEFAULT_JDK_SOURCE_TARGET_VERSION=17
DEFAULT_PROMOTED_VERSION_PRE=
DEFAULT_PROMOTED_VERSION_PRE=ea
4 changes: 2 additions & 2 deletions src/hotspot/cpu/ppc/interp_masm_ppc_64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1224,11 +1224,11 @@ void InterpreterMacroAssembler::verify_method_data_pointer() {
lhz(R11_scratch1, in_bytes(DataLayout::bci_offset()), R28_mdx);
ld(R12_scratch2, in_bytes(Method::const_offset()), R19_method);
addi(R11_scratch1, R11_scratch1, in_bytes(ConstMethod::codes_offset()));
add(R11_scratch1, R12_scratch2, R12_scratch2);
add(R11_scratch1, R11_scratch1, R12_scratch2);
cmpd(CCR0, R11_scratch1, R14_bcp);
beq(CCR0, verify_continue);

call_VM_leaf(CAST_FROM_FN_PTR(address, InterpreterRuntime::verify_mdp ), R19_method, R14_bcp, R28_mdx);
call_VM_leaf(CAST_FROM_FN_PTR(address, InterpreterRuntime::verify_mdp), R19_method, R14_bcp, R28_mdx);

bind(verify_continue);
#endif
Expand Down
26 changes: 13 additions & 13 deletions src/hotspot/cpu/ppc/ppc.ad
Original file line number Diff line number Diff line change
Expand Up @@ -13042,27 +13042,27 @@ instruct countTrailingZerosL_cnttzd(iRegIdst dst, iRegLsrc src) %{
%}

// Expand nodes for byte_reverse_int.
instruct insrwi_a(iRegIdst dst, iRegIsrc src, immI16 pos, immI16 shift) %{
effect(DEF dst, USE src, USE pos, USE shift);
instruct insrwi_a(iRegIdst dst, iRegIsrc src, immI16 n, immI16 b) %{
effect(DEF dst, USE src, USE n, USE b);
predicate(false);

format %{ "INSRWI $dst, $src, $pos, $shift" %}
format %{ "INSRWI $dst, $src, $n, $b" %}
size(4);
ins_encode %{
__ insrwi($dst$$Register, $src$$Register, $shift$$constant, $pos$$constant);
__ insrwi($dst$$Register, $src$$Register, $n$$constant, $b$$constant);
%}
ins_pipe(pipe_class_default);
%}

// As insrwi_a, but with USE_DEF.
instruct insrwi(iRegIdst dst, iRegIsrc src, immI16 pos, immI16 shift) %{
effect(USE_DEF dst, USE src, USE pos, USE shift);
instruct insrwi(iRegIdst dst, iRegIsrc src, immI16 n, immI16 b) %{
effect(USE_DEF dst, USE src, USE n, USE b);
predicate(false);

format %{ "INSRWI $dst, $src, $pos, $shift" %}
format %{ "INSRWI $dst, $src, $n, $b" %}
size(4);
ins_encode %{
__ insrwi($dst$$Register, $src$$Register, $shift$$constant, $pos$$constant);
__ insrwi($dst$$Register, $src$$Register, $n$$constant, $b$$constant);
%}
ins_pipe(pipe_class_default);
%}
Expand All @@ -13084,12 +13084,12 @@ instruct bytes_reverse_int_Ex(iRegIdst dst, iRegIsrc src) %{
iRegLdst tmpI3;

urShiftI_reg_imm(tmpI1, src, imm24);
insrwi_a(dst, tmpI1, imm24, imm8);
insrwi_a(dst, tmpI1, imm8, imm24);
urShiftI_reg_imm(tmpI2, src, imm16);
insrwi(dst, tmpI2, imm8, imm16);
insrwi(dst, tmpI2, imm16, imm8);
urShiftI_reg_imm(tmpI3, src, imm8);
insrwi(dst, tmpI3, imm8, imm8);
insrwi(dst, src, imm0, imm8);
insrwi(dst, src, imm8, imm0);
%}
%}

Expand Down Expand Up @@ -13207,7 +13207,7 @@ instruct bytes_reverse_ushort_Ex(iRegIdst dst, iRegIsrc src) %{
immI16 imm8 %{ (int) 8 %}

urShiftI_reg_imm(dst, src, imm8);
insrwi(dst, src, imm16, imm8);
insrwi(dst, src, imm8, imm16);
%}
%}

Expand Down Expand Up @@ -13236,7 +13236,7 @@ instruct bytes_reverse_short_Ex(iRegIdst dst, iRegIsrc src) %{
iRegLdst tmpI1;

urShiftI_reg_imm(tmpI1, src, imm8);
insrwi(tmpI1, src, imm16, imm8);
insrwi(tmpI1, src, imm8, imm16);
extsh(dst, tmpI1);
%}
%}
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/cpu/x86/vm_version_ext_x86.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -948,7 +948,7 @@ const char* const VM_Version_Ext::_feature_ecx_id[] = {

const char* const VM_Version_Ext::_feature_extended_ecx_id[] = {
"LAHF/SAHF instruction support",
"Core multi-processor leagacy mode",
"Core multi-processor legacy mode",
"",
"",
"",
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/os/aix/os_aix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -789,7 +789,7 @@ bool os::create_thread(Thread* thread, ThreadType thr_type,
// JDK-8187028: It was observed that on some configurations (4K backed thread stacks)
// the real thread stack size may be smaller than the requested stack size, by as much as 64K.
// This very much looks like a pthread lib error. As a workaround, increase the stack size
// by 64K for small thread stacks (arbitrarily choosen to be < 4MB)
// by 64K for small thread stacks (arbitrarily chosen to be < 4MB)
if (stack_size < 4096 * K) {
stack_size += 64 * K;
}
Expand Down
4 changes: 2 additions & 2 deletions src/hotspot/os/bsd/semaphore_bsd.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2018, 2021, 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,7 +30,7 @@
#include <semaphore.h>

#ifdef __APPLE__
// OS X doesn't support unamed POSIX semaphores, so the implementation in os_posix.cpp can't be used.
// OS X doesn't support unnamed POSIX semaphores, so the implementation in os_posix.cpp can't be used.

static const char* sem_init_strerror(kern_return_t value) {
switch (value) {
Expand Down
4 changes: 2 additions & 2 deletions src/hotspot/os/bsd/semaphore_bsd.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2021, 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 @@ -32,7 +32,7 @@
# include "semaphore_posix.hpp"

#else
// OS X doesn't support unamed POSIX semaphores, so the implementation in os_posix.cpp can't be used.
// OS X doesn't support unnamed POSIX semaphores, so the implementation in os_posix.cpp can't be used.
# include "memory/allocation.hpp"
# include <mach/semaphore.h>

Expand Down
4 changes: 2 additions & 2 deletions src/hotspot/os/posix/semaphore_posix.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2018, 2021, 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 @@ -25,7 +25,7 @@
#include "precompiled.hpp"
#ifndef __APPLE__
#include "runtime/os.hpp"
// POSIX unamed semaphores are not supported on OS X.
// POSIX unnamed semaphores are not supported on OS X.
#include "semaphore_posix.hpp"
#include <semaphore.h>

Expand Down
17 changes: 16 additions & 1 deletion src/hotspot/os/posix/signals_posix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1592,7 +1592,22 @@ static void SR_handler(int sig, siginfo_t* siginfo, void* ucVoid) {
PosixSignals::unblock_error_signals();

Thread* thread = Thread::current_or_null_safe();
assert(thread != NULL, "Missing current thread in SR_handler");

// The suspend/resume signal may have been sent from outside the process, deliberately or
// accidentally. In that case the receiving thread may not be attached to the VM. We handle
// that case by asserting (debug VM) resp. writing a diagnostic message to tty and
// otherwise ignoring the stray signal (release VMs).
// We print the siginfo as part of the diagnostics, which also contains the sender pid of
// the stray signal.
if (thread == nullptr) {
stringStream ss;
ss.print_raw("Non-attached thread received stray SR signal (");
os::print_siginfo(&ss, siginfo);
ss.print_raw(").");
assert(thread != NULL, "%s.", ss.base());
log_warning(os)("%s", ss.base());
return;
}

// On some systems we have seen signal delivery get "stuck" until the signal
// mask is changed as part of thread termination. Check that the current thread
Expand Down
1 change: 1 addition & 0 deletions src/hotspot/share/cds/filemap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,7 @@ void SharedClassPathEntry::set_name(const char* name, TRAPS) {
}

void SharedClassPathEntry::copy_from(SharedClassPathEntry* ent, ClassLoaderData* loader_data, TRAPS) {
assert(ent != NULL, "sanity");
_type = ent->_type;
_is_module_path = ent->_is_module_path;
_timestamp = ent->_timestamp;
Expand Down
10 changes: 6 additions & 4 deletions src/hotspot/share/classfile/javaClasses.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -456,16 +456,18 @@ char* java_lang_String::as_platform_dependent_str(Handle java_string, TRAPS) {
}

char *native_platform_string;
{ JavaThread* thread = THREAD;
jstring js = (jstring) JNIHandles::make_local(thread, java_string());
bool is_copy;
JavaThread* thread = THREAD;
jstring js = (jstring) JNIHandles::make_local(thread, java_string());
{
HandleMark hm(thread);
ThreadToNativeFromVM ttn(thread);
JNIEnv *env = thread->jni_environment();
bool is_copy;
native_platform_string = (_to_platform_string_fn)(env, js, &is_copy);
assert(is_copy == JNI_TRUE, "is_copy value changed");
JNIHandles::destroy_local(js);
}
JNIHandles::destroy_local(js);

return native_platform_string;
}

Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/share/classfile/modules.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -698,7 +698,7 @@ jobject Modules::get_module(jclass clazz, TRAPS) {
ls.print("get_module(): module ");
java_lang_String::print(module_name, tty);
} else {
ls.print("get_module(): Unamed Module");
ls.print("get_module(): Unnamed Module");
}
if (klass != NULL) {
ls.print_cr(" for class %s", klass->external_name());
Expand Down
1 change: 1 addition & 0 deletions src/hotspot/share/code/codeBlob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -659,6 +659,7 @@ void CodeBlob::dump_for_addr(address addr, outputStream* st, bool verbose) const
nm->print_nmethod(true);
} else {
nm->print(st);
nm->print_code_snippet(st, addr);
}
return;
}
Expand Down
36 changes: 36 additions & 0 deletions src/hotspot/share/code/nmethod.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3556,6 +3556,42 @@ void nmethod::print_value_on(outputStream* st) const {
}
#endif

void nmethod::print_code_snippet(outputStream* st, address addr) const {
if (entry_point() <= addr && addr < code_end()) {
// Pointing into the nmethod's code. Try to disassemble some instructions around addr.
// Determine conservative start and end points.
address start;
if (frame_complete_offset() != CodeOffsets::frame_never_safe &&
addr >= code_begin() + frame_complete_offset()) {
start = code_begin() + frame_complete_offset();
} else {
start = (addr < verified_entry_point()) ? entry_point() : verified_entry_point();
}
address start_for_hex_dump = start; // We can choose a different starting point for hex dump, below.
address end = code_end();

// Try using relocations to find closer instruction start and end points.
// (Some platforms have variable length instructions and can only
// disassemble correctly at instruction start addresses.)
RelocIterator iter((nmethod*)this, start);
while (iter.next() && iter.addr() < addr) { // find relocation before addr
start = iter.addr();
// We want at least 64 Bytes ahead in hex dump.
if (iter.addr() <= (addr - 64)) start_for_hex_dump = iter.addr();
}
if (iter.has_current()) {
if (iter.addr() == addr) iter.next(); // find relocation after addr
if (iter.has_current()) end = iter.addr();
}

// Always print hex. Disassembler may still have problems when hitting an incorrect instruction start.
os::print_hex_dump(st, start_for_hex_dump, end, 1);
if (!Disassembler::is_abstract()) {
Disassembler::decode(start, end, st);
}
}
}

#ifndef PRODUCT

void nmethod::print_calls(outputStream* st) {
Expand Down
1 change: 1 addition & 0 deletions src/hotspot/share/code/nmethod.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -663,6 +663,7 @@ class nmethod : public CompiledMethod {
void print() const;
void print(outputStream* st) const;
void print_code();
void print_code_snippet(outputStream* st, address addr) const;

#if defined(SUPPORT_DATA_STRUCTS)
// print output in opt build for disassembler library
Expand Down
7 changes: 3 additions & 4 deletions src/hotspot/share/gc/g1/g1Policy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1299,7 +1299,6 @@ void G1Policy::calculate_old_collection_set_regions(G1CollectionSetCandidates* c
num_optional_regions = 0;
uint num_expensive_regions = 0;

double predicted_old_time_ms = 0.0;
double predicted_initial_time_ms = 0.0;
double predicted_optional_time_ms = 0.0;

Expand Down Expand Up @@ -1330,7 +1329,7 @@ void G1Policy::calculate_old_collection_set_regions(G1CollectionSetCandidates* c
time_remaining_ms = MAX2(time_remaining_ms - predicted_time_ms, 0.0);
// Add regions to old set until we reach the minimum amount
if (num_initial_regions < min_old_cset_length) {
predicted_old_time_ms += predicted_time_ms;
predicted_initial_time_ms += predicted_time_ms;
num_initial_regions++;
// Record the number of regions added with no time remaining
if (time_remaining_ms == 0.0) {
Expand All @@ -1344,7 +1343,7 @@ void G1Policy::calculate_old_collection_set_regions(G1CollectionSetCandidates* c
} else {
// Keep adding regions to old set until we reach the optional threshold
if (time_remaining_ms > optional_threshold_ms) {
predicted_old_time_ms += predicted_time_ms;
predicted_initial_time_ms += predicted_time_ms;
num_initial_regions++;
} else if (time_remaining_ms > 0) {
// Keep adding optional regions until time is up.
Expand All @@ -1368,7 +1367,7 @@ void G1Policy::calculate_old_collection_set_regions(G1CollectionSetCandidates* c
}

log_debug(gc, ergo, cset)("Finish choosing collection set old regions. Initial: %u, optional: %u, "
"predicted old time: %1.2fms, predicted optional time: %1.2fms, time remaining: %1.2f",
"predicted initial time: %1.2fms, predicted optional time: %1.2fms, time remaining: %1.2f",
num_initial_regions, num_optional_regions,
predicted_initial_time_ms, predicted_optional_time_ms, time_remaining_ms);
}
Expand Down
Loading
Loading