--- old/src/share/vm/gc_implementation/g1/heapRegion.cpp 2019-01-28 17:43:38.000000000 +0800 +++ new/src/share/vm/gc_implementation/g1/heapRegion.cpp 2019-01-28 17:43:38.000000000 +0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -31,6 +31,7 @@ #include "gc_implementation/g1/heapRegionBounds.inline.hpp" #include "gc_implementation/g1/heapRegionRemSet.hpp" #include "gc_implementation/g1/heapRegionManager.inline.hpp" +#include "gc_implementation/g1/heapRegionTracer.hpp" #include "gc_implementation/shared/liveRange.hpp" #include "memory/genOopClosures.inline.hpp" #include "memory/iterator.hpp" @@ -217,7 +218,9 @@ "Should be normal before the humongous object allocation"); assert(top() == bottom(), "should be empty"); assert(bottom() <= new_top && new_top <= new_end, "pre-condition"); - + if (EnableJFR) { + report_region_type_change(G1HeapRegionTraceType::StartsHumongous); + } _type.set_starts_humongous(); _humongous_start_region = this; @@ -231,7 +234,9 @@ "Should be normal before the humongous object allocation"); assert(top() == bottom(), "should be empty"); assert(first_hr->startsHumongous(), "pre-condition"); - + if (EnableJFR) { + report_region_type_change(G1HeapRegionTraceType::ContinuesHumongous); + } _type.set_continues_humongous(); _humongous_start_region = first_hr; } @@ -303,6 +308,16 @@ record_timestamp(); } +void HeapRegion::report_region_type_change(G1HeapRegionTraceType::Type to) { + assert(EnableJFR, "sanity check"); + HeapRegionTracer::send_region_type_change(_hrm_index, + get_trace_type(), + to, + (uintptr_t)bottom(), + used()); +} + + CompactibleSpace* HeapRegion::next_compaction_space() const { return G1CollectedHeap::heap()->next_compaction_region(this); }