< prev index next >

src/hotspot/share/oops/objArrayKlass.hpp

Print this page
rev 49674 : 8198285: More consistent Access API for arraycopy


  70   int oop_size(oop obj) const;
  71 
  72   // Allocation
  73   static Klass* allocate_objArray_klass(ClassLoaderData* loader_data,
  74                                           int n, Klass* element_klass, TRAPS);
  75 
  76   objArrayOop allocate(int length, TRAPS);
  77   oop multi_allocate(int rank, jint* sizes, TRAPS);
  78 
  79   // Copying
  80   void  copy_array(arrayOop s, int src_pos, arrayOop d, int dst_pos, int length, TRAPS);
  81 
  82   // Compute protection domain
  83   oop protection_domain() const { return bottom_klass()->protection_domain(); }
  84 
  85   virtual void metaspace_pointers_do(MetaspaceClosure* iter);
  86 
  87  private:
  88   // Either oop or narrowOop depending on UseCompressedOops.
  89   // must be called from within ObjArrayKlass.cpp
  90   template <class T> void do_copy(arrayOop s, T* src, arrayOop d,
  91                                   T* dst, int length, TRAPS);

  92  protected:
  93   // Returns the ObjArrayKlass for n'th dimension.
  94   virtual Klass* array_klass_impl(bool or_null, int n, TRAPS);
  95 
  96   // Returns the array class with this class as element type.
  97   virtual Klass* array_klass_impl(bool or_null, TRAPS);
  98 
  99  public:
 100 
 101   static ObjArrayKlass* cast(Klass* k) {
 102     return const_cast<ObjArrayKlass*>(cast(const_cast<const Klass*>(k)));
 103   }
 104 
 105   static const ObjArrayKlass* cast(const Klass* k) {
 106     assert(k->is_objArray_klass(), "cast to ObjArrayKlass");
 107     return static_cast<const ObjArrayKlass*>(k);
 108   }
 109 
 110   // Sizing
 111   static int header_size()                { return sizeof(ObjArrayKlass)/wordSize; }




  70   int oop_size(oop obj) const;
  71 
  72   // Allocation
  73   static Klass* allocate_objArray_klass(ClassLoaderData* loader_data,
  74                                           int n, Klass* element_klass, TRAPS);
  75 
  76   objArrayOop allocate(int length, TRAPS);
  77   oop multi_allocate(int rank, jint* sizes, TRAPS);
  78 
  79   // Copying
  80   void  copy_array(arrayOop s, int src_pos, arrayOop d, int dst_pos, int length, TRAPS);
  81 
  82   // Compute protection domain
  83   oop protection_domain() const { return bottom_klass()->protection_domain(); }
  84 
  85   virtual void metaspace_pointers_do(MetaspaceClosure* iter);
  86 
  87  private:
  88   // Either oop or narrowOop depending on UseCompressedOops.
  89   // must be called from within ObjArrayKlass.cpp
  90   template <class T> void do_copy(arrayOop s, size_t src_offset,
  91                                   arrayOop d, size_t dst_offset,
  92                                   int length, TRAPS);
  93  protected:
  94   // Returns the ObjArrayKlass for n'th dimension.
  95   virtual Klass* array_klass_impl(bool or_null, int n, TRAPS);
  96 
  97   // Returns the array class with this class as element type.
  98   virtual Klass* array_klass_impl(bool or_null, TRAPS);
  99 
 100  public:
 101 
 102   static ObjArrayKlass* cast(Klass* k) {
 103     return const_cast<ObjArrayKlass*>(cast(const_cast<const Klass*>(k)));
 104   }
 105 
 106   static const ObjArrayKlass* cast(const Klass* k) {
 107     assert(k->is_objArray_klass(), "cast to ObjArrayKlass");
 108     return static_cast<const ObjArrayKlass*>(k);
 109   }
 110 
 111   // Sizing
 112   static int header_size()                { return sizeof(ObjArrayKlass)/wordSize; }


< prev index next >