The HotSpot
Whitebox-Testing API

Volker Simonis, SAP / volker.simonis@gmail.com

CPU Information

            

            
          

CPU Information


          

Stack Information

            

            
          


          

Memory Information

            

            
          


          

Memory Information

            

            
          

Memory Information


              


              

              


              

Compiler Control

            

            
          

Compiler Control


          


          

Compiler Control

            

            
          

Compiler Control



          

Runtime

            

            
          

GC

            

            
          

VM Flags

            

            
          

Building the WhiteBox API (JDK8)

            


ls -la wb.jar
-rw-r--r-- sim 8178 Jan 10 12:12 wb.jar
]]>
            
          

Building the WhiteBox API (JDK9)

            
/configure
make build-test-lib

ls -la support/test/lib/wb.jar
-rw-r--r-- sim 52611 Jan 14 17:42 support/test/lib/wb.jar
]]>
            
          

Using the WhiteBox API - standalone


]]>
          

Using the WhiteBox API - JTREG

            

            
          

The WhiteBox API - Implementation

  • Implemented in:
    hotspot/src/share/vm/prims/whitebox.cpp.
  • WhiteBox.registerNatives() handled implicitly by:
                    
     NativeLookup::lookup_style()
        -> lookup_special_native()
    ]]>
                    
                  

    and bound to JVM_RegisterWhiteBoxMethods().
  • WhiteBox::register_methods() binds the native methods:
                    
    
                    
                  

OpenJDK Wiki

https://wiki.openjdk.java.net/display/HotSpot/The+WhiteBox+testing+API