Changes to core hotspot for Shenandoah

Christine Flood chf at redhat.com
Fri Nov 11 16:33:56 UTC 2016


The changes to the hotspot code base to facilite concurrent compaction include:

Adding Read and Write Barriers to all accesses to the java heap both in interpreted/compiled code and in runtime code.  The read barriers simply indirect through the indirection pointer.  The write barriers check a thread local evacuation_in_progress flag and if it's set then they copy the object and then perform the write on the new copy.

Adding new versions of object equality testing both in the vm and in generated code such as acmp and cas which will perform the appropriate barriers.

We've refactored some code in G1 to be used by both G1 and Shenandoah including:
   CMBitmaps
   SATB mark queues
   String symbol table unlink task
   Code cache unloading task
   Parallel Cleaning Task

We've added code for pinning objects which are being actively accessed by jni critical regions.

We've added Shenandoah specific code to collectedheap for allocating and initializing the brooks pointers.  For compiled code this is in compile_prepare_oop which is definied in architecture specific shenandoahBarrierSet files.

We've added an additional gcCause _last_ditch_collection.

We've had to add code for handling a potentially forwarded pendingListLock in referenceProcessor.hpp/cpp.

We've added specialized_oop_closures for Shenandoah.

We've changed thread local allocation buffers to have tlabs and gclabs which are both needed during a concurrent evacuation phase.

There are several places where we need to add another GC to a case statement if !(UseG1GC || UseShenandoahGC) .

Here's an example of an added write barrier:
void float_at_put(int which, jfloat contents)   { *float_at_addr(which) = contents; }
becomes:
void float_at_put(int which, jfloat contents)   {
   typeArrayOop p = typeArrayOop(oopDesc::bs()->write_barrier(this));
   *p->float_at_addr(which) = contents;
 }

We've added many Shenandoah specific asserts which will not affect non-shenandoah code.

We've added specific macro nodes to C2 hotspot/src/share/vm/opto:
(ShenandoahReadBarrier, ShenandoahWriteBarrier, ShenandoahWBMemProj).

Added Shenandoah specific code to opto/compile.cpp for brooks pointers to flatten_alias_type.

Added code to opto/escape.cpp to implement pass through on Shenandoah Barrier nodes.

Added code to optimize final accesses (which can elide read barriers) to opto/graphKit.cpp

Added Writebarriers on locking, storing string values, ... in opto/graphKit.cpp

Added Casts to not null, which are required by shenandoah barriers.

Added code to optimize Shenandoah loops to loopnode.hpp

Added code for shenandoah_optimize_java_mirror_cmp to subnode.hpp.

Added code for pinning objects in jni critical regions in prims/jni.cpp.

Added Shenandoah specific implementations of Unsafe_CompareAndExchangeObject and Unsafe_CompareAndSwapObject to prims/unsafe.cpp.
We first check if the current value is the expected value and if they disagree then we perform read barriers on current and expected and do the check again.

Added Shenandoah specific runtime flags to command line flags.

Added bool is_stable() accessor for access flags in runtime/fieldDescriptor.hpp.

Added Shenandoah specific locks in runtime/mutexLocker.cpp

Added shenandoah_clone_barrier to ensure that references point to to-space in cloned objects in runtime/sharedRuntime.cpp

Added Shenandoah specific fields to runtime/thread.cpp for Shenandoah:
       evacuation_in_progress
        _gclab
         _allocated_bytes_gclab


Added Shenandoah vm_operations to runtime/vmoperations.cpp

Added c2 nodes for Shenandoah barriers to runtime/vmstructs.cpp.

Added Shenandoah memory managers to services/*





More information about the shenandoah-dev mailing list