< prev index next >

src/hotspot/share/classfile/systemDictionaryShared.cpp

erik arraycopy

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

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