From 0f3828dddd8d4a08677efcd15aa8dfde18540130 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20Gr=C3=B6nlund?= Date: Tue, 18 Apr 2023 16:00:40 +0000 Subject: [PATCH] 8306282: Build failure linux-arm32-open-cmp-baseline after JDK-8257967 Reviewed-by: egahlin, iklam --- src/hotspot/share/prims/jvmtiAgent.hpp | 16 ++++++------- src/hotspot/share/prims/jvmtiAgentList.cpp | 5 ---- src/hotspot/share/prims/jvmtiAgentList.hpp | 28 +++++++++++----------- 3 files changed, 22 insertions(+), 27 deletions(-) diff --git a/src/hotspot/share/prims/jvmtiAgent.hpp b/src/hotspot/share/prims/jvmtiAgent.hpp index e51c45351b0..6eb646ee2d4 100644 --- a/src/hotspot/share/prims/jvmtiAgent.hpp +++ b/src/hotspot/share/prims/jvmtiAgent.hpp @@ -58,20 +58,20 @@ class JvmtiAgent : public CHeapObj { public: JvmtiAgent(const char* name, const char* options, bool is_absolute_path, bool dynamic = false); - const char* name() const; + const char* name() const NOT_JVMTI_RETURN_(nullptr); const char* options() const; - bool is_absolute_path() const; - void* os_lib() const; + bool is_absolute_path() const NOT_JVMTI_RETURN_(false); + void* os_lib() const NOT_JVMTI_RETURN_(nullptr); void set_os_lib(void* os_lib); const char* os_lib_path() const; - void set_os_lib_path(const char* path); - bool is_static_lib() const; - void set_static_lib(); + void set_os_lib_path(const char* path) NOT_JVMTI_RETURN; + bool is_static_lib() const NOT_JVMTI_RETURN_(false); + void set_static_lib() NOT_JVMTI_RETURN; bool is_dynamic() const; bool is_xrun() const; bool is_instrument_lib() const; - bool is_loaded() const; - void set_loaded(); + bool is_loaded() const NOT_JVMTI_RETURN_(false); + void set_loaded() NOT_JVMTI_RETURN; bool is_jplis() const; bool is_jplis(JvmtiEnv* env) const; void set_jplis(const void* jplis); diff --git a/src/hotspot/share/prims/jvmtiAgentList.cpp b/src/hotspot/share/prims/jvmtiAgentList.cpp index fb46ddea661..cb8e5beb11d 100644 --- a/src/hotspot/share/prims/jvmtiAgentList.cpp +++ b/src/hotspot/share/prims/jvmtiAgentList.cpp @@ -28,7 +28,6 @@ #include "prims/jvmtiExport.hpp" #include "runtime/atomic.hpp" #include "runtime/os.inline.hpp" -#include "utilities/growableArray.hpp" JvmtiAgent* JvmtiAgentList::_list = nullptr; @@ -82,10 +81,6 @@ JvmtiAgentList::Iterator::Iterator(JvmtiAgent** list, Filter filter) : } } -JvmtiAgentList::Iterator::~Iterator() { - delete _stack; -} - bool JvmtiAgentList::Iterator::has_next() const { assert(_stack != nullptr, "invariant"); return _stack->is_nonempty(); diff --git a/src/hotspot/share/prims/jvmtiAgentList.hpp b/src/hotspot/share/prims/jvmtiAgentList.hpp index 5fc4e140887..cdb8b7722b0 100644 --- a/src/hotspot/share/prims/jvmtiAgentList.hpp +++ b/src/hotspot/share/prims/jvmtiAgentList.hpp @@ -27,9 +27,8 @@ #include "memory/allocation.hpp" #include "prims/jvmtiAgent.hpp" +#include "utilities/growableArray.hpp" -template -class GrowableArrayCHeap; class JvmtiEnv; // Maintains a single cas linked-list of JvmtiAgents. @@ -49,13 +48,14 @@ class JvmtiAgentList : AllStatic { }; GrowableArrayCHeap* _stack; const Filter _filter; + Iterator() : _stack(nullptr), _filter(ALL) {} Iterator(JvmtiAgent** list, Filter filter); JvmtiAgent* select(JvmtiAgent* agent) const; public: - bool has_next() const; - JvmtiAgent* next(); - const JvmtiAgent* next() const; - ~Iterator(); + bool has_next() const NOT_JVMTI_RETURN_(false); + JvmtiAgent* next() NOT_JVMTI_RETURN_(nullptr); + const JvmtiAgent* next() const NOT_JVMTI_RETURN_(nullptr); + ~Iterator() { delete _stack; } }; private: @@ -66,19 +66,19 @@ class JvmtiAgentList : AllStatic { static void convert_xrun_agents(); public: - static void add(JvmtiAgent* agent); - static void add(const char* name, char* options, bool absolute_path); - static void add_xrun(const char* name, char* options, bool absolute_path); + static void add(JvmtiAgent* agent) NOT_JVMTI_RETURN; + static void add(const char* name, char* options, bool absolute_path) NOT_JVMTI_RETURN; + static void add_xrun(const char* name, char* options, bool absolute_path) NOT_JVMTI_RETURN; - static void load_agents(); + static void load_agents() NOT_JVMTI_RETURN; static jint load_agent(const char* agent, const char* absParam, - const char* options, outputStream* st); - static void load_xrun_agents(); - static void unload_agents(); + const char* options, outputStream* st) NOT_JVMTI_RETURN_(0); + static void load_xrun_agents() NOT_JVMTI_RETURN; + static void unload_agents() NOT_JVMTI_RETURN; static JvmtiAgent* lookup(JvmtiEnv* env, void* f_ptr); - static Iterator agents(); + static Iterator agents() NOT_JVMTI({ Iterator it; return it; }); static Iterator java_agents(); static Iterator native_agents(); static Iterator xrun_agents();