Skip to content

Commit 78b8015

Browse files
pchilanoAlan BatemanAndrew HaleyRealFYangcoleenp
committedNov 12, 2024
8338383: Implement JEP 491: Synchronize Virtual Threads without Pinning
Co-authored-by: Patricio Chilano Mateo <pchilanomate@openjdk.org> Co-authored-by: Alan Bateman <alanb@openjdk.org> Co-authored-by: Andrew Haley <aph@openjdk.org> Co-authored-by: Fei Yang <fyang@openjdk.org> Co-authored-by: Coleen Phillimore <coleenp@openjdk.org> Co-authored-by: Richard Reingruber <rrich@openjdk.org> Co-authored-by: Martin Doerr <mdoerr@openjdk.org> Reviewed-by: aboldtch, dholmes, coleenp, fbredberg, dlong, sspitsyn
1 parent 8a2a75e commit 78b8015

File tree

246 files changed

+8283
-2743
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

246 files changed

+8283
-2743
lines changed
 

‎src/hotspot/cpu/aarch64/aarch64.ad

+3-4
Original file line numberDiff line numberDiff line change
@@ -1648,8 +1648,8 @@ int MachCallRuntimeNode::ret_addr_offset() {
16481648
// for real runtime callouts it will be six instructions
16491649
// see aarch64_enc_java_to_runtime
16501650
// adr(rscratch2, retaddr)
1651+
// str(rscratch2, Address(rthread, JavaThread::last_Java_pc_offset()));
16511652
// lea(rscratch1, RuntimeAddress(addr)
1652-
// stp(zr, rscratch2, Address(__ pre(sp, -2 * wordSize)))
16531653
// blr(rscratch1)
16541654
CodeBlob *cb = CodeCache::find_blob(_entry_point);
16551655
if (cb) {
@@ -3696,14 +3696,13 @@ encode %{
36963696
__ post_call_nop();
36973697
} else {
36983698
Label retaddr;
3699+
// Make the anchor frame walkable
36993700
__ adr(rscratch2, retaddr);
3701+
__ str(rscratch2, Address(rthread, JavaThread::last_Java_pc_offset()));
37003702
__ lea(rscratch1, RuntimeAddress(entry));
3701-
// Leave a breadcrumb for JavaFrameAnchor::capture_last_Java_pc()
3702-
__ stp(zr, rscratch2, Address(__ pre(sp, -2 * wordSize)));
37033703
__ blr(rscratch1);
37043704
__ bind(retaddr);
37053705
__ post_call_nop();
3706-
__ add(sp, sp, 2 * wordSize);
37073706
}
37083707
if (Compile::current()->max_vector_size() > 0) {
37093708
__ reinitialize_ptrue();

‎src/hotspot/cpu/aarch64/c1_MacroAssembler_aarch64.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,8 @@ int C1_MacroAssembler::lock_object(Register hdr, Register obj, Register disp_hdr
119119
cbnz(hdr, slow_case);
120120
// done
121121
bind(done);
122+
inc_held_monitor_count(rscratch1);
122123
}
123-
increment(Address(rthread, JavaThread::held_monitor_count_offset()));
124124
return null_check_offset;
125125
}
126126

@@ -159,8 +159,8 @@ void C1_MacroAssembler::unlock_object(Register hdr, Register obj, Register disp_
159159
}
160160
// done
161161
bind(done);
162+
dec_held_monitor_count(rscratch1);
162163
}
163-
decrement(Address(rthread, JavaThread::held_monitor_count_offset()));
164164
}
165165

166166

0 commit comments

Comments
 (0)