8161605: The '!UseSharedSpaces' check is not need in JvmtiManageCapabilities::recompute_always_capabilities

Reviewed-by: sspitsyn, mseledtsov
This commit is contained in:
Alex Menkov 2018-02-07 10:25:10 -08:00
parent 60f417575e
commit 8abc2c38f7
4 changed files with 3 additions and 22 deletions

View File

@ -67,6 +67,7 @@ BUILD_HOTSPOT_JTREG_NATIVE_SRC += \
$(TOPDIR)/test/hotspot/jtreg/compiler/calls \
$(TOPDIR)/test/hotspot/jtreg/compiler/runtime/criticalnatives/lookup \
$(TOPDIR)/test/hotspot/jtreg/compiler/runtime/criticalnatives/argumentcorruption \
$(TOPDIR)/test/hotspot/jtreg/serviceability/jvmti/CanGenerateAllClassHook \
$(TOPDIR)/test/hotspot/jtreg/serviceability/jvmti/GetOwnedMonitorInfo \
$(TOPDIR)/test/hotspot/jtreg/serviceability/jvmti/GetOwnedMonitorStackDepthInfo \
$(TOPDIR)/test/hotspot/jtreg/serviceability/jvmti/GetNamedModule \
@ -101,6 +102,7 @@ endif
ifeq ($(TOOLCHAIN_TYPE), solstudio)
BUILD_HOTSPOT_JTREG_LIBRARIES_LIBS_liboverflow := -lc
BUILD_HOTSPOT_JTREG_LIBRARIES_LIBS_libSimpleClassFileLoadHook := -lc
BUILD_HOTSPOT_JTREG_LIBRARIES_LIBS_libCanGenerateAllClassHook := -lc
BUILD_HOTSPOT_JTREG_LIBRARIES_LIBS_libGetOwnedMonitorInfoTest := -lc
BUILD_HOTSPOT_JTREG_LIBRARIES_LIBS_libGetOwnedMonitorStackDepthInfoTest := -lc
BUILD_HOTSPOT_JTREG_LIBRARIES_LIBS_libGetNamedModuleTest := -lc

View File

@ -597,12 +597,10 @@ void JvmtiExport::enter_primordial_phase() {
}
void JvmtiExport::enter_early_start_phase() {
JvmtiManageCapabilities::recompute_always_capabilities();
set_early_vmstart_recorded(true);
}
void JvmtiExport::enter_start_phase() {
JvmtiManageCapabilities::recompute_always_capabilities();
JvmtiEnvBase::set_phase(JVMTI_PHASE_START);
}

View File

@ -57,9 +57,6 @@ jvmtiCapabilities JvmtiManageCapabilities::acquired_capabilities;
void JvmtiManageCapabilities::initialize() {
always_capabilities = init_always_capabilities();
if (JvmtiEnv::get_phase() != JVMTI_PHASE_ONLOAD) {
recompute_always_capabilities();
}
onload_capabilities = init_onload_capabilities();
always_solo_capabilities = init_always_solo_capabilities();
onload_solo_capabilities = init_onload_solo_capabilities();
@ -68,19 +65,6 @@ void JvmtiManageCapabilities::initialize() {
memset(&acquired_capabilities, 0, sizeof(acquired_capabilities));
}
// if the capability sets are initialized in the onload phase then
// it happens before class data sharing (CDS) is initialized. If it
// turns out that CDS gets disabled then we must adjust the always
// capabilities. To ensure a consistent view of the capabililties
// anything we add here should already be in the onload set.
void JvmtiManageCapabilities::recompute_always_capabilities() {
if (!UseSharedSpaces) {
jvmtiCapabilities jc = always_capabilities;
jc.can_generate_all_class_hook_events = 1;
always_capabilities = jc;
}
}
// corresponding init functions
jvmtiCapabilities JvmtiManageCapabilities::init_always_capabilities() {
@ -94,6 +78,7 @@ jvmtiCapabilities JvmtiManageCapabilities::init_always_capabilities() {
jc.can_get_synthetic_attribute = 1;
jc.can_get_monitor_info = 1;
jc.can_get_constant_pool = 1;
jc.can_generate_all_class_hook_events = 1;
jc.can_generate_monitor_events = 1;
jc.can_generate_garbage_collection_events = 1;
jc.can_generate_compiled_method_load_events = 1;
@ -126,7 +111,6 @@ jvmtiCapabilities JvmtiManageCapabilities::init_onload_capabilities() {
jc.can_get_source_debug_extension = 1;
jc.can_access_local_variables = 1;
jc.can_maintain_original_method_order = 1;
jc.can_generate_all_class_hook_events = 1;
jc.can_generate_single_step_events = 1;
jc.can_generate_exception_events = 1;
jc.can_generate_frame_pop_events = 1;

View File

@ -64,9 +64,6 @@ private:
public:
static void initialize();
// may have to adjust always capabilities when VM initialization has completed
static void recompute_always_capabilities();
// queries and actions
static void get_potential_capabilities(const jvmtiCapabilities *current,
const jvmtiCapabilities *prohibited,