RFR(S): 8174856: [TESTBUG] Missing DefineClass instances

Volker Simonis volker.simonis at gmail.com
Tue Feb 14 18:31:26 UTC 2017


can I please have a reviewer and sponsor for the following fix:


The runtime/Metaspace/DefineClass.java test introduced with 8173743
fails if run in '-Xcomp' mode. There are actually two problems we

- for the "defineClass" and "defineClassParallel" cases we observe
fewer instance classes than expected. This is because in -Xcomp mode
the functions get compiled and deoptimized, but because we don't
really use the defined classes, they are already removed before our
first check. This problem can be easily fixed by inserting the classes
into a global static list.

- for the "redefineClass" case, if run in -Xcomp mode, the problem is
that we get 10 different nmethods for each version of the class
redefinition, and these nmethods keep the instance classes alive, even
after their activation has been removed from the stack. The problem
can be solved by manually deoptimizing the methods and subsequent
sweeping of the code cache. Notice that this has to be done at least
three times, because during every sweep process, the nmethods first
transition from "non-entrant" to "zombie" before they are finally

Thank you and best regards,

More information about the hotspot-runtime-dev mailing list