src/share/vm/memory/oopFactory.cpp

Print this page




 123   return ck->allocate(length, CHECK_NULL);
 124 }
 125 
 126 
 127 klassOop oopFactory::new_instanceKlass(Symbol* name, int vtable_len, int itable_len,
 128                                        int static_field_size,
 129                                        unsigned int nonstatic_oop_map_count,
 130                                        AccessFlags access_flags,
 131                                        ReferenceType rt,
 132                                        KlassHandle host_klass, TRAPS) {
 133   instanceKlassKlass* ikk = instanceKlassKlass::cast(Universe::instanceKlassKlassObj());
 134   return ikk->allocate_instance_klass(name, vtable_len, itable_len,
 135                                       static_field_size, nonstatic_oop_map_count,
 136                                       access_flags, rt, host_klass, CHECK_NULL);
 137 }
 138 
 139 
 140 constMethodOop oopFactory::new_constMethod(int byte_code_size,
 141                                            int compressed_line_number_size,
 142                                            int localvariable_table_length,

 143                                            int checked_exceptions_length,
 144                                            bool is_conc_safe,
 145                                            TRAPS) {
 146   klassOop cmkObj = Universe::constMethodKlassObj();
 147   constMethodKlass* cmk = constMethodKlass::cast(cmkObj);
 148   return cmk->allocate(byte_code_size, compressed_line_number_size,
 149                        localvariable_table_length, checked_exceptions_length,
 150                        is_conc_safe,
 151                        CHECK_NULL);
 152 }
 153 
 154 
 155 methodOop oopFactory::new_method(int byte_code_size, AccessFlags access_flags,
 156                                  int compressed_line_number_size,
 157                                  int localvariable_table_length,

 158                                  int checked_exceptions_length,
 159                                  bool is_conc_safe,
 160                                  TRAPS) {
 161   methodKlass* mk = methodKlass::cast(Universe::methodKlassObj());
 162   assert(!access_flags.is_native() || byte_code_size == 0,
 163          "native methods should not contain byte codes");
 164   constMethodOop cm = new_constMethod(byte_code_size,
 165                                       compressed_line_number_size,
 166                                       localvariable_table_length,

 167                                       checked_exceptions_length,
 168                                       is_conc_safe, CHECK_NULL);
 169   constMethodHandle rw(THREAD, cm);
 170   return mk->allocate(rw, access_flags, CHECK_NULL);
 171 }
 172 
 173 
 174 methodDataOop oopFactory::new_methodData(methodHandle method, TRAPS) {
 175   methodDataKlass* mdk = methodDataKlass::cast(Universe::methodDataKlassObj());
 176   return mdk->allocate(method, CHECK_NULL);
 177 }
 178 
 179 
 180 compiledICHolderOop oopFactory::new_compiledICHolder(methodHandle method, KlassHandle klass, TRAPS) {
 181   compiledICHolderKlass* ck = (compiledICHolderKlass*) Universe::compiledICHolderKlassObj()->klass_part();
 182   compiledICHolderOop c = ck->allocate(CHECK_NULL);
 183   c->set_holder_method(method());
 184   c->set_holder_klass(klass());
 185   return c;
 186 }


 123   return ck->allocate(length, CHECK_NULL);
 124 }
 125 
 126 
 127 klassOop oopFactory::new_instanceKlass(Symbol* name, int vtable_len, int itable_len,
 128                                        int static_field_size,
 129                                        unsigned int nonstatic_oop_map_count,
 130                                        AccessFlags access_flags,
 131                                        ReferenceType rt,
 132                                        KlassHandle host_klass, TRAPS) {
 133   instanceKlassKlass* ikk = instanceKlassKlass::cast(Universe::instanceKlassKlassObj());
 134   return ikk->allocate_instance_klass(name, vtable_len, itable_len,
 135                                       static_field_size, nonstatic_oop_map_count,
 136                                       access_flags, rt, host_klass, CHECK_NULL);
 137 }
 138 
 139 
 140 constMethodOop oopFactory::new_constMethod(int byte_code_size,
 141                                            int compressed_line_number_size,
 142                                            int localvariable_table_length,
 143                                            int exception_table_length,
 144                                            int checked_exceptions_length,
 145                                            bool is_conc_safe,
 146                                            TRAPS) {
 147   klassOop cmkObj = Universe::constMethodKlassObj();
 148   constMethodKlass* cmk = constMethodKlass::cast(cmkObj);
 149   return cmk->allocate(byte_code_size, compressed_line_number_size,
 150                        localvariable_table_length, exception_table_length,
 151                        checked_exceptions_length, is_conc_safe,
 152                        CHECK_NULL);
 153 }
 154 
 155 
 156 methodOop oopFactory::new_method(int byte_code_size, AccessFlags access_flags,
 157                                  int compressed_line_number_size,
 158                                  int localvariable_table_length,
 159                                  int exception_table_length,
 160                                  int checked_exceptions_length,
 161                                  bool is_conc_safe,
 162                                  TRAPS) {
 163   methodKlass* mk = methodKlass::cast(Universe::methodKlassObj());
 164   assert(!access_flags.is_native() || byte_code_size == 0,
 165          "native methods should not contain byte codes");
 166   constMethodOop cm = new_constMethod(byte_code_size,
 167                                       compressed_line_number_size,
 168                                       localvariable_table_length,
 169                                       exception_table_length,
 170                                       checked_exceptions_length,
 171                                       is_conc_safe, CHECK_NULL);
 172   constMethodHandle rw(THREAD, cm);
 173   return mk->allocate(rw, access_flags, CHECK_NULL);
 174 }
 175 
 176 
 177 methodDataOop oopFactory::new_methodData(methodHandle method, TRAPS) {
 178   methodDataKlass* mdk = methodDataKlass::cast(Universe::methodDataKlassObj());
 179   return mdk->allocate(method, CHECK_NULL);
 180 }
 181 
 182 
 183 compiledICHolderOop oopFactory::new_compiledICHolder(methodHandle method, KlassHandle klass, TRAPS) {
 184   compiledICHolderKlass* ck = (compiledICHolderKlass*) Universe::compiledICHolderKlassObj()->klass_part();
 185   compiledICHolderOop c = ck->allocate(CHECK_NULL);
 186   c->set_holder_method(method());
 187   c->set_holder_klass(klass());
 188   return c;
 189 }