< prev index next >

src/hotspot/share/memory/allocation.hpp

Print this page
@@ -312,12 +312,15 @@
    f(MethodData) \
    f(ConstantPool) \
    f(ConstantPoolCache) \
    f(Annotations) \
    f(MethodCounters) \
-   f(SharedClassPathEntry) \
-   f(RecordComponent)
+   f(RecordComponent) \
+   f(KlassTrainingData) \
+   f(MethodTrainingData) \
+   f(CompileTrainingData) \
+   f(SharedClassPathEntry)
  
  #define METASPACE_OBJ_TYPE_DECLARE(name) name ## Type,
  #define METASPACE_OBJ_TYPE_NAME_CASE(name) case name ## Type: return #name;
  
    enum Type {

@@ -333,10 +336,16 @@
        ShouldNotReachHere();
        return nullptr;
      }
    }
  
+   static bool is_training_data(Type type) {
+     return (type == Type::KlassTrainingDataType)  ||
+            (type == Type::MethodTrainingDataType) ||
+            (type == Type::CompileTrainingDataType);
+   }
+ 
    static MetaspaceObj::Type array_type(size_t elem_size) {
      switch (elem_size) {
      case 1: return TypeArrayU1Type;
      case 2: return TypeArrayU2Type;
      case 4: return TypeArrayU4Type;

@@ -351,10 +360,13 @@
                       Type type, JavaThread* thread) throw();
                       // can't use TRAPS from this header file.
    void* operator new(size_t size, ClassLoaderData* loader_data,
                       size_t word_size,
                       Type type) throw();
+ 
+   // HACK -- this is used for allocating training data. See JDK-8331086
+   void* operator new(size_t size, MEMFLAGS flags) throw();
    void operator delete(void* p) { ShouldNotCallThis(); }
  
    // Declare a *static* method with the same signature in any subclass of MetaspaceObj
    // that should be read-only by default. See symbol.hpp for an example. This function
    // is used by the templates in metaspaceClosure.hpp
< prev index next >