JBR-4018 - fix zero variant compilation issues

This commit is contained in:
Vladimir Dvorak
2021-11-21 16:57:57 +01:00
committed by Vitaly Provodin
parent aedea79dfc
commit 38ab8e7648
2 changed files with 14 additions and 0 deletions

View File

@@ -63,7 +63,9 @@
#include "prims/jvmtiThreadState.inline.hpp"
#include "utilities/events.hpp"
#include "oops/constantPool.inline.hpp"
#if INCLUDE_G1GC
#include "gc/g1/g1CollectedHeap.hpp"
#endif
#include "gc/shared/dcevmSharedGC.hpp"
#include "gc/shared/scavengableNMethods.hpp"
#include "gc/shared/oopStorageSet.inline.hpp"
@@ -566,16 +568,21 @@ void VM_EnhancedRedefineClasses::doit() {
// mark such nmethod's as "scavengable".
// For now, mark all nmethod's as scavengable that are not scavengable already
if (ScavengeRootsInCode) {
#if INCLUDE_G1GC
if (UseG1GC) {
// G1 holds references to nmethods in regions based on oops values. Since oops in nmethod can be changed in ChangePointers* closures
// we unregister nmethods from G1 heap, then closures are processed (oops are changed) and finally we register nmethod to G1 again
CodeCache::nmethods_do(unregister_nmethod_g1);
} else {
#endif
CodeCache::nmethods_do(mark_as_scavengable);
#if INCLUDE_G1GC
}
#endif
}
Universe::heap()->ensure_parsability(false);
#if INCLUDE_G1GC
if (UseG1GC) {
if (log_is_enabled(Info, redefine, class, timer)) {
_timer_heap_iterate.start();
@@ -584,19 +591,24 @@ void VM_EnhancedRedefineClasses::doit() {
G1CollectedHeap::heap()->object_par_iterate(&objectClosure);
_timer_heap_iterate.stop();
} else {
#endif
if (log_is_enabled(Info, redefine, class, timer)) {
_timer_heap_iterate.start();
}
Universe::heap()->object_iterate(&objectClosure);
_timer_heap_iterate.stop();
#if INCLUDE_G1GC
}
#endif
root_oops_do(&oopClosureNoBarrier);
#if INCLUDE_G1GC
if (UseG1GC) {
// this should work also for other GCs
CodeCache::nmethods_do(register_nmethod_g1);
}
#endif
}
log_trace(redefine, class, obsolete, metadata)("After updating instances");

View File

@@ -4027,12 +4027,14 @@ jint Arguments::parse(const JavaVMInitArgs* initial_cmd_args) {
// Set object alignment values.
set_object_alignment();
#ifndef ZERO
if (FlightRecorder) {
if (AllowEnhancedClassRedefinition) {
warning("EnhancedClassRedefinition was disabled, it is not allowed in FlightRecorder.");
AllowEnhancedClassRedefinition = false;
}
}
#endif
setup_hotswap_agent();