[8u] Fix Shenandoah bindings in ADLC formssel

Roman Kennke rkennke at redhat.com
Thu Feb 18 12:04:15 UTC 2021


Looks good to me!

Roman


> Hi,
> 
> While reading the sh/jdk8 difference against upstream, I realized that 
> formssel.cpp changes are stale. We need to drop ShenandoahReadBarrier 
> mentions, since there so no such node at all.
> 
> InstructForm::captures_bottom_type does have 
> ShenandoahCompareAndExchangeP/N in later JDKs, but no such nodes are 
> available in 8u. So I just dropped the unnecessary test.
> 
> MatchNode::needs_ideal_memory_edge needs ShenandoahCompareAndSwapN/P 
> nodes, like all other JDK versions do. Actually, later JDK revisions add 
> *Weak* and *CompareAndExchange* variants, but for 8u only CompareAndSwap 
> are needed.
> 
> 8u patch:
> 
> diff -r 25688d338e24 src/share/vm/adlc/formssel.cpp
> --- a/src/share/vm/adlc/formssel.cpp    Wed Feb 17 17:39:25 2021 +0100
> +++ b/src/share/vm/adlc/formssel.cpp    Thu Feb 18 12:27:37 2021 +0100
> @@ -765,12 +765,11 @@
>           !strcmp(_matrule->_rChild->_opType,"LoadN")        ||
>           !strcmp(_matrule->_rChild->_opType,"LoadNKlass")   ||
>           !strcmp(_matrule->_rChild->_opType,"CreateEx")     ||  // type 
> of exception
>           !strcmp(_matrule->_rChild->_opType,"CheckCastPP")  ||
>           !strcmp(_matrule->_rChild->_opType,"GetAndSetP")   ||
> -        !strcmp(_matrule->_rChild->_opType,"GetAndSetN")   ||
> -        !strcmp(_matrule->_rChild->_opType,"ShenandoahReadBarrier"))) 
> return true;
> +        !strcmp(_matrule->_rChild->_opType,"GetAndSetN")) )  return true;
>     else if ( is_ideal_load() == Form::idealP )                return true;
>     else if ( is_ideal_store() != Form::none  )                return true;
> 
>     if (needs_base_oop_edge(globals)) return true;
> 
> @@ -3473,15 +3472,15 @@
>       "StoreVector", "LoadVector",
>       "LoadRange", "LoadKlass", "LoadNKlass", "LoadL_unaligned", 
> "LoadD_unaligned",
>       "LoadPLocked",
>       "StorePConditional", "StoreIConditional", "StoreLConditional",
>       "CompareAndSwapI", "CompareAndSwapL", "CompareAndSwapP", 
> "CompareAndSwapN",
> +    "ShenandoahCompareAndSwapN", "ShenandoahCompareAndSwapP",
>       "StoreCM",
>       "ClearArray",
>       "GetAndAddI", "GetAndSetI", "GetAndSetP",
>       "GetAndAddL", "GetAndSetL", "GetAndSetN",
> -    "ShenandoahReadBarrier",
>     };
>     int cnt = sizeof(needs_ideal_memory_list)/sizeof(char*);
>     if( strcmp(_opType,"PrefetchRead")==0 ||
>         strcmp(_opType,"PrefetchWrite")==0 ||
>         strcmp(_opType,"PrefetchAllocation")==0 )
> 
> 
> Testing: hotspot_gc_shenandoah {fastdebug,release}
> 



More information about the shenandoah-dev mailing list