8298162: Test PrintClasses hits assert when run with code that retransform classes
Reviewed-by: dholmes, mgronlun
This commit is contained in:
parent
03d992728e
commit
03afec16f8
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -102,7 +102,9 @@ void fieldDescriptor::reinitialize(InstanceKlass* ik, int index) {
|
|||||||
if (_cp.is_null() || field_holder() != ik) {
|
if (_cp.is_null() || field_holder() != ik) {
|
||||||
_cp = constantPoolHandle(Thread::current(), ik->constants());
|
_cp = constantPoolHandle(Thread::current(), ik->constants());
|
||||||
// _cp should now reference ik's constant pool; i.e., ik is now field_holder.
|
// _cp should now reference ik's constant pool; i.e., ik is now field_holder.
|
||||||
assert(field_holder() == ik, "must be already initialized to this class");
|
// If the class is a scratch class, the constant pool points to the original class,
|
||||||
|
// but that's ok because of constant pool merging.
|
||||||
|
assert(field_holder() == ik || ik->is_scratch_class(), "must be already initialized to this class");
|
||||||
}
|
}
|
||||||
FieldInfo* f = ik->field(index);
|
FieldInfo* f = ik->field(index);
|
||||||
_access_flags = accessFlags_from(f->access_flags());
|
_access_flags = accessFlags_from(f->access_flags());
|
||||||
|
@ -30,6 +30,15 @@
|
|||||||
* @run main/othervm PrintClasses
|
* @run main/othervm PrintClasses
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @test
|
||||||
|
* @bug 8298162
|
||||||
|
* @summary Test jcmd VM.classes with JFR
|
||||||
|
* @requires vm.hasJFR
|
||||||
|
* @library /test/lib
|
||||||
|
* @run main/othervm -XX:StartFlightRecording PrintClasses
|
||||||
|
*/
|
||||||
|
|
||||||
import jdk.test.lib.process.OutputAnalyzer;
|
import jdk.test.lib.process.OutputAnalyzer;
|
||||||
import jdk.test.lib.JDKToolFinder;
|
import jdk.test.lib.JDKToolFinder;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user