< prev index next >

src/hotspot/share/oops/constantPool.cpp

Print this page




  34 #include "memory/allocation.inline.hpp"
  35 #include "memory/heapInspection.hpp"
  36 #include "memory/metadataFactory.hpp"
  37 #include "memory/metaspaceClosure.hpp"
  38 #include "memory/metaspaceShared.hpp"
  39 #include "memory/oopFactory.hpp"
  40 #include "memory/resourceArea.hpp"
  41 #include "oops/array.inline.hpp"
  42 #include "oops/constantPool.inline.hpp"
  43 #include "oops/cpCache.inline.hpp"
  44 #include "oops/instanceKlass.hpp"
  45 #include "oops/objArrayKlass.hpp"
  46 #include "oops/objArrayOop.inline.hpp"
  47 #include "oops/oop.inline.hpp"
  48 #include "oops/typeArrayOop.inline.hpp"
  49 #include "runtime/fieldType.hpp"
  50 #include "runtime/handles.inline.hpp"
  51 #include "runtime/init.hpp"
  52 #include "runtime/javaCalls.hpp"
  53 #include "runtime/signature.hpp"
  54 #include "runtime/vframe.hpp"
  55 #include "utilities/copy.hpp"
  56 
  57 constantTag ConstantPool::tag_at(int which) const { return (constantTag)tags()->at_acquire(which); }
  58 
  59 void ConstantPool::release_tag_at_put(int which, jbyte t) { tags()->release_at_put(which, t); }
  60 
  61 ConstantPool* ConstantPool::allocate(ClassLoaderData* loader_data, int length, TRAPS) {
  62   Array<u1>* tags = MetadataFactory::new_array<u1>(loader_data, length, 0, CHECK_NULL);
  63   int size = ConstantPool::size(length);
  64   return new (loader_data, size, MetaspaceObj::ConstantPoolType, THREAD) ConstantPool(tags);
  65 }
  66 
  67 #ifdef ASSERT
  68 
  69 // MetaspaceObj allocation invariant is calloc equivalent memory
  70 // simple verification of this here (JVM_CONSTANT_Invalid == 0 )
  71 static bool tag_array_is_zero_initialized(Array<u1>* tags) {
  72   assert(tags != NULL, "invariant");
  73   const int length = tags->length();
  74   for (int index = 0; index < length; ++index) {




  34 #include "memory/allocation.inline.hpp"
  35 #include "memory/heapInspection.hpp"
  36 #include "memory/metadataFactory.hpp"
  37 #include "memory/metaspaceClosure.hpp"
  38 #include "memory/metaspaceShared.hpp"
  39 #include "memory/oopFactory.hpp"
  40 #include "memory/resourceArea.hpp"
  41 #include "oops/array.inline.hpp"
  42 #include "oops/constantPool.inline.hpp"
  43 #include "oops/cpCache.inline.hpp"
  44 #include "oops/instanceKlass.hpp"
  45 #include "oops/objArrayKlass.hpp"
  46 #include "oops/objArrayOop.inline.hpp"
  47 #include "oops/oop.inline.hpp"
  48 #include "oops/typeArrayOop.inline.hpp"
  49 #include "runtime/fieldType.hpp"
  50 #include "runtime/handles.inline.hpp"
  51 #include "runtime/init.hpp"
  52 #include "runtime/javaCalls.hpp"
  53 #include "runtime/signature.hpp"
  54 #include "runtime/vframe.inline.hpp"
  55 #include "utilities/copy.hpp"
  56 
  57 constantTag ConstantPool::tag_at(int which) const { return (constantTag)tags()->at_acquire(which); }
  58 
  59 void ConstantPool::release_tag_at_put(int which, jbyte t) { tags()->release_at_put(which, t); }
  60 
  61 ConstantPool* ConstantPool::allocate(ClassLoaderData* loader_data, int length, TRAPS) {
  62   Array<u1>* tags = MetadataFactory::new_array<u1>(loader_data, length, 0, CHECK_NULL);
  63   int size = ConstantPool::size(length);
  64   return new (loader_data, size, MetaspaceObj::ConstantPoolType, THREAD) ConstantPool(tags);
  65 }
  66 
  67 #ifdef ASSERT
  68 
  69 // MetaspaceObj allocation invariant is calloc equivalent memory
  70 // simple verification of this here (JVM_CONSTANT_Invalid == 0 )
  71 static bool tag_array_is_zero_initialized(Array<u1>* tags) {
  72   assert(tags != NULL, "invariant");
  73   const int length = tags->length();
  74   for (int index = 0; index < length; ++index) {


< prev index next >