Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
98 commits
Select commit Hold shift + click to select a range
4a08996
8378107: Data cache zeroing is used even when it is prohibited
Feb 26, 2026
00064ee
8378239: C2: Incorrect check in StoreNode::Identity
merykitty Feb 26, 2026
7065a24
8378240: C2: MemNode::can_see_stored_value assumes this can never be …
merykitty Feb 26, 2026
1674006
8378631: Update Zlib Data Compression Library to Version 1.3.2
jaikiran Feb 26, 2026
173153e
8376403: Avoid loading ArrayDeque in java.util.zip.ZipFile
Feb 26, 2026
b13a291
8378268: Thread.join can wait on Thread, allows joinNanos to be removed
Feb 26, 2026
82ff025
8374910: Use of containsTypeEquivalent in array type equality test se…
Feb 26, 2026
3b8abd4
8378398: Modernize test/jdk/java/net/URLClassLoader/HttpTest.java
Feb 26, 2026
4f83d21
8368864: Confusing error message (or wrong error) when record compone…
Feb 26, 2026
94de898
8372382: Invalid RuntimeVisibleTypeAnnotations for compact record con…
Feb 26, 2026
71a1af7
8378377: Remove use of AppContext from JEditorPane
prrace Feb 26, 2026
fcc2a29
8378297: Remove AppContext from several Swing component and related c…
prrace Feb 26, 2026
8b80563
8376477: Avoid loading empty Lock classes in Shutdown and ReferenceQueue
Feb 26, 2026
aa6c06e
8309748: Improve host selection in `External Specifications` page
hns Feb 26, 2026
5e85d99
8378715: Use early field initialization for java.lang.invoke generate…
liach Feb 26, 2026
cd462a8
8378385: Remove AppContext from AWT Windows implementation classes
prrace Feb 26, 2026
871730a
8377862: Jtreg is unable to detect SkippedException because it is wra…
Feb 26, 2026
526228c
8377142: Jtreg test gc/shenandoah/oom/TestThreadFailure.java triggers…
kdnilsen Feb 26, 2026
4a6de12
8371438: jpackage should handle the case when "--mac-sign" is specifi…
Feb 26, 2026
d887e2e
8377713: Shenandoah: Convert ShenandoahReferenceProcessor to use Atom…
Feb 27, 2026
538bebf
8376253: [macOS] FileSystemView may not report system icons when -Xch…
mrserb Feb 27, 2026
1c6e7ff
8377845: Restore regtest for JDK-8324881 with DiagnoseSyncOnValueBase…
Feb 27, 2026
d7f4365
8378561: Mark gc/shenandoah/compiler/TestLinkToNativeRBP.java as /native
Feb 27, 2026
6daca7e
8268675: RTE from "Printable.print" propagates through "PrinterJob.pr…
Renjithkannath Feb 27, 2026
dc06fed
8373367: interp-only mechanism fails to work for carrier threads in a…
Feb 27, 2026
463b9e0
8078744: Right half of system menu icon on title bar does not activat…
prsadhuk Feb 27, 2026
f6c69ca
8378379: Remove reference to obsolete jdk.net.usePlainSocketImpl prop…
jaikiran Feb 27, 2026
94a34a3
8377895: Create sizeof_auto to reduce narrowing conversions
lkorinth Feb 27, 2026
4e15a4a
8378823: AIX build fails after zlib updated by JDK-8378631
MBaesken Feb 27, 2026
5606036
8378563: ConnectionRefusedMessage::testFinishConnect fails when jdk.i…
RealCLanger Feb 27, 2026
1fb608e
8378792: ObjectMethods.bootstrap missing getter validation
liach Feb 27, 2026
a436287
8377048: Shenandoah: shenandoahLock related improvments
Feb 27, 2026
3144b57
8378388: Add missing @Override annotations in "javax.print.attribute.…
mrserb Feb 27, 2026
e0b040a
8331994: Adapt MAKEFLAGS check for GNU Make 4.4.1
erikj79 Feb 27, 2026
4bee207
8377554: Load card table base and other values via AOTRuntimeConstant…
adinn Feb 27, 2026
b0318fe
8378865: After fix for JDK-8378385 two tests are failing on windows
prrace Feb 27, 2026
58a7ccf
8378798: Test tools/jpackage/junit/share/jdk.jpackage/jdk/jpackage/in…
Feb 27, 2026
e5aac09
8378752: Enable some subword vector casts IR matching tests for RISC-V
DingliZhang Feb 28, 2026
357f29d
8378312: [VectorAPI] libraryUnaryOp/libraryBinaryOp failed to intrinsify
YaSuenag Feb 28, 2026
20ac1b1
8378871: CPU feature flags are not properly set in vm_version_windows…
Feb 28, 2026
d62b9f7
8377992: (zipfs) Align ZipFileSystem END header validation with the Z…
Feb 28, 2026
f3d7ca3
8378607: GlyphLayout cache can prevent Fonts from being GC'd
prrace Feb 28, 2026
dbbb3b1
8378833: Improve offset arithmetic in ArraysSupport::mismatch
rgiulietti Mar 1, 2026
0540e98
8378642: Add src/utils/LogCompilation/logc.jar to .gitignore
Mar 1, 2026
9cf9fbe
8378389: Remove AppContext from the Swing RepaintManager
prrace Mar 1, 2026
d6246b3
8378386: Remove AppContext from AWT ModalEventFilter.java
prrace Mar 1, 2026
2069edc
8377454: TestZGCWithCDS.java should also test different combos of Use…
Arraying Mar 2, 2026
ae4df28
8378677: Inline clear into ContiguousSpace::initialize
albertnetymk Mar 2, 2026
8d370ce
8377937: [macos] GlyphMetrics advance does not consider font rotation
Mar 2, 2026
b12daa4
8378110: Add -XX: prefix to settings-file flags in RuntimeMXBean.getI…
olivergillespie Mar 2, 2026
b7d0cb5
8378888: jdk/incubator/vector/Float16OperationsBenchmark.java uses wr…
RealFYang Mar 2, 2026
29a40c3
8378793: Add ResolvedFieldEntry is_valid assert
coleenp Mar 2, 2026
373ad02
8378786: PeerConnectionId::cloneBuffer should use absolute bulk get
dfuch Mar 2, 2026
2c3e4f0
8378595: Refactor miscellaneous tests under test/jdk/java/net/httpcli…
dfuch Mar 2, 2026
2678fe4
8378870: Remove sun.awt.AWTAccessor from imports in ImageIcon
aivanov-jdk Mar 2, 2026
2adffe0
8378872: Mark waitList in FetcherInfo final
aivanov-jdk Mar 2, 2026
cc4ca9f
8378128: Make PLABStats data members private
dev-jonghoonpark Mar 2, 2026
da99f1a
8378897: assertion failure due to missing depends_only_on_test_impl d…
Mar 2, 2026
7b5b70c
8378565: Refactor test/jdk/java/net/httpclient/http3/*.java TestNG te…
dfuch Mar 2, 2026
4fbc291
8377777: Improve logging when rejecting assets from the AOT archive
Delawen Mar 2, 2026
c4e39ce
8373635: C2: Wrong constant in GraphKit::basic_plus_adr()
raneashay Mar 2, 2026
f2a52b7
8378880: GenShen: Fix typo in recent conversion to atomic field
Mar 2, 2026
0baeccd
8378111: Migrate java/util/jar tests to JUnit
Mar 2, 2026
63c1cb3
8378702: jdk.test.lib.Platform.isMusl() may return false negative on …
fthevenet Mar 2, 2026
8009a71
8378810: Enable missing FFM test via jtreg requires for RISC-V
DingliZhang Mar 3, 2026
9e24055
8372246: LogOutputList gtests should not use LogConfiguration LogOutputs
xmas92 Mar 3, 2026
545cf60
8372242: Gtest LogTagSet.defaults should run in OTHER VM
xmas92 Mar 3, 2026
f4da2d5
8378684: Fix -Wdeprecated-declarations warnings from gtest by clang23
Mar 3, 2026
7e9e649
8378083: Mark shenandoah/generational/TestOldGrowthTriggers.java as f…
Mar 3, 2026
c0c8bdd
8378948: Remove unused local variable in RunnerGSInserterThread
albertnetymk Mar 3, 2026
0b183bf
8312116: GenShen: make instantaneous allocation rate triggers more ti…
kdnilsen Mar 3, 2026
297812e
8378867: jpackage references non-existing "message.app-image-requires…
Mar 3, 2026
57db48c
8373290: Update FreeType to 2.14.1
jayathirthrao Mar 3, 2026
6674049
8378963: Test test/jdk/java/lang/management/RuntimeMXBean/InputArgume…
olivergillespie Mar 3, 2026
b28568f
8367478: Improve UseAVX setting and add cpu descriptions for zhaoxin …
Double-Minds-JV Mar 3, 2026
7dc97af
8378905: RISC-V: fastdebug build fails after JDK-8377554
DingliZhang Mar 3, 2026
6cf8b2e
8378845: Add NoSafepointVerifier to CriticalSection classes
Mar 3, 2026
364fd0e
8378971: Test jdk/jfr/event/runtime/TestVMInfoEvent.java fails after …
olivergillespie Mar 3, 2026
0ea7d89
8377903: ArraysSupport::mismatch should document that they return the…
rgiulietti Mar 3, 2026
df43ef9
8378883: Enable more vector reductions IR matching tests for RISC-V
DingliZhang Mar 3, 2026
86800eb
8378723: Locale variant delimiter is unclear
Mar 3, 2026
c13fdc0
8378877: jpackage: improve rebranding of exe files on Windows
Mar 3, 2026
a6db3f8
8378873: jpackage: remove macOS-specific code from jdk.jpackage.inter…
Mar 3, 2026
73363a0
8378874: jpackage: remove redundant messages
Mar 3, 2026
0729d1d
8379039: Build failure on vector API source generation after JDK-8378312
YaSuenag Mar 4, 2026
284d131
8378876: jpackage: facilitate testing with mocks
Mar 4, 2026
7f518de
8378584: (process) Investigate and fix Alpine errors in Basic.java Pr…
fthevenet Mar 4, 2026
d9e256d
8372245: GTest globalDefinitions.format_specifiers cannot run without VM
xmas92 Mar 4, 2026
3cd0b99
8372248: GTest istream.coverage depends on istream.basic
xmas92 Mar 4, 2026
39b1e9d
8372247: OSX: Semaphore.trywait requires os::Bsd::clock_init
xmas92 Mar 4, 2026
58d2c1d
8371155: Type annotations on local variables are classified after the…
lahodaj Mar 4, 2026
f7918df
8378779: NBody demo test times out with C1 stress testing
mhaessig Mar 4, 2026
5ab9ddf
8378138: G1: Assertion failure from G1CollectedHeap::block_start proc…
albertnetymk Mar 4, 2026
f26b379
8378927: H3MultipleConnectionsToSameHost.java#with-continuations inte…
djelinski Mar 4, 2026
d78a13a
8366138: Parse::jump_switch_ranges() could cause stack overflow when …
Mar 4, 2026
329e14b
8375688: C2: Missed Ideal optimization opportunity with VectorMaskToL…
Mar 4, 2026
a3b468c
8379119: G1: Move NoteStartOfMarkHRClosure out of global namespace
Mar 4, 2026
6c7c0db
Merge branch 'sapmachine' into pr-jdk-27+12
RealCLanger Mar 6, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ NashornProfile.txt
**/JTreport/**
**/JTwork/**
/src/utils/LogCompilation/target/
/src/utils/LogCompilation/logc.jar
/.project/
/.settings/
/compile_commands.json
Expand Down
5 changes: 3 additions & 2 deletions make/PreInit.gmk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2012, 2025, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2012, 2026, 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 @@ -66,7 +66,8 @@ CALLED_SPEC_TARGETS := $(filter-out $(ALL_GLOBAL_TARGETS), $(CALLED_TARGETS))
ifeq ($(CALLED_SPEC_TARGETS), )
SKIP_SPEC := true
endif
ifeq ($(findstring p, $(MAKEFLAGS))$(findstring q, $(MAKEFLAGS)), pq)
MFLAGS_SINGLE := $(filter-out --%, $(MFLAGS))
ifeq ($(findstring p, $(MFLAGS_SINGLE))$(findstring q, $(MFLAGS_SINGLE)), pq)
SKIP_SPEC := true
endif

Expand Down
4 changes: 2 additions & 2 deletions make/autoconf/lib-bundled.m4
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,8 @@ AC_DEFUN_ONCE([LIB_SETUP_ZLIB],
LIBZ_LIBS=""
if test "x$USE_EXTERNAL_LIBZ" = "xfalse"; then
LIBZ_CFLAGS="$LIBZ_CFLAGS -I$TOPDIR/src/java.base/share/native/libzip/zlib"
if test "x$OPENJDK_TARGET_OS" = xmacosx; then
LIBZ_CFLAGS="$LIBZ_CFLAGS -DHAVE_UNISTD_H"
if test "x$OPENJDK_TARGET_OS" = xmacosx -o "x$OPENJDK_TARGET_OS" = xaix -o "x$OPENJDK_TARGET_OS" = xlinux; then
LIBZ_CFLAGS="$LIBZ_CFLAGS -DHAVE_UNISTD_H=1 -DHAVE_STDARG_H=1"
fi
else
LIBZ_LIBS="-lz"
Expand Down
4 changes: 4 additions & 0 deletions make/hotspot/lib/CompileGtest.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ $(eval $(call SetupJdkLibrary, BUILD_GTEST_LIBGTEST, \
unused-result zero-as-null-pointer-constant, \
DISABLED_WARNINGS_clang := format-nonliteral undef unused-result \
zero-as-null-pointer-constant, \
$(comment Disable deprecated-declarations warnings to workaround) \
$(comment clang18+glibc12 bug https://github.com/llvm/llvm-project/issues/76515) \
$(comment until the clang bug has been fixed) \
DISABLED_WARNINGS_clang_gtest-all.cc := deprecated-declarations, \
DISABLED_WARNINGS_microsoft := 4530, \
DEFAULT_CFLAGS := false, \
CFLAGS := $(JVM_CFLAGS) \
Expand Down
30 changes: 29 additions & 1 deletion src/hotspot/cpu/aarch64/aarch64.ad
Original file line number Diff line number Diff line change
Expand Up @@ -3403,11 +3403,13 @@ encode %{
} else if (rtype == relocInfo::metadata_type) {
__ mov_metadata(dst_reg, (Metadata*)con);
} else {
assert(rtype == relocInfo::none, "unexpected reloc type");
assert(rtype == relocInfo::none || rtype == relocInfo::external_word_type, "unexpected reloc type");
// load fake address constants using a normal move
if (! __ is_valid_AArch64_address(con) ||
con < (address)(uintptr_t)os::vm_page_size()) {
__ mov(dst_reg, con);
} else {
// no reloc so just use adrp and add
uint64_t offset;
__ adrp(dst_reg, con, offset);
__ add(dst_reg, dst_reg, offset);
Expand Down Expand Up @@ -4535,6 +4537,18 @@ operand immP_1()
interface(CONST_INTER);
%}

// AOT Runtime Constants Address
operand immAOTRuntimeConstantsAddress()
%{
// Check if the address is in the range of AOT Runtime Constants
predicate(AOTRuntimeConstants::contains((address)(n->get_ptr())));
match(ConP);

op_cost(0);
format %{ %}
interface(CONST_INTER);
%}

// Float and Double operands
// Double Immediate
operand immD()
Expand Down Expand Up @@ -6898,6 +6912,20 @@ instruct loadConP1(iRegPNoSp dst, immP_1 con)
ins_pipe(ialu_imm);
%}

instruct loadAOTRCAddress(iRegPNoSp dst, immAOTRuntimeConstantsAddress con)
%{
match(Set dst con);

ins_cost(INSN_COST);
format %{ "adr $dst, $con\t# AOT Runtime Constants Address" %}

ins_encode %{
__ load_aotrc_address($dst$$Register, (address)$con$$constant);
%}

ins_pipe(ialu_imm);
%}

// Load Narrow Pointer Constant

instruct loadConN(iRegNNoSp dst, immN con)
Expand Down
10 changes: 10 additions & 0 deletions src/hotspot/cpu/aarch64/c1_LIRAssembler_aarch64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#include "c1/c1_ValueStack.hpp"
#include "ci/ciArrayKlass.hpp"
#include "ci/ciInstance.hpp"
#include "code/aotCodeCache.hpp"
#include "code/compiledIC.hpp"
#include "gc/shared/collectedHeap.hpp"
#include "gc/shared/gc_globals.hpp"
Expand Down Expand Up @@ -532,6 +533,15 @@ void LIR_Assembler::const2reg(LIR_Opr src, LIR_Opr dest, LIR_PatchCode patch_cod

case T_LONG: {
assert(patch_code == lir_patch_none, "no patching handled here");
#if INCLUDE_CDS
if (AOTCodeCache::is_on_for_dump()) {
address b = c->as_pointer();
if (AOTRuntimeConstants::contains(b)) {
__ load_aotrc_address(dest->as_register_lo(), b);
break;
}
}
#endif
__ mov(dest->as_register_lo(), (intptr_t)c->as_jlong());
break;
}
Expand Down
23 changes: 20 additions & 3 deletions src/hotspot/cpu/aarch64/gc/g1/g1BarrierSetAssembler_aarch64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
*/

#include "asm/macroAssembler.inline.hpp"
#include "code/aotCodeCache.hpp"
#include "gc/g1/g1BarrierSet.hpp"
#include "gc/g1/g1BarrierSetAssembler.hpp"
#include "gc/g1/g1BarrierSetRuntime.hpp"
Expand Down Expand Up @@ -243,9 +244,25 @@ static void generate_post_barrier(MacroAssembler* masm,
assert_different_registers(store_addr, new_val, thread, tmp1, tmp2, noreg, rscratch1);

// Does store cross heap regions?
__ eor(tmp1, store_addr, new_val); // tmp1 := store address ^ new value
__ lsr(tmp1, tmp1, G1HeapRegion::LogOfHRGrainBytes); // tmp1 := ((store address ^ new value) >> LogOfHRGrainBytes)
__ cbz(tmp1, done);
#if INCLUDE_CDS
// AOT code needs to load the barrier grain shift from the aot
// runtime constants area in the code cache otherwise we can compile
// it as an immediate operand
if (AOTCodeCache::is_on_for_dump()) {
address grain_shift_address = (address)AOTRuntimeConstants::grain_shift_address();
__ eor(tmp1, store_addr, new_val);
__ lea(tmp2, ExternalAddress(grain_shift_address));
__ ldrb(tmp2, tmp2);
__ lsrv(tmp1, tmp1, tmp2);
__ cbz(tmp1, done);
} else
#endif
{
__ eor(tmp1, store_addr, new_val); // tmp1 := store address ^ new value
__ lsr(tmp1, tmp1, G1HeapRegion::LogOfHRGrainBytes); // tmp1 := ((store address ^ new value) >> LogOfHRGrainBytes)
__ cbz(tmp1, done);
}

// Crosses regions, storing null?
if (new_val_may_be_null) {
__ cbz(new_val, done);
Expand Down
22 changes: 22 additions & 0 deletions src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5754,13 +5754,35 @@ void MacroAssembler::adrp(Register reg1, const Address &dest, uint64_t &byte_off
}

void MacroAssembler::load_byte_map_base(Register reg) {
#if INCLUDE_CDS
if (AOTCodeCache::is_on_for_dump()) {
address byte_map_base_adr = AOTRuntimeConstants::card_table_base_address();
lea(reg, ExternalAddress(byte_map_base_adr));
ldr(reg, Address(reg));
return;
}
#endif
CardTableBarrierSet* ctbs = CardTableBarrierSet::barrier_set();

// Strictly speaking the card table base isn't an address at all, and it might
// even be negative. It is thus materialised as a constant.
mov(reg, (uint64_t)ctbs->card_table_base_const());
}

void MacroAssembler::load_aotrc_address(Register reg, address a) {
#if INCLUDE_CDS
assert(AOTRuntimeConstants::contains(a), "address out of range for data area");
if (AOTCodeCache::is_on_for_dump()) {
// all aotrc field addresses should be registered in the AOTCodeCache address table
lea(reg, ExternalAddress(a));
} else {
mov(reg, (uint64_t)a);
}
#else
ShouldNotReachHere();
#endif
}

void MacroAssembler::build_frame(int framesize) {
assert(framesize >= 2 * wordSize, "framesize must include space for FP/LR");
assert(framesize % (2*wordSize) == 0, "must preserve 2*wordSize alignment");
Expand Down
3 changes: 3 additions & 0 deletions src/hotspot/cpu/aarch64/macroAssembler_aarch64.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1476,6 +1476,9 @@ class MacroAssembler: public Assembler {
// Load the base of the cardtable byte map into reg.
void load_byte_map_base(Register reg);

// Load a constant address in the AOT Runtime Constants area
void load_aotrc_address(Register reg, address a);

// Prolog generator routines to support switch between x86 code and
// generated ARM code

Expand Down
4 changes: 3 additions & 1 deletion src/hotspot/cpu/aarch64/vm_version_aarch64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,9 @@ void VM_Version::initialize() {
FLAG_SET_DEFAULT(BlockZeroingLowLimit, 4 * VM_Version::zva_length());
}
} else if (UseBlockZeroing) {
warning("DC ZVA is not available on this CPU");
if (!FLAG_IS_DEFAULT(UseBlockZeroing)) {
warning("DC ZVA is not available on this CPU");
}
FLAG_SET_DEFAULT(UseBlockZeroing, false);
}

Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/cpu/aarch64/vm_version_aarch64.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ class VM_Version : public Abstract_VM_Version {
return false;
}

static bool is_zva_enabled() { return 0 <= _zva_length; }
static bool is_zva_enabled() { return 0 < _zva_length; }
static int zva_length() {
assert(is_zva_enabled(), "ZVA not available");
return _zva_length;
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/cpu/riscv/riscv.ad
Original file line number Diff line number Diff line change
Expand Up @@ -2274,7 +2274,7 @@ encode %{
} else if (rtype == relocInfo::metadata_type) {
__ mov_metadata(dst_reg, (Metadata*)con);
} else {
assert(rtype == relocInfo::none, "unexpected reloc type");
assert(rtype == relocInfo::none || rtype == relocInfo::external_word_type, "unexpected reloc type");
__ mv(dst_reg, $src$$constant);
}
}
Expand Down
10 changes: 10 additions & 0 deletions src/hotspot/cpu/x86/c1_LIRAssembler_x86.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include "c1/c1_ValueStack.hpp"
#include "ci/ciArrayKlass.hpp"
#include "ci/ciInstance.hpp"
#include "code/aotCodeCache.hpp"
#include "compiler/oopMap.hpp"
#include "gc/shared/collectedHeap.hpp"
#include "gc/shared/gc_globals.hpp"
Expand Down Expand Up @@ -535,6 +536,15 @@ void LIR_Assembler::const2reg(LIR_Opr src, LIR_Opr dest, LIR_PatchCode patch_cod

case T_LONG: {
assert(patch_code == lir_patch_none, "no patching handled here");
#if INCLUDE_CDS
if (AOTCodeCache::is_on_for_dump()) {
address b = c->as_pointer();
if (AOTRuntimeConstants::contains(b)) {
__ load_aotrc_address(dest->as_register_lo(), b);
break;
}
}
#endif
__ movptr(dest->as_register_lo(), (intptr_t)c->as_jlong());
break;
}
Expand Down
41 changes: 37 additions & 4 deletions src/hotspot/cpu/x86/gc/g1/g1BarrierSetAssembler_x86.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
*/

#include "asm/macroAssembler.inline.hpp"
#include "code/aotCodeCache.hpp"
#include "gc/g1/g1BarrierSet.hpp"
#include "gc/g1/g1BarrierSetAssembler.hpp"
#include "gc/g1/g1BarrierSetRuntime.hpp"
Expand Down Expand Up @@ -268,6 +269,16 @@ void G1BarrierSetAssembler::g1_write_barrier_pre(MacroAssembler* masm,
__ bind(done);
}

#if INCLUDE_CDS
// return a register that differs from reg1, reg2, reg3 and reg4

static Register pick_different_reg(Register reg1, Register reg2 = noreg, Register reg3= noreg, Register reg4 = noreg) {
RegSet available = (RegSet::of(rscratch1, rscratch2, rax, rbx) + rdx -
RegSet::of(reg1, reg2, reg3, reg4));
return *(available.begin());
}
#endif // INCLUDE_CDS

static void generate_post_barrier(MacroAssembler* masm,
const Register store_addr,
const Register new_val,
Expand All @@ -280,10 +291,32 @@ static void generate_post_barrier(MacroAssembler* masm,

Label L_done;
// Does store cross heap regions?
__ movptr(tmp1, store_addr); // tmp1 := store address
__ xorptr(tmp1, new_val); // tmp1 := store address ^ new value
__ shrptr(tmp1, G1HeapRegion::LogOfHRGrainBytes); // ((store address ^ new value) >> LogOfHRGrainBytes) == 0?
__ jccb(Assembler::equal, L_done);
#if INCLUDE_CDS
// AOT code needs to load the barrier grain shift from the aot
// runtime constants area in the code cache otherwise we can compile
// it as an immediate operand

if (AOTCodeCache::is_on_for_dump()) {
address grain_shift_addr = AOTRuntimeConstants::grain_shift_address();
Register save = pick_different_reg(rcx, tmp1, new_val, store_addr);
__ push(save);
__ movptr(save, store_addr);
__ xorptr(save, new_val);
__ push(rcx);
__ lea(rcx, ExternalAddress(grain_shift_addr));
__ movl(rcx, Address(rcx, 0));
__ shrptr(save);
__ pop(rcx);
__ pop(save);
__ jcc(Assembler::equal, L_done);
} else
#endif // INCLUDE_CDS
{
__ movptr(tmp1, store_addr); // tmp1 := store address
__ xorptr(tmp1, new_val); // tmp1 := store address ^ new value
__ shrptr(tmp1, G1HeapRegion::LogOfHRGrainBytes); // ((store address ^ new value) >> LogOfHRGrainBytes) == 0?
__ jccb(Assembler::equal, L_done);
}

// Crosses regions, storing null?
if (new_val_may_be_null) {
Expand Down
24 changes: 20 additions & 4 deletions src/hotspot/cpu/x86/gc/shared/cardTableBarrierSetAssembler_x86.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
*/

#include "asm/macroAssembler.inline.hpp"
#include "code/aotCodeCache.hpp"
#include "gc/shared/barrierSet.hpp"
#include "gc/shared/cardTable.hpp"
#include "gc/shared/cardTableBarrierSet.hpp"
Expand Down Expand Up @@ -111,7 +112,15 @@ void CardTableBarrierSetAssembler::gen_write_ref_array_post_barrier(MacroAssembl
__ shrptr(end, CardTable::card_shift());
__ subptr(end, addr); // end --> cards count

__ mov64(tmp, (intptr_t)ctbs->card_table_base_const());
#if INCLUDE_CDS
if (AOTCodeCache::is_on_for_dump()) {
__ lea(tmp, ExternalAddress(AOTRuntimeConstants::card_table_base_address()));
__ movq(tmp, Address(tmp, 0));
} else
#endif
{
__ mov64(tmp, (intptr_t)ctbs->card_table_base_const());
}
__ addptr(addr, tmp);
__ BIND(L_loop);
__ movb(Address(addr, count, Address::times_1), 0);
Expand All @@ -121,7 +130,7 @@ __ BIND(L_loop);
__ BIND(L_done);
}

void CardTableBarrierSetAssembler::store_check(MacroAssembler* masm, Register obj, Address dst) {
void CardTableBarrierSetAssembler::store_check(MacroAssembler* masm, Register obj, Address dst, Register rscratch) {
// Does a store check for the oop in register obj. The content of
// register obj is destroyed afterwards.
CardTableBarrierSet* ctbs = CardTableBarrierSet::barrier_set();
Expand All @@ -136,6 +145,13 @@ void CardTableBarrierSetAssembler::store_check(MacroAssembler* masm, Register ob
// never need to be relocated. On 64bit however the value may be too
// large for a 32bit displacement.
intptr_t byte_map_base = (intptr_t)ctbs->card_table_base_const();
#if INCLUDE_CDS
if (AOTCodeCache::is_on_for_dump()) {
__ lea(rscratch, ExternalAddress(AOTRuntimeConstants::card_table_base_address()));
__ movq(rscratch, Address(rscratch, 0));
card_addr = Address(rscratch, obj, Address::times_1, 0);
} else
#endif
if (__ is_simm32(byte_map_base)) {
card_addr = Address(noreg, obj, Address::times_1, byte_map_base);
} else {
Expand Down Expand Up @@ -174,10 +190,10 @@ void CardTableBarrierSetAssembler::oop_store_at(MacroAssembler* masm, DecoratorS
if (needs_post_barrier) {
// flatten object address if needed
if (!precise || (dst.index() == noreg && dst.disp() == 0)) {
store_check(masm, dst.base(), dst);
store_check(masm, dst.base(), dst, tmp2);
} else {
__ lea(tmp1, dst);
store_check(masm, tmp1, dst);
store_check(masm, tmp1, dst, tmp2);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class CardTableBarrierSetAssembler: public BarrierSetAssembler {
virtual void gen_write_ref_array_pre_barrier(MacroAssembler* masm, DecoratorSet decorators,
Register addr, Register count) {}

void store_check(MacroAssembler* masm, Register obj, Address dst);
void store_check(MacroAssembler* masm, Register obj, Address dst, Register rscratch);

virtual void gen_write_ref_array_post_barrier(MacroAssembler* masm, DecoratorSet decorators, Register addr, Register count, Register tmp);

Expand Down
Loading
Loading