< prev index next >

src/hotspot/share/classfile/systemDictionaryShared.cpp

Print this page
rev 50331 : 8198285: More consistent Access API for arraycopy
rev 50332 : [mq]: JDK-8203232-2.patch
rev 50333 : [mq]: JDK-8198285-3.patch


  70 
  71 oop SystemDictionaryShared::shared_jar_manifest(int index) {
  72   return _shared_jar_manifests->obj_at(index);
  73 }
  74 
  75 
  76 Handle SystemDictionaryShared::get_shared_jar_manifest(int shared_path_index, TRAPS) {
  77   Handle manifest ;
  78   if (shared_jar_manifest(shared_path_index) == NULL) {
  79     SharedClassPathEntry* ent = FileMapInfo::shared_path(shared_path_index);
  80     long size = ent->manifest_size();
  81     if (size <= 0) {
  82       return Handle();
  83     }
  84 
  85     // ByteArrayInputStream bais = new ByteArrayInputStream(buf);
  86     const char* src = ent->manifest();
  87     assert(src != NULL, "No Manifest data");
  88     typeArrayOop buf = oopFactory::new_byteArray(size, CHECK_NH);
  89     typeArrayHandle bufhandle(THREAD, buf);
  90     ArrayAccess<>::arraycopy_from_native<jbyte>(reinterpret_cast<const jbyte*>(src),
  91                                                 buf, typeArrayOopDesc::element_offset<jbyte>(0), size);
  92 
  93     Handle bais = JavaCalls::construct_new_instance(SystemDictionary::ByteArrayInputStream_klass(),
  94                       vmSymbols::byte_array_void_signature(),
  95                       bufhandle, CHECK_NH);
  96 
  97     // manifest = new Manifest(bais)
  98     manifest = JavaCalls::construct_new_instance(SystemDictionary::Jar_Manifest_klass(),
  99                       vmSymbols::input_stream_void_signature(),
 100                       bais, CHECK_NH);
 101     atomic_set_shared_jar_manifest(shared_path_index, manifest());
 102   }
 103 
 104   manifest = Handle(THREAD, shared_jar_manifest(shared_path_index));
 105   assert(manifest.not_null(), "sanity");
 106   return manifest;
 107 }
 108 
 109 Handle SystemDictionaryShared::get_shared_jar_url(int shared_path_index, TRAPS) {
 110   Handle url_h;




  70 
  71 oop SystemDictionaryShared::shared_jar_manifest(int index) {
  72   return _shared_jar_manifests->obj_at(index);
  73 }
  74 
  75 
  76 Handle SystemDictionaryShared::get_shared_jar_manifest(int shared_path_index, TRAPS) {
  77   Handle manifest ;
  78   if (shared_jar_manifest(shared_path_index) == NULL) {
  79     SharedClassPathEntry* ent = FileMapInfo::shared_path(shared_path_index);
  80     long size = ent->manifest_size();
  81     if (size <= 0) {
  82       return Handle();
  83     }
  84 
  85     // ByteArrayInputStream bais = new ByteArrayInputStream(buf);
  86     const char* src = ent->manifest();
  87     assert(src != NULL, "No Manifest data");
  88     typeArrayOop buf = oopFactory::new_byteArray(size, CHECK_NH);
  89     typeArrayHandle bufhandle(THREAD, buf);
  90     ArrayAccess<>::arraycopy_from_native<>(reinterpret_cast<const jbyte*>(src),
  91                                            buf, typeArrayOopDesc::element_offset<jbyte>(0), size);
  92 
  93     Handle bais = JavaCalls::construct_new_instance(SystemDictionary::ByteArrayInputStream_klass(),
  94                       vmSymbols::byte_array_void_signature(),
  95                       bufhandle, CHECK_NH);
  96 
  97     // manifest = new Manifest(bais)
  98     manifest = JavaCalls::construct_new_instance(SystemDictionary::Jar_Manifest_klass(),
  99                       vmSymbols::input_stream_void_signature(),
 100                       bais, CHECK_NH);
 101     atomic_set_shared_jar_manifest(shared_path_index, manifest());
 102   }
 103 
 104   manifest = Handle(THREAD, shared_jar_manifest(shared_path_index));
 105   assert(manifest.not_null(), "sanity");
 106   return manifest;
 107 }
 108 
 109 Handle SystemDictionaryShared::get_shared_jar_url(int shared_path_index, TRAPS) {
 110   Handle url_h;


< prev index next >