347 bool is_shared_boot_class() const {
348 return (_misc_flags & _misc_is_shared_boot_class) != 0;
349 }
350 bool is_shared_platform_class() const {
351 return (_misc_flags & _misc_is_shared_platform_class) != 0;
352 }
353 bool is_shared_app_class() const {
354 return (_misc_flags & _misc_is_shared_app_class) != 0;
355 }
356 // The UNREGISTERED class loader type
357 bool is_shared_unregistered_class() const {
358 return (_misc_flags & shared_loader_type_bits()) == 0;
359 }
360
361 void clear_shared_class_loader_type() {
362 _misc_flags &= ~shared_loader_type_bits();
363 }
364
365 void set_shared_class_loader_type(s2 loader_type);
366
367 bool has_nonstatic_fields() const {
368 return (_misc_flags & _misc_has_nonstatic_fields) != 0;
369 }
370 void set_has_nonstatic_fields(bool b) {
371 if (b) {
372 _misc_flags |= _misc_has_nonstatic_fields;
373 } else {
374 _misc_flags &= ~_misc_has_nonstatic_fields;
375 }
376 }
377
378 // field sizes
379 int nonstatic_field_size() const { return _nonstatic_field_size; }
380 void set_nonstatic_field_size(int size) { _nonstatic_field_size = size; }
381
382 int static_field_size() const { return _static_field_size; }
383 void set_static_field_size(int size) { _static_field_size = size; }
384
385 int static_oop_field_count() const { return (int)_static_oop_field_count; }
386 void set_static_oop_field_count(u2 size) { _static_oop_field_count = size; }
452 Array<u2>* inner_classes() const { return _inner_classes; }
453 void set_inner_classes(Array<u2>* f) { _inner_classes = f; }
454
455 // nest members
456 Array<u2>* nest_members() const { return _nest_members; }
457 void set_nest_members(Array<u2>* m) { _nest_members = m; }
458
459 // nest-host index
460 jushort nest_host_index() const { return _nest_host_index; }
461 void set_nest_host_index(u2 i) { _nest_host_index = i; }
462 // dynamic nest member support
463 void set_nest_host(InstanceKlass* host, TRAPS);
464
465 // record components
466 Array<RecordComponent*>* record_components() const { return _record_components; }
467 void set_record_components(Array<RecordComponent*>* record_components) {
468 _record_components = record_components;
469 }
470 bool is_record() const { return _record_components != NULL; }
471
472 private:
473 // Called to verify that k is a member of this nest - does not look at k's nest-host
474 bool has_nest_member(InstanceKlass* k, TRAPS) const;
475
476 public:
477 // Used to construct informative IllegalAccessError messages at a higher level,
478 // if there was an issue resolving or validating the nest host.
479 // Returns NULL if there was no error.
480 const char* nest_host_error(TRAPS);
481 // Returns nest-host class, resolving and validating it if needed.
482 // Returns NULL if resolution is not possible from the calling context.
483 InstanceKlass* nest_host(TRAPS);
484 // Check if this klass is a nestmate of k - resolves this nest-host and k's
485 bool has_nestmate_access_to(InstanceKlass* k, TRAPS);
486
487 enum InnerClassAttributeOffset {
488 // From http://mirror.eng/products/jdk/1.1/docs/guide/innerclasses/spec/innerclasses.doc10.html#18814
489 inner_class_inner_class_info_offset = 0,
490 inner_class_outer_class_info_offset = 1,
491 inner_class_inner_name_offset = 2,
492 inner_class_access_flags_offset = 3,
493 inner_class_next_offset = 4
494 };
495
496 enum EnclosingMethodAttributeOffset {
|
347 bool is_shared_boot_class() const {
348 return (_misc_flags & _misc_is_shared_boot_class) != 0;
349 }
350 bool is_shared_platform_class() const {
351 return (_misc_flags & _misc_is_shared_platform_class) != 0;
352 }
353 bool is_shared_app_class() const {
354 return (_misc_flags & _misc_is_shared_app_class) != 0;
355 }
356 // The UNREGISTERED class loader type
357 bool is_shared_unregistered_class() const {
358 return (_misc_flags & shared_loader_type_bits()) == 0;
359 }
360
361 void clear_shared_class_loader_type() {
362 _misc_flags &= ~shared_loader_type_bits();
363 }
364
365 void set_shared_class_loader_type(s2 loader_type);
366
367 void assign_class_loader_type();
368
369 bool has_nonstatic_fields() const {
370 return (_misc_flags & _misc_has_nonstatic_fields) != 0;
371 }
372 void set_has_nonstatic_fields(bool b) {
373 if (b) {
374 _misc_flags |= _misc_has_nonstatic_fields;
375 } else {
376 _misc_flags &= ~_misc_has_nonstatic_fields;
377 }
378 }
379
380 // field sizes
381 int nonstatic_field_size() const { return _nonstatic_field_size; }
382 void set_nonstatic_field_size(int size) { _nonstatic_field_size = size; }
383
384 int static_field_size() const { return _static_field_size; }
385 void set_static_field_size(int size) { _static_field_size = size; }
386
387 int static_oop_field_count() const { return (int)_static_oop_field_count; }
388 void set_static_oop_field_count(u2 size) { _static_oop_field_count = size; }
454 Array<u2>* inner_classes() const { return _inner_classes; }
455 void set_inner_classes(Array<u2>* f) { _inner_classes = f; }
456
457 // nest members
458 Array<u2>* nest_members() const { return _nest_members; }
459 void set_nest_members(Array<u2>* m) { _nest_members = m; }
460
461 // nest-host index
462 jushort nest_host_index() const { return _nest_host_index; }
463 void set_nest_host_index(u2 i) { _nest_host_index = i; }
464 // dynamic nest member support
465 void set_nest_host(InstanceKlass* host, TRAPS);
466
467 // record components
468 Array<RecordComponent*>* record_components() const { return _record_components; }
469 void set_record_components(Array<RecordComponent*>* record_components) {
470 _record_components = record_components;
471 }
472 bool is_record() const { return _record_components != NULL; }
473
474 // Called to verify that k is a member of this nest - does not look at k's nest-host
475 bool has_nest_member(InstanceKlass* k, TRAPS) const;
476
477 // Used to construct informative IllegalAccessError messages at a higher level,
478 // if there was an issue resolving or validating the nest host.
479 // Returns NULL if there was no error.
480 const char* nest_host_error(TRAPS);
481 // Returns nest-host class, resolving and validating it if needed.
482 // Returns NULL if resolution is not possible from the calling context.
483 InstanceKlass* nest_host(TRAPS);
484 // Check if this klass is a nestmate of k - resolves this nest-host and k's
485 bool has_nestmate_access_to(InstanceKlass* k, TRAPS);
486
487 enum InnerClassAttributeOffset {
488 // From http://mirror.eng/products/jdk/1.1/docs/guide/innerclasses/spec/innerclasses.doc10.html#18814
489 inner_class_inner_class_info_offset = 0,
490 inner_class_outer_class_info_offset = 1,
491 inner_class_inner_name_offset = 2,
492 inner_class_access_flags_offset = 3,
493 inner_class_next_offset = 4
494 };
495
496 enum EnclosingMethodAttributeOffset {
|