< prev index next >

src/hotspot/share/gc/shared/collectedHeap.inline.hpp

Print this page
rev 49643 : [mq]: heap8
rev 49645 : [mq]: heap9
rev 49646 : [mq]: heap11
rev 49647 : [mq]: heap12
rev 49648 : [mq]: heap13

*** 152,165 **** if (result != NULL) { NOT_PRODUCT(Universe::heap()-> check_for_non_bad_heap_word_value(result, size)); assert(!HAS_PENDING_EXCEPTION, "Unexpected exception, will result in uninitialized storage"); ! THREAD->incr_allocated_bytes(size * HeapWordSize); ! AllocTracer::send_allocation_outside_tlab(klass, result, size * HeapWordSize, THREAD); return result; } if (!gc_overhead_limit_was_exceeded) { --- 152,169 ---- if (result != NULL) { NOT_PRODUCT(Universe::heap()-> check_for_non_bad_heap_word_value(result, size)); assert(!HAS_PENDING_EXCEPTION, "Unexpected exception, will result in uninitialized storage"); ! int size_in_bytes = size * HeapWordSize; ! THREAD->incr_allocated_bytes(size_in_bytes); ! AllocTracer::send_allocation_outside_tlab(klass, result, size_in_bytes, THREAD); + if (ThreadHeapSampler::enabled()) { + THREAD->heap_sampler().check_for_sampling(result, size_in_bytes); + } return result; } if (!gc_overhead_limit_was_exceeded) {
*** 214,267 **** oop CollectedHeap::obj_allocate(Klass* klass, int size, TRAPS) { debug_only(check_for_valid_allocation_state()); assert(!Universe::heap()->is_gc_active(), "Allocation during gc not allowed"); assert(size >= 0, "int won't convert to size_t"); HeapWord* obj = common_mem_allocate_init(klass, size, CHECK_NULL); post_allocation_setup_obj(klass, obj, size); NOT_PRODUCT(Universe::heap()->check_for_bad_heap_word_value(obj, size)); ! return (oop)obj; } oop CollectedHeap::class_allocate(Klass* klass, int size, TRAPS) { debug_only(check_for_valid_allocation_state()); assert(!Universe::heap()->is_gc_active(), "Allocation during gc not allowed"); assert(size >= 0, "int won't convert to size_t"); HeapWord* obj = common_mem_allocate_init(klass, size, CHECK_NULL); post_allocation_setup_class(klass, obj, size); // set oop_size NOT_PRODUCT(Universe::heap()->check_for_bad_heap_word_value(obj, size)); ! return (oop)obj; } oop CollectedHeap::array_allocate(Klass* klass, int size, int length, TRAPS) { debug_only(check_for_valid_allocation_state()); assert(!Universe::heap()->is_gc_active(), "Allocation during gc not allowed"); assert(size >= 0, "int won't convert to size_t"); HeapWord* obj = common_mem_allocate_init(klass, size, CHECK_NULL); post_allocation_setup_array(klass, obj, length); NOT_PRODUCT(Universe::heap()->check_for_bad_heap_word_value(obj, size)); ! return (oop)obj; } oop CollectedHeap::array_allocate_nozero(Klass* klass, int size, int length, TRAPS) { debug_only(check_for_valid_allocation_state()); assert(!Universe::heap()->is_gc_active(), "Allocation during gc not allowed"); assert(size >= 0, "int won't convert to size_t"); HeapWord* obj = common_mem_allocate_noinit(klass, size, CHECK_NULL); ((oop)obj)->set_klass_gap(0); post_allocation_setup_array(klass, obj, length); #ifndef PRODUCT const size_t hs = oopDesc::header_size()+1; Universe::heap()->check_for_non_bad_heap_word_value(obj+hs, size-hs); #endif ! return (oop)obj; } inline HeapWord* CollectedHeap::align_allocation_or_fail(HeapWord* addr, HeapWord* end, unsigned short alignment_in_bytes) { --- 218,277 ---- oop CollectedHeap::obj_allocate(Klass* klass, int size, TRAPS) { debug_only(check_for_valid_allocation_state()); assert(!Universe::heap()->is_gc_active(), "Allocation during gc not allowed"); assert(size >= 0, "int won't convert to size_t"); + + JvmtiSampledObjectAllocEventCollector collector; HeapWord* obj = common_mem_allocate_init(klass, size, CHECK_NULL); post_allocation_setup_obj(klass, obj, size); NOT_PRODUCT(Universe::heap()->check_for_bad_heap_word_value(obj, size)); ! return collector.post_event((oop) obj); } oop CollectedHeap::class_allocate(Klass* klass, int size, TRAPS) { debug_only(check_for_valid_allocation_state()); assert(!Universe::heap()->is_gc_active(), "Allocation during gc not allowed"); assert(size >= 0, "int won't convert to size_t"); + JvmtiSampledObjectAllocEventCollector collector; HeapWord* obj = common_mem_allocate_init(klass, size, CHECK_NULL); post_allocation_setup_class(klass, obj, size); // set oop_size NOT_PRODUCT(Universe::heap()->check_for_bad_heap_word_value(obj, size)); ! return collector.post_event((oop) obj); } oop CollectedHeap::array_allocate(Klass* klass, int size, int length, TRAPS) { debug_only(check_for_valid_allocation_state()); assert(!Universe::heap()->is_gc_active(), "Allocation during gc not allowed"); assert(size >= 0, "int won't convert to size_t"); + + JvmtiSampledObjectAllocEventCollector collector; HeapWord* obj = common_mem_allocate_init(klass, size, CHECK_NULL); post_allocation_setup_array(klass, obj, length); NOT_PRODUCT(Universe::heap()->check_for_bad_heap_word_value(obj, size)); ! return collector.post_event((oop) obj); } oop CollectedHeap::array_allocate_nozero(Klass* klass, int size, int length, TRAPS) { debug_only(check_for_valid_allocation_state()); assert(!Universe::heap()->is_gc_active(), "Allocation during gc not allowed"); assert(size >= 0, "int won't convert to size_t"); + JvmtiSampledObjectAllocEventCollector collector; HeapWord* obj = common_mem_allocate_noinit(klass, size, CHECK_NULL); ((oop)obj)->set_klass_gap(0); post_allocation_setup_array(klass, obj, length); #ifndef PRODUCT const size_t hs = oopDesc::header_size()+1; Universe::heap()->check_for_non_bad_heap_word_value(obj+hs, size-hs); #endif ! return collector.post_event((oop) obj); } inline HeapWord* CollectedHeap::align_allocation_or_fail(HeapWord* addr, HeapWord* end, unsigned short alignment_in_bytes) {
< prev index next >