[GR-70306] Add infrastructure for Shenandoah. #12365
Open
+6,392
−30
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains 2 commits at the moment:
How to use this together with the C++ code base:
make -j16 build_debug_ur_somxandgraalrepository and checkout this branch in thegraalrepository.substratevmdirectory:cd graal/substratevmJAVA_HOMEto a compatible JDK (I usedlabsjdk-ce-latest-25+37-jvmci-b06_amd64)mx buildmx native-image -g -O0 --gc=shenandoah -H:ShenandoahDebugLevel=debug HelloWorld./helloworld# guarantee(flag != nullptr) failed: unknown option) because the Shenandoah-specific logic is missing at the moment (e.g., the C++ code doesn't know about the optionShenandoahRegionSize).Current limitations and open issues:
useCompressedReferencesinShenandoahFeature.afterRegistration(...)is currently hardcoded tofalse.--gc=shenandoahis specified, seeSubstrateShenandoahBarrierSet. Methods related to the card table and the barriers are therefore unused at the moment, seeShenandoahHeap.addressOfCardTableAddress(...),ShenandoahLibrary.preWriteBarrierStub(...), andShenandoahLibrary.postWriteBarrierStub(...). Note that Shenandoah will probably need to emit read barriers when accessing static fields (see JavaDoc onSubstrateShenandoahBarrierSet.fieldWriteBarrierType(...)).ShenandoahHeap.printGCInternalLocationInfo(...)is unimplemented at the moment. This method should print information about GC internal locations, such as the card table (seeHeapImpl.printLocationInfo(...)for an example).DumpRegionInformation.printRegion(...)is unimplemented at the moment. This method should print information about a heap region (e.g., when a fatal error occurrs).ShenandoahHeap.getHeapBaseAlignment()might need to change.@Uninterruptiblereasons inShenandoahAllocationSupportmight not be relevant for Shenandoah.ShenandoahRelatedMXBeansShenandoahImageHeapInfoandShenandoahImageHeapLayouterare rather generic at the moment, so more Shenandoah-specific logic might be needed there. Same applies to the object header, seeShenandoahObjectHeader.ShenandoahRegionType.Flagsmay need to change once you start using the image heap metadata on the C++ side (see argumentimage_heap_region_typesinsvm_gc_create(...)).Suggested first steps:
svm_gc_parse_options).svm_gc_create). For that, it will be necessary to initialize Shenandoah internal data structures so that Shenandoah knows about all the image heap regions.HelloWorldwork.System.gc()