[aarch64-port-dev ] RFR: 8216557 Aarch64: Add support for Concurrent Class Unloading

Andrew Haley aph at redhat.com
Wed Apr 8 13:08:56 UTC 2020


On 4/7/20 1:25 PM, Andrew Haley wrote:
> On 4/7/20 12:52 PM, Andrew Haley wrote:
>> I notice that even after applying your patch we are still using embedded
>> OOPs in two places.
>>
>> Here in aarch64.ad:
>>
>>       if (rtype == relocInfo::oop_type) {
>>         __ movoop(dst_reg, (jobject)con, /*immediate*/true);
>>       }
>>
>> and here in sharedRuntime_aarch64.cpp:
>>
>>     //  load oop into a register
>>     __ movoop(c_rarg1,
>>               JNIHandles::make_local(method->method_holder()->java_mirror()),
>>               /*immediate*/true);
>>
>> Why is this?
> 
> Ah, the second one is a handle, of course, and AFAIK handles don't move.
> Having said that, the use of movoop on something that is the address of an
> oop rather than an oop is odd,but it's done on other targets.
> 
> The C2 one is still suspect.

I made the following changes, bootstrap still works:

diff -r cd06d732d5f0 src/hotspot/cpu/aarch64/aarch64.ad
--- a/src/hotspot/cpu/aarch64/aarch64.ad	Wed Apr 08 08:57:07 2020 -0400
+++ b/src/hotspot/cpu/aarch64/aarch64.ad	Wed Apr 08 09:03:18 2020 -0400
@@ -3160,7 +3160,7 @@
     } else {
       relocInfo::relocType rtype = $src->constant_reloc();
       if (rtype == relocInfo::oop_type) {
-        __ movoop(dst_reg, (jobject)con, /*immediate*/true);
+        __ movoop(dst_reg, (jobject)con, /*immediate*/false);
       } else if (rtype == relocInfo::metadata_type) {
         __ mov_metadata(dst_reg, (Metadata*)con);
       } else {
diff -r cd06d732d5f0 src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp
--- a/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp	Wed Apr 08 08:57:07 2020 -0400
+++ b/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp	Wed Apr 08 09:03:18 2020 -0400
@@ -4145,7 +4145,7 @@
   if (! immediate) {
     // nmethod barriers need to be ordered with respected to oop accesses, so
     // we can't use immediate literals as that would necessitate ISBs.
-    if (BarrierSet::barrier_set()->barrier_set_nmethod() != NULL) {
+    if (0 && BarrierSet::barrier_set()->barrier_set_nmethod() != NULL) {
       adr(dst, InternalAddress(address_constant((address)obj, rspec)));
       ldr(dst, Address(dst));
     } else {
diff -r cd06d732d5f0 src/hotspot/cpu/aarch64/sharedRuntime_aarch64.cpp
--- a/src/hotspot/cpu/aarch64/sharedRuntime_aarch64.cpp	Wed Apr 08 08:57:07 2020 -0400
+++ b/src/hotspot/cpu/aarch64/sharedRuntime_aarch64.cpp	Wed Apr 08 09:03:18 2020 -0400
@@ -1676,11 +1676,10 @@

   // Pre-load a static method's oop into c_rarg1.
   if (method->is_static() && !is_critical_native) {
-
     //  load oop into a register
     __ movoop(c_rarg1,
               JNIHandles::make_local(method->method_holder()->java_mirror()),
-              /*immediate*/true);
+              /*immediate*/false);

     // Now handlize the static class mirror it's known not-null.
     __ str(c_rarg1, Address(sp, klass_offset));
diff -r cd06d732d5f0 src/hotspot/share/runtime/sharedRuntime.cpp
--- a/src/hotspot/share/runtime/sharedRuntime.cpp	Wed Apr 08 08:57:07 2020 -0400
+++ b/src/hotspot/share/runtime/sharedRuntime.cpp	Wed Apr 08 09:03:18 2020 -0400
@@ -2873,6 +2873,7 @@
       CodeBuffer buffer(buf);
       double locs_buf[20];
       buffer.insts()->initialize_shared_locs((relocInfo*)locs_buf, sizeof(locs_buf) / sizeof(relocInfo));
+      buffer.initialize_consts_size(8);
       MacroAssembler _masm(&buffer);

       // Fill in the signature array, for the calling-convention call.

-- 
Andrew Haley  (he/him)
Java Platform Lead Engineer
Red Hat UK Ltd. <https://www.redhat.com>
https://keybase.io/andrewhaley
EAC8 43EB D3EF DB98 CC77 2FAD A5CD 6035 332F A671




More information about the hotspot-gc-dev mailing list