RFR(M) : 8059624 : Test task: WhiteBox API for testing segmented codecache feature

Tobias Hartmann tobias.hartmann at oracle.com
Thu Nov 6 09:11:04 UTC 2014

Hi Igor,

looks good (not a reviewer). In addition to Vladimir's comments:

'WhiteBox::allocateCodeHeap' should be 'allocate_code_heap'. I think the name is
a bit misleading since we don't allocate a CodeHeap but a CodeBlob in a
CodeHeap. Maybe use 'code_heap_allocate' or 'allocate_code_blob'. Same for

In 'BlobType::getAvailable' you always return the NonProfiledCodeHeap if
CodeCacheSegmentation is enabled. But if we only use the interpreter (-Xint), we
don't have any method code heaps. Also with 'TieredStopAtLevel <=
CompLevel_simple' we don't need the ProfiledCodeHeap (see
'CodeCache::heap_available'). The corresponding tests will hit the "heap is
null" assert in 'CodeCache::allocate'.


On 05.11.2014 17:25, Igor Ignatyev wrote:
> http://cr.openjdk.java.net/~iignatyev/8059624/webrev.00/
> 660 lines changed: 624 ins; 2 del; 34 mod;
> Hi all,
> please review the patch which adds new WhiteBox methods needed for better
> testing SegmentedCodeCache:
>  - perform allocation in code cache
>  - force code cache sweep
>  - lock/unlock compilation
>  - get a segment id for nmethod.
> besides these methods, the patch also adds a method to get all entries in code
> heap.
> changes in product code:
>  - monitor 'Compilation_lock' was added to implement compilation locking/unlocking
>  - align_code_offset function was made a static member of CodeBlob
>  - WhiteBox was made a friend of several classes
> testing: jprt, new added tests
> jbs: https://bugs.openjdk.java.net/browse/JDK-8059624

More information about the hotspot-compiler-dev mailing list