--- a/src/hotspot/share/code/nmethod.cpp Tue Mar 12 15:42:32 2019 +0100
+++ b/src/hotspot/share/code/nmethod.cpp Thu Mar 14 09:08:17 2019 +0100
@@ -611,10 +611,10 @@
code_buffer->copy_values_to(this);
clear_unloading_state();
- if (ScavengeRootsInCode) {
- Universe::heap()->register_nmethod(this);
- }
+
+ Universe::heap()->register_nmethod(this);
debug_only(Universe::heap()->verify_nmethod(this));
+
CodeCache::commit(this);
}
@@ -771,9 +771,8 @@
debug_info->copy_to(this);
dependencies->copy_to(this);
clear_unloading_state();
- if (ScavengeRootsInCode) {
- Universe::heap()->register_nmethod(this);
- }
+
+ Universe::heap()->register_nmethod(this);
debug_only(Universe::heap()->verify_nmethod(this));
CodeCache::commit(this);