Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
114 commits
Select commit Hold shift + click to select a range
4e44bb0
Add replace nmethod function
chadrako Jan 7, 2025
e8ecbc3
Clear inline caches
chadrako Mar 4, 2025
f6755f6
Fix bug when updating method pointer
chadrako Mar 6, 2025
daf4169
Remove getNumNMethods
chadrako Mar 6, 2025
887c4e2
Rename replaceNMethod to relocateNMethod
chadrako Mar 6, 2025
a62c7b0
Clean up
chadrako Mar 6, 2025
b659ddf
Add nmethod::is_relocatable()
chadrako Mar 7, 2025
925ce03
Add check for already in correct heap
chadrako Mar 7, 2025
bc69b57
Run tests with all GCs
chadrako Mar 10, 2025
54c43fb
Run RelocateNMethod.java with all GCs
chadrako Mar 10, 2025
3a0937d
Merge branch 'master' into JDK-8316694-Final
chadrako Mar 11, 2025
566c37a
Updates after JDK-8343789
chadrako Mar 11, 2025
3a77f48
Only run RelocateNMethodMultiplePaths on debug builds
chadrako Mar 11, 2025
7137a07
Exclude OSR
chadrako Mar 11, 2025
10b2079
Replace copy constructor with clone function
chadrako Mar 13, 2025
8a2b55b
Remove isRelocation flag
chadrako Mar 13, 2025
69d941b
Add PRODUCT check
chadrako Mar 13, 2025
80734cd
Share immutable data between copied nmethods
chadrako Mar 14, 2025
7b448c6
Fix build issues
chadrako Mar 14, 2025
54e6988
Remove relocate all
chadrako Mar 17, 2025
899707e
Remove old copy constructor from header file
chadrako Mar 17, 2025
354ba3b
Remove current code heap check
chadrako Mar 17, 2025
328c5f6
Immutable data references updates
chadrako Mar 17, 2025
9391eaf
Update tests
chadrako Mar 17, 2025
8f12fd3
Cast dest to void star
chadrako Mar 17, 2025
917046b
Remove DISABLED_WARNINGS
chadrako Mar 17, 2025
3b8d093
revert
chadrako Mar 18, 2025
c882762
Fix copywrite
chadrako Mar 18, 2025
0531335
Fix windows build
chadrako Mar 19, 2025
a7f3240
Relocate nmethod at safepoint
chadrako Mar 24, 2025
e12e2c1
Fix call sites and change relocation to opt in
chadrako Apr 2, 2025
8e53ed1
Undo AsmRemarks and DbgStrings reuse
chadrako Apr 17, 2025
4121768
Style
chadrako Apr 17, 2025
27e4151
Remove whitespace
chadrako Apr 17, 2025
61ed055
Use methodHandle for VM_Operation so pointer is not stale
chadrako Apr 21, 2025
0d4d31f
Hold Compile_lock
chadrako Apr 21, 2025
5552a86
Add null check in StressNMethodRelocation
chadrako Apr 21, 2025
1c6db6c
Fix branch range check
chadrako Apr 24, 2025
027f524
Move post init and remove no entrant check
chadrako Apr 25, 2025
bd143f5
Relocate without safepoint
chadrako Apr 28, 2025
077369b
Add additional is_relocatable checks
chadrako Apr 28, 2025
c78a811
Remove max branch range patch
chadrako May 1, 2025
11db34d
Merge remote-tracking branch 'origin/master' into JDK-8316694-Final-n…
chadrako May 1, 2025
97b9d76
Remove set call dest assert
chadrako May 6, 2025
e18be51
Fix branch_range revert
chadrako May 6, 2025
10b58df
Remove StressNMethodRelocation
chadrako May 6, 2025
a1a2bda
Exclude JVMCI nmethods
chadrako May 6, 2025
2610a0e
Only hold NMethodState_lock when needed
chadrako May 6, 2025
21a86e6
Add relocate_nmethod_mirror
chadrako May 7, 2025
c636119
Unexclude JVMCI methods
chadrako May 7, 2025
a1dfc47
Fix JVMCI nmethod data
chadrako May 8, 2025
c18eac9
Add nullptr check to relocate
chadrako May 8, 2025
1581403
Remove unnecessary include
chadrako May 8, 2025
9ca3563
Fix null check
chadrako May 8, 2025
0813725
Create nmethod relocation stress test
chadrako May 12, 2025
e81296d
Exclude JVMCI methods
chadrako May 22, 2025
398a4dc
Update tests
chadrako May 22, 2025
edefbf6
Only exclude JVMCI methods that contain a mirror
chadrako May 27, 2025
a0134a8
Add JVMCINMethodData::has_mirror()
chadrako May 27, 2025
54aedbe
Update assert note in nmethod::clear_inline_caches
chadrako May 29, 2025
4e74918
Fix incorrect destination set if no trampoline available
chadrako May 29, 2025
37f2fbc
Add type for immutable_data_references
chadrako May 29, 2025
c5ff58f
Add requires GC to tests
chadrako May 29, 2025
ec06bb5
Remove gc on allocation
chadrako May 30, 2025
d3bdb1f
Small fix
chadrako May 30, 2025
ec6821f
Fix comment
chadrako May 30, 2025
6d053dc
Move ICache::invalidate_range
chadrako May 30, 2025
9f75307
Change to ImmutableDataReferences
chadrako May 30, 2025
14bcbbf
Use ptrdiff_t instead of int
chadrako Jun 2, 2025
37fb2fa
Fix is_safe
chadrako Jun 2, 2025
8ac5c24
Update DeoptimizeRelocatedNMethod to call relocated function
chadrako Jun 2, 2025
7f558f6
Remove 0 from relocateNMethodFromAddr0
chadrako Jun 2, 2025
39a476d
Update nm valid check
chadrako Jun 2, 2025
eed3d43
Update ImmutableDataReferences
chadrako Jun 2, 2025
b0dad66
Update immutable_data_references naming
chadrako Jun 2, 2025
4e80e35
Fix test copywrite
chadrako Jun 2, 2025
3c3211d
Publish JVMTI events
chadrako Jun 11, 2025
a21b6ac
Log relocated nmethod
chadrako Jun 11, 2025
b3358bd
Add test to verify JVMTI events during nmethod relocation
chadrako Jun 17, 2025
4091740
Move far branch fix to fix_relocation_after_move
chadrako Jun 17, 2025
60005e5
Move far branch fix to fix_relocation_after_move
chadrako Jun 17, 2025
03bfce8
Only check branch distance for aarch64 and riscv
chadrako Jun 17, 2025
6173fdb
Merge remote-tracking branch 'origin/master' into JDK-8316694-Final
chadrako Jun 17, 2025
d5e566c
Use new _metadata_size instead of _jvmci_data_size
chadrako Jun 17, 2025
50f0edb
Print address as pointer
chadrako Jun 18, 2025
b02e8bd
Use set_destination_mt_safe
chadrako Jun 18, 2025
292ab74
Fix pointer printing
chadrako Jun 18, 2025
e51a1a0
Merge remote-tracking branch 'origin/master' into JDK-8316694-Final
chadrako Jun 19, 2025
ff5c6d9
Update how call sites are fixed
chadrako Jun 25, 2025
70e4164
Merge remote-tracking branch 'origin/master' into JDK-8316694-Final
chadrako Jun 25, 2025
a6302fd
Let trampolines fix their owners
chadrako Jul 2, 2025
c3245fb
Enclose ImmutableDataReferencesCounterSize in parentheses
chadrako Jul 2, 2025
0f4ff96
Update justification for skipping CallRelocation
chadrako Jul 2, 2025
e7f75d5
Merge branch 'master' into JDK-8316694-Final
chadrako Jul 8, 2025
66d73c1
Typo
chadrako Jul 8, 2025
68a9876
Remove aarch64 trampoline check
chadrako Jul 14, 2025
371e130
Add nmethod copy constructor
chadrako Jul 14, 2025
3683470
Revert is_always_within_branch_range changes
chadrako Jul 14, 2025
1dcf47e
Require caller to hold locks
chadrako Jul 17, 2025
4d782af
Reorder is_relocatable checks
chadrako Jul 21, 2025
fbfa27b
Add assert before freeing immutable data
chadrako Jul 22, 2025
27991b2
Rename method to nm
chadrako Jul 22, 2025
b257ea5
Update NMethod.java with immutable data changes
chadrako Jul 22, 2025
1b001df
Fix spacing
chadrako Jul 22, 2025
d4e3dd3
Use CompiledICLocker instead of CompiledIC_lock
chadrako Jul 24, 2025
cc8d286
Lock nmethod::relocate behind experimental flag
chadrako Aug 11, 2025
24c3568
Merge remote-tracking branch 'origin/master' into JDK-8316694-Final
chadrako Aug 12, 2025
3344a72
Fix WB_RelocateNMethodFromAddr to not use stale nmethod pointer
chadrako Aug 22, 2025
668eb4a
Merge remote-tracking branch 'origin/master' into JDK-8316694-Final
chadrako Aug 27, 2025
023472c
Refactor JVMTI test
chadrako Aug 28, 2025
03a6958
Merge remote-tracking branch 'origin/master' into JDK-8316694-Final
chadrako Aug 28, 2025
a205163
Fix NMethodRelocationTest.java logging race
chadrako Aug 29, 2025
bf18a4c
Fix race when not installed nmethod is deoptimized
chadrako Sep 9, 2025
104661c
Merge remote-tracking branch 'origin/master' into JDK-8316694-Final
chadrako Oct 3, 2025
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
1 change: 0 additions & 1 deletion src/hotspot/cpu/aarch64/relocInfo_aarch64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ void Relocation::pd_set_call_destination(address x) {

void trampoline_stub_Relocation::pd_fix_owner_after_move() {
NativeCall* call = nativeCall_at(owner());
assert(call->raw_destination() == owner(), "destination should be empty");
address trampoline = addr();
address dest = nativeCallTrampolineStub_at(trampoline)->destination();
if (!Assembler::reachable_from_branch_at(owner(), dest)) {
Expand Down
11 changes: 6 additions & 5 deletions src/hotspot/share/code/codeBehaviours.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,23 +23,24 @@
*/

#include "code/codeBehaviours.hpp"
#include "code/nmethod.hpp"
#include "runtime/mutexLocker.hpp"
#include "runtime/safepoint.hpp"

CompiledICProtectionBehaviour* CompiledICProtectionBehaviour::_current = nullptr;

bool DefaultICProtectionBehaviour::lock(nmethod* method) {
if (is_safe(method)) {
bool DefaultICProtectionBehaviour::lock(nmethod* nm) {
if (is_safe(nm)) {
return false;
}
CompiledIC_lock->lock_without_safepoint_check();
return true;
}

void DefaultICProtectionBehaviour::unlock(nmethod* method) {
void DefaultICProtectionBehaviour::unlock(nmethod* nm) {
CompiledIC_lock->unlock();
}

bool DefaultICProtectionBehaviour::is_safe(nmethod* method) {
return SafepointSynchronize::is_at_safepoint() || CompiledIC_lock->owned_by_self();
bool DefaultICProtectionBehaviour::is_safe(nmethod* nm) {
return SafepointSynchronize::is_at_safepoint() || CompiledIC_lock->owned_by_self() || (NMethodState_lock->owned_by_self() && nm->is_not_installed());
}
12 changes: 6 additions & 6 deletions src/hotspot/share/code/codeBehaviours.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,18 @@ class CompiledICProtectionBehaviour {
static CompiledICProtectionBehaviour* _current;

public:
virtual bool lock(nmethod* method) = 0;
virtual void unlock(nmethod* method) = 0;
virtual bool is_safe(nmethod* method) = 0;
virtual bool lock(nmethod* nm) = 0;
virtual void unlock(nmethod* nm) = 0;
virtual bool is_safe(nmethod* nm) = 0;

static CompiledICProtectionBehaviour* current() { return _current; }
static void set_current(CompiledICProtectionBehaviour* current) { _current = current; }
};

class DefaultICProtectionBehaviour: public CompiledICProtectionBehaviour, public CHeapObj<mtInternal> {
virtual bool lock(nmethod* method);
virtual void unlock(nmethod* method);
virtual bool is_safe(nmethod* method);
virtual bool lock(nmethod* nm);
virtual void unlock(nmethod* nm);
virtual bool is_safe(nmethod* nm);
};

#endif // SHARE_CODE_CODEBEHAVIOURS_HPP
2 changes: 1 addition & 1 deletion src/hotspot/share/code/codeCache.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ class CodeCache : AllStatic {
static bool heap_available(CodeBlobType code_blob_type);

// Returns the CodeBlobType for the given nmethod
static CodeBlobType get_code_blob_type(nmethod* nm) {
static CodeBlobType get_code_blob_type(const nmethod* nm) {
return get_code_heap(nm)->code_blob_type();
}

Expand Down
4 changes: 2 additions & 2 deletions src/hotspot/share/code/compiledIC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ CompiledICLocker::~CompiledICLocker() {
}
}

bool CompiledICLocker::is_safe(nmethod* method) {
return CompiledICProtectionBehaviour::current()->is_safe(method);
bool CompiledICLocker::is_safe(nmethod* nm) {
return CompiledICProtectionBehaviour::current()->is_safe(nm);
}

bool CompiledICLocker::is_safe(address code) {
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/share/code/compiledIC.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class CompiledICLocker: public StackObj {
public:
CompiledICLocker(nmethod* method);
~CompiledICLocker();
static bool is_safe(nmethod* method);
static bool is_safe(nmethod* nm);
static bool is_safe(address code);
};

Expand Down
Loading