equal
deleted
inserted
replaced
234 SharedRuntime::_new_instance_ctr++; // new instance requires GC |
234 SharedRuntime::_new_instance_ctr++; // new instance requires GC |
235 #endif |
235 #endif |
236 assert(check_compiled_frame(thread), "incorrect caller"); |
236 assert(check_compiled_frame(thread), "incorrect caller"); |
237 |
237 |
238 // These checks are cheap to make and support reflective allocation. |
238 // These checks are cheap to make and support reflective allocation. |
239 int lh = Klass::cast(klass)->layout_helper(); |
239 int lh = klass->layout_helper(); |
240 if (Klass::layout_helper_needs_slow_path(lh) |
240 if (Klass::layout_helper_needs_slow_path(lh) |
241 || !InstanceKlass::cast(klass)->is_initialized()) { |
241 || !InstanceKlass::cast(klass)->is_initialized()) { |
242 KlassHandle kh(THREAD, klass); |
242 KlassHandle kh(THREAD, klass); |
243 kh->check_valid_for_instantiation(false, THREAD); |
243 kh->check_valid_for_instantiation(false, THREAD); |
244 if (!HAS_PENDING_EXCEPTION) { |
244 if (!HAS_PENDING_EXCEPTION) { |
281 assert(check_compiled_frame(thread), "incorrect caller"); |
281 assert(check_compiled_frame(thread), "incorrect caller"); |
282 |
282 |
283 // Scavenge and allocate an instance. |
283 // Scavenge and allocate an instance. |
284 oop result; |
284 oop result; |
285 |
285 |
286 if (Klass::cast(array_type)->oop_is_typeArray()) { |
286 if (array_type->oop_is_typeArray()) { |
287 // The oopFactory likes to work with the element type. |
287 // The oopFactory likes to work with the element type. |
288 // (We could bypass the oopFactory, since it doesn't add much value.) |
288 // (We could bypass the oopFactory, since it doesn't add much value.) |
289 BasicType elem_type = TypeArrayKlass::cast(array_type)->element_type(); |
289 BasicType elem_type = TypeArrayKlass::cast(array_type)->element_type(); |
290 result = oopFactory::new_typeArray(elem_type, len, THREAD); |
290 result = oopFactory::new_typeArray(elem_type, len, THREAD); |
291 } else { |
291 } else { |
319 assert(check_compiled_frame(thread), "incorrect caller"); |
319 assert(check_compiled_frame(thread), "incorrect caller"); |
320 |
320 |
321 // Scavenge and allocate an instance. |
321 // Scavenge and allocate an instance. |
322 oop result; |
322 oop result; |
323 |
323 |
324 assert(Klass::cast(array_type)->oop_is_typeArray(), "should be called only for type array"); |
324 assert(array_type->oop_is_typeArray(), "should be called only for type array"); |
325 // The oopFactory likes to work with the element type. |
325 // The oopFactory likes to work with the element type. |
326 BasicType elem_type = TypeArrayKlass::cast(array_type)->element_type(); |
326 BasicType elem_type = TypeArrayKlass::cast(array_type)->element_type(); |
327 result = oopFactory::new_typeArray_nozero(elem_type, len, THREAD); |
327 result = oopFactory::new_typeArray_nozero(elem_type, len, THREAD); |
328 |
328 |
329 // Pass oops back through thread local storage. Our apparent type to Java |
329 // Pass oops back through thread local storage. Our apparent type to Java |