8176887: AOT: SIGSEGV in AOTCodeHeap::next when using specific configuration
Summary: Derive MethodCounters from Metadata
Reviewed-by: kvn, coleenp
--- a/hotspot/src/share/vm/oops/metadata.hpp Sat Apr 08 02:40:47 2017 +0000
+++ b/hotspot/src/share/vm/oops/metadata.hpp Tue Apr 11 11:34:20 2017 -0700
@@ -47,6 +47,7 @@
virtual bool is_method() const volatile { return false; }
virtual bool is_methodData() const volatile { return false; }
virtual bool is_constantPool() const volatile { return false; }
+ virtual bool is_methodCounters() const volatile { return false; }
virtual const char* internal_name() const = 0;
--- a/hotspot/src/share/vm/oops/methodCounters.cpp Sat Apr 08 02:40:47 2017 +0000
+++ b/hotspot/src/share/vm/oops/methodCounters.cpp Tue Apr 11 11:34:20 2017 -0700
@@ -73,3 +73,11 @@
#endif
}
+
+void MethodCounters::print_value_on(outputStream* st) const {
+ assert(is_methodCounters(), "must be methodCounters");
+ st->print("method counters");
+ print_address_on(st);
+}
+
+
--- a/hotspot/src/share/vm/oops/methodCounters.hpp Sat Apr 08 02:40:47 2017 +0000
+++ b/hotspot/src/share/vm/oops/methodCounters.hpp Tue Apr 11 11:34:20 2017 -0700
@@ -30,7 +30,7 @@
#include "interpreter/invocationCounter.hpp"
#include "runtime/arguments.hpp"
-class MethodCounters: public MetaspaceObj {
+class MethodCounters : public Metadata {
friend class VMStructs;
friend class JVMCIVMStructs;
private:
@@ -109,10 +109,11 @@
}
public:
+ virtual bool is_methodCounters() const volatile { return true; }
+
static MethodCounters* allocate(methodHandle mh, TRAPS);
void deallocate_contents(ClassLoaderData* loader_data) {}
- DEBUG_ONLY(bool on_stack() { return false; }) // for template
AOT_ONLY(Method* method() const { return _method; })
@@ -120,8 +121,6 @@
return align_size_up(sizeof(MethodCounters), wordSize) / wordSize;
}
- bool is_klass() const { return false; }
-
void clear_counters();
#if defined(COMPILER2) || INCLUDE_JVMCI
@@ -253,5 +252,9 @@
static ByteSize backedge_mask_offset() {
return byte_offset_of(MethodCounters, _backedge_mask);
}
+
+ virtual const char* internal_name() const { return "{method counters}"; }
+ virtual void print_value_on(outputStream* st) const;
+
};
#endif //SHARE_VM_OOPS_METHODCOUNTERS_HPP