src/share/vm/oops/instanceKlass.cpp

changeset 4712
3efdfd6ddbf2
parent 4572
927a311d00f9
child 4714
35ef86296a5d
     1.1 --- a/src/share/vm/oops/instanceKlass.cpp	Thu Mar 07 14:06:44 2013 -0500
     1.2 +++ b/src/share/vm/oops/instanceKlass.cpp	Fri Mar 08 11:47:57 2013 -0500
     1.3 @@ -220,63 +220,71 @@
     1.4                               bool is_anonymous) {
     1.5    No_Safepoint_Verifier no_safepoint; // until k becomes parsable
     1.6  
     1.7 -  int size = InstanceKlass::size(vtable_len, itable_len, nonstatic_oop_map_size,
     1.8 -                                 access_flags.is_interface(), is_anonymous);
     1.9 +  int iksize = InstanceKlass::size(vtable_len, itable_len, nonstatic_oop_map_size,
    1.10 +                                   access_flags.is_interface(), is_anonymous);
    1.11  
    1.12    // The sizes of these these three variables are used for determining the
    1.13    // size of the instanceKlassOop. It is critical that these are set to the right
    1.14    // sizes before the first GC, i.e., when we allocate the mirror.
    1.15 -  this->set_vtable_length(vtable_len);
    1.16 -  this->set_itable_length(itable_len);
    1.17 -  this->set_static_field_size(static_field_size);
    1.18 -  this->set_nonstatic_oop_map_size(nonstatic_oop_map_size);
    1.19 -  this->set_access_flags(access_flags);
    1.20 -  this->set_is_anonymous(is_anonymous);
    1.21 -  assert(this->size() == size, "wrong size for object");
    1.22 -
    1.23 -  this->set_array_klasses(NULL);
    1.24 -  this->set_methods(NULL);
    1.25 -  this->set_method_ordering(NULL);
    1.26 -  this->set_local_interfaces(NULL);
    1.27 -  this->set_transitive_interfaces(NULL);
    1.28 -  this->init_implementor();
    1.29 -  this->set_fields(NULL, 0);
    1.30 -  this->set_constants(NULL);
    1.31 -  this->set_class_loader_data(NULL);
    1.32 -  this->set_protection_domain(NULL);
    1.33 -  this->set_signers(NULL);
    1.34 -  this->set_source_file_name(NULL);
    1.35 -  this->set_source_debug_extension(NULL, 0);
    1.36 -  this->set_array_name(NULL);
    1.37 -  this->set_inner_classes(NULL);
    1.38 -  this->set_static_oop_field_count(0);
    1.39 -  this->set_nonstatic_field_size(0);
    1.40 -  this->set_is_marked_dependent(false);
    1.41 -  this->set_init_state(InstanceKlass::allocated);
    1.42 -  this->set_init_thread(NULL);
    1.43 -  this->set_init_lock(NULL);
    1.44 -  this->set_reference_type(rt);
    1.45 -  this->set_oop_map_cache(NULL);
    1.46 -  this->set_jni_ids(NULL);
    1.47 -  this->set_osr_nmethods_head(NULL);
    1.48 -  this->set_breakpoints(NULL);
    1.49 -  this->init_previous_versions();
    1.50 -  this->set_generic_signature(NULL);
    1.51 -  this->release_set_methods_jmethod_ids(NULL);
    1.52 -  this->release_set_methods_cached_itable_indices(NULL);
    1.53 -  this->set_annotations(NULL);
    1.54 -  this->set_jvmti_cached_class_field_map(NULL);
    1.55 -  this->set_initial_method_idnum(0);
    1.56 +  set_vtable_length(vtable_len);
    1.57 +  set_itable_length(itable_len);
    1.58 +  set_static_field_size(static_field_size);
    1.59 +  set_nonstatic_oop_map_size(nonstatic_oop_map_size);
    1.60 +  set_access_flags(access_flags);
    1.61 +  _misc_flags = 0;  // initialize to zero
    1.62 +  set_is_anonymous(is_anonymous);
    1.63 +  assert(size() == iksize, "wrong size for object");
    1.64 +
    1.65 +  set_array_klasses(NULL);
    1.66 +  set_methods(NULL);
    1.67 +  set_method_ordering(NULL);
    1.68 +  set_local_interfaces(NULL);
    1.69 +  set_transitive_interfaces(NULL);
    1.70 +  init_implementor();
    1.71 +  set_fields(NULL, 0);
    1.72 +  set_constants(NULL);
    1.73 +  set_class_loader_data(NULL);
    1.74 +  set_protection_domain(NULL);
    1.75 +  set_signers(NULL);
    1.76 +  set_source_file_name(NULL);
    1.77 +  set_source_debug_extension(NULL, 0);
    1.78 +  set_array_name(NULL);
    1.79 +  set_inner_classes(NULL);
    1.80 +  set_static_oop_field_count(0);
    1.81 +  set_nonstatic_field_size(0);
    1.82 +  set_is_marked_dependent(false);
    1.83 +  set_init_state(InstanceKlass::allocated);
    1.84 +  set_init_thread(NULL);
    1.85 +  set_init_lock(NULL);
    1.86 +  set_reference_type(rt);
    1.87 +  set_oop_map_cache(NULL);
    1.88 +  set_jni_ids(NULL);
    1.89 +  set_osr_nmethods_head(NULL);
    1.90 +  set_breakpoints(NULL);
    1.91 +  init_previous_versions();
    1.92 +  set_generic_signature(NULL);
    1.93 +  release_set_methods_jmethod_ids(NULL);
    1.94 +  release_set_methods_cached_itable_indices(NULL);
    1.95 +  set_annotations(NULL);
    1.96 +  set_jvmti_cached_class_field_map(NULL);
    1.97 +  set_initial_method_idnum(0);
    1.98 +  _dependencies = NULL;
    1.99 +  set_jvmti_cached_class_field_map(NULL);
   1.100 +  set_cached_class_file(NULL, 0);
   1.101 +  set_initial_method_idnum(0);
   1.102 +  set_minor_version(0);
   1.103 +  set_major_version(0);
   1.104 +  NOT_PRODUCT(_verify_count = 0;)
   1.105  
   1.106    // initialize the non-header words to zero
   1.107    intptr_t* p = (intptr_t*)this;
   1.108 -  for (int index = InstanceKlass::header_size(); index < size; index++) {
   1.109 +  for (int index = InstanceKlass::header_size(); index < iksize; index++) {
   1.110      p[index] = NULL_WORD;
   1.111    }
   1.112  
   1.113    // Set temporary value until parseClassFile updates it with the real instance
   1.114    // size.
   1.115 -  this->set_layout_helper(Klass::instance_layout_helper(0, true));
   1.116 +  set_layout_helper(Klass::instance_layout_helper(0, true));
   1.117  }
   1.118  
   1.119  
   1.120 @@ -2781,7 +2789,7 @@
   1.121    st->print(BULLET"protection domain: "); ((InstanceKlass*)this)->protection_domain()->print_value_on(st); st->cr();
   1.122    st->print(BULLET"host class:        "); host_klass()->print_value_on_maybe_null(st); st->cr();
   1.123    st->print(BULLET"signers:           "); signers()->print_value_on(st);               st->cr();
   1.124 -  st->print(BULLET"init_lock:         "); ((oop)init_lock())->print_value_on(st);             st->cr();
   1.125 +  st->print(BULLET"init_lock:         "); ((oop)_init_lock)->print_value_on(st);             st->cr();
   1.126    if (source_file_name() != NULL) {
   1.127      st->print(BULLET"source file:       ");
   1.128      source_file_name()->print_value_on(st);

mercurial