On Mon, 12 Sep 2022 20:23:09 GMT, Alex Menkov <amen...@openjdk.org> wrote:
>> test/hotspot/jtreg/serviceability/jvmti/RedefineClasses/RedefineRetransform/RedefineRetransform.java >> line 240: >> >>> 238: case 5: >>> 239: test("Redefine-Retransform-Redefine-Retransform with >>> CFLH", () -> { >>> 240: redefine(1, 5); // CFLH sets cached class bytes to >>> ver 1 >> >> I'm having trouble understanding why the CFLH version is '5' here. >> Update: I _think_ this is just to have the CFLH return a different version >> of the class bytes before the RedefineClasses() call does its work. I >> don't understand why you want to do this... > > Test cases 1-4 are from the bug description. > I added test cases 5 & 6 to verify additional code paths - they are the same > as 3 & 4, but in RedefineClasses we provide new class bytes in CFLH. > I.e. in cases 3 and 4 after RedefineClasses classes have no cached bytes and > class bytes are reconstituted in the subsequent Retransform; > In case 5 and 6 cache_bytes buffer is created during RedefineClasses, > RetransformClasses use existing cache. Thanks for the explanation. >> test/hotspot/jtreg/serviceability/jvmti/RedefineClasses/RedefineRetransform/libRedefineRetransform.cpp >> line 48: >> >>> 46: } >>> 47: >>> 48: class ClassFileLoadHookHelper { >> >> A short comment describing the purpose of the `ClassFileLoadHookHelper` would >> be helpful to folks that only have a high level understanding of >> RedefineClasses() >> and RetransformClasses(). >> >> You did a very good job encapsulating support for a complicated sets of APIs >> into this helper. > > Added short description Thanks. ------------- PR: https://git.openjdk.org/jdk/pull/10032