--- a/src/hotspot/share/gc/g1/g1CollectedHeap.cpp Tue Jun 12 14:08:24 2018 -0700
+++ b/src/hotspot/share/gc/g1/g1CollectedHeap.cpp Tue Jun 12 18:12:59 2018 -0400
@@ -78,6 +78,7 @@
#include "logging/log.hpp"
#include "memory/allocation.hpp"
#include "memory/iterator.hpp"
+#include "memory/metaspaceShared.hpp"
#include "memory/resourceArea.hpp"
#include "oops/access.inline.hpp"
#include "oops/compressedOops.inline.hpp"
@@ -823,6 +824,18 @@
decrease_used(size_used);
}
+oop G1CollectedHeap::materialize_archived_object(oop obj) {
+ assert(obj != NULL, "archived obj is NULL");
+ assert(MetaspaceShared::is_archive_object(obj), "must be archived object");
+
+ // Loading an archived object makes it strongly reachable. If it is
+ // loaded during concurrent marking, it must be enqueued to the SATB
+ // queue, shading the previously white object gray.
+ G1BarrierSet::enqueue(obj);
+
+ return obj;
+}
+
HeapWord* G1CollectedHeap::attempt_allocation_humongous(size_t word_size) {
ResourceMark rm; // For retrieving the thread names in log messages.