From 8abc2c38f7637f1210afdaba0e25de314e8e5328 Mon Sep 17 00:00:00 2001 From: Alex Menkov Date: Wed, 7 Feb 2018 10:25:10 -0800 Subject: [PATCH] 8161605: The '!UseSharedSpaces' check is not need in JvmtiManageCapabilities::recompute_always_capabilities Reviewed-by: sspitsyn, mseledtsov --- make/test/JtregNativeHotspot.gmk | 2 ++ src/hotspot/share/prims/jvmtiExport.cpp | 2 -- .../share/prims/jvmtiManageCapabilities.cpp | 18 +----------------- .../share/prims/jvmtiManageCapabilities.hpp | 3 --- 4 files changed, 3 insertions(+), 22 deletions(-) diff --git a/make/test/JtregNativeHotspot.gmk b/make/test/JtregNativeHotspot.gmk index b4b4484e025..70f9884eafb 100644 --- a/make/test/JtregNativeHotspot.gmk +++ b/make/test/JtregNativeHotspot.gmk @@ -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 diff --git a/src/hotspot/share/prims/jvmtiExport.cpp b/src/hotspot/share/prims/jvmtiExport.cpp index 631ddcdabaa..458a04b880d 100644 --- a/src/hotspot/share/prims/jvmtiExport.cpp +++ b/src/hotspot/share/prims/jvmtiExport.cpp @@ -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); } diff --git a/src/hotspot/share/prims/jvmtiManageCapabilities.cpp b/src/hotspot/share/prims/jvmtiManageCapabilities.cpp index e0c3cb5c34b..f753801ae95 100644 --- a/src/hotspot/share/prims/jvmtiManageCapabilities.cpp +++ b/src/hotspot/share/prims/jvmtiManageCapabilities.cpp @@ -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; diff --git a/src/hotspot/share/prims/jvmtiManageCapabilities.hpp b/src/hotspot/share/prims/jvmtiManageCapabilities.hpp index 10205f02ff7..d1db1908370 100644 --- a/src/hotspot/share/prims/jvmtiManageCapabilities.hpp +++ b/src/hotspot/share/prims/jvmtiManageCapabilities.hpp @@ -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,