8240267: VM fails to start with CDS enabled but JVMTI disabled

Reviewed-by: dholmes
This commit is contained in:
Ioi Lam 2020-03-01 17:36:03 -08:00
parent 742bdf003e
commit 0532bd23cd
2 changed files with 5 additions and 5 deletions

View File

@ -4782,9 +4782,9 @@ void JavaClasses::compute_hard_coded_offsets() {
// Compute non-hard-coded field offsets of all the classes in this file
void JavaClasses::compute_offsets() {
if (UseSharedSpaces) {
assert(JvmtiExport::is_early_phase() && !(JvmtiExport::should_post_class_file_load_hook() &&
JvmtiExport::has_early_class_hook_env()),
"JavaClasses::compute_offsets() must be called in early JVMTI phase.");
JVMTI_ONLY(assert(JvmtiExport::is_early_phase() && !(JvmtiExport::should_post_class_file_load_hook() &&
JvmtiExport::has_early_class_hook_env()),
"JavaClasses::compute_offsets() must be called in early JVMTI phase."));
// None of the classes used by the rest of this function can be replaced by
// JMVTI ClassFileLoadHook.
// We are safe to use the archived offsets, which have already been restored

View File

@ -2070,8 +2070,8 @@ void SystemDictionary::resolve_well_known_classes(TRAPS) {
#ifdef ASSERT
if (UseSharedSpaces) {
assert(JvmtiExport::is_early_phase(),
"All well known classes must be resolved in JVMTI early phase");
JVMTI_ONLY(assert(JvmtiExport::is_early_phase(),
"All well known classes must be resolved in JVMTI early phase"));
for (int i = FIRST_WKID; i < last; i++) {
InstanceKlass* k = _well_known_klasses[i];
assert(k->is_shared(), "must not be replaced by JVMTI class file load hook");