155 void add_verification_constraint(Symbol* name,
156 Symbol* from_name, bool from_field_is_protected, bool from_is_array, bool from_is_object);
157 int finalize_verification_constraints();
158 void check_verification_constraints(InstanceKlass* klass, TRAPS);
159 void metaspace_pointers_do(MetaspaceClosure* it) NOT_CDS_RETURN;
160 };
161
162 class SharedDictionary : public Dictionary {
163 SharedDictionaryEntry* get_entry_for_builtin_loader(const Symbol* name) const;
164 SharedDictionaryEntry* get_entry_for_unregistered_loader(const Symbol* name,
165 int clsfile_size,
166 int clsfile_crc32) const;
167
168 // Convenience functions
169 SharedDictionaryEntry* bucket(int index) const {
170 return (SharedDictionaryEntry*)(Dictionary::bucket(index));
171 }
172
173 public:
174 SharedDictionaryEntry* find_entry_for(InstanceKlass* klass);
175 void finalize_verification_constraints();
176
177 bool add_non_builtin_klass(const Symbol* class_name,
178 ClassLoaderData* loader_data,
179 InstanceKlass* obj);
180
181 void update_entry(InstanceKlass* klass, int id);
182
183 InstanceKlass* find_class_for_builtin_loader(const Symbol* name) const;
184 InstanceKlass* find_class_for_unregistered_loader(const Symbol* name,
185 int clsfile_size,
186 int clsfile_crc32) const;
187 bool class_exists_for_unregistered_loader(const Symbol* name) {
188 return (get_entry_for_unregistered_loader(name, -1, -1) != NULL);
189 }
190 };
191
192 class SystemDictionaryShared: public SystemDictionary {
193 private:
194 // These _shared_xxxs arrays are used to initialize the java.lang.Package and
195 // java.security.ProtectionDomain objects associated with each shared class.
350
351 static void set_shared_class_misc_info(InstanceKlass* k, ClassFileStream* cfs);
352
353 static InstanceKlass* lookup_from_stream(const Symbol* class_name,
354 Handle class_loader,
355 Handle protection_domain,
356 const ClassFileStream* st,
357 TRAPS);
358 // "verification_constraints" are a set of checks performed by
359 // VerificationType::is_reference_assignable_from when verifying a shared class during
360 // dump time.
361 //
362 // With AppCDS, it is possible to override archived classes by calling
363 // ClassLoader.defineClass() directly. SystemDictionary::load_shared_class() already
364 // ensures that you cannot load a shared class if its super type(s) are changed. However,
365 // we need an additional check to ensure that the verification_constraints did not change
366 // between dump time and runtime.
367 static bool add_verification_constraint(InstanceKlass* k, Symbol* name,
368 Symbol* from_name, bool from_field_is_protected,
369 bool from_is_array, bool from_is_object) NOT_CDS_RETURN_(false);
370 static void finalize_verification_constraints() NOT_CDS_RETURN;
371 static void check_verification_constraints(InstanceKlass* klass,
372 TRAPS) NOT_CDS_RETURN;
373 };
374
375 #endif // SHARE_VM_CLASSFILE_SYSTEMDICTIONARYSHARED_HPP
|
155 void add_verification_constraint(Symbol* name,
156 Symbol* from_name, bool from_field_is_protected, bool from_is_array, bool from_is_object);
157 int finalize_verification_constraints();
158 void check_verification_constraints(InstanceKlass* klass, TRAPS);
159 void metaspace_pointers_do(MetaspaceClosure* it) NOT_CDS_RETURN;
160 };
161
162 class SharedDictionary : public Dictionary {
163 SharedDictionaryEntry* get_entry_for_builtin_loader(const Symbol* name) const;
164 SharedDictionaryEntry* get_entry_for_unregistered_loader(const Symbol* name,
165 int clsfile_size,
166 int clsfile_crc32) const;
167
168 // Convenience functions
169 SharedDictionaryEntry* bucket(int index) const {
170 return (SharedDictionaryEntry*)(Dictionary::bucket(index));
171 }
172
173 public:
174 SharedDictionaryEntry* find_entry_for(InstanceKlass* klass);
175
176 bool add_non_builtin_klass(const Symbol* class_name,
177 ClassLoaderData* loader_data,
178 InstanceKlass* obj);
179
180 void update_entry(InstanceKlass* klass, int id);
181
182 InstanceKlass* find_class_for_builtin_loader(const Symbol* name) const;
183 InstanceKlass* find_class_for_unregistered_loader(const Symbol* name,
184 int clsfile_size,
185 int clsfile_crc32) const;
186 bool class_exists_for_unregistered_loader(const Symbol* name) {
187 return (get_entry_for_unregistered_loader(name, -1, -1) != NULL);
188 }
189 };
190
191 class SystemDictionaryShared: public SystemDictionary {
192 private:
193 // These _shared_xxxs arrays are used to initialize the java.lang.Package and
194 // java.security.ProtectionDomain objects associated with each shared class.
349
350 static void set_shared_class_misc_info(InstanceKlass* k, ClassFileStream* cfs);
351
352 static InstanceKlass* lookup_from_stream(const Symbol* class_name,
353 Handle class_loader,
354 Handle protection_domain,
355 const ClassFileStream* st,
356 TRAPS);
357 // "verification_constraints" are a set of checks performed by
358 // VerificationType::is_reference_assignable_from when verifying a shared class during
359 // dump time.
360 //
361 // With AppCDS, it is possible to override archived classes by calling
362 // ClassLoader.defineClass() directly. SystemDictionary::load_shared_class() already
363 // ensures that you cannot load a shared class if its super type(s) are changed. However,
364 // we need an additional check to ensure that the verification_constraints did not change
365 // between dump time and runtime.
366 static bool add_verification_constraint(InstanceKlass* k, Symbol* name,
367 Symbol* from_name, bool from_field_is_protected,
368 bool from_is_array, bool from_is_object) NOT_CDS_RETURN_(false);
369 static void finalize_verification_constraints(InstanceKlass* k) NOT_CDS_RETURN;
370 static void check_verification_constraints(InstanceKlass* klass,
371 TRAPS) NOT_CDS_RETURN;
372 };
373
374 #endif // SHARE_VM_CLASSFILE_SYSTEMDICTIONARYSHARED_HPP
|