src/hotspot/share/gc/shared/preservedMarks.cpp
changeset 47885 5caa1d5f74c1
parent 47216 71c04702a3d5
child 49722 a47d1e21b3f1
--- a/src/hotspot/share/gc/shared/preservedMarks.cpp	Mon Oct 30 08:34:54 2017 +0100
+++ b/src/hotspot/share/gc/shared/preservedMarks.cpp	Tue Nov 14 11:33:23 2017 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, 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
@@ -37,6 +37,18 @@
   assert_empty();
 }
 
+void PreservedMarks::adjust_during_full_gc() {
+  StackIterator<OopAndMarkOop, mtGC> iter(_stack);
+  while (!iter.is_empty()) {
+    OopAndMarkOop* elem = iter.next_addr();
+
+    oop obj = elem->get_oop();
+    if (obj->is_forwarded()) {
+      elem->set_oop(obj->forwardee());
+    }
+  }
+}
+
 void PreservedMarks::restore_and_increment(volatile size_t* const total_size_addr) {
   const size_t stack_size = size();
   restore();
@@ -104,7 +116,6 @@
   }
 };
 
-
 void PreservedMarksSet::reclaim() {
   assert_empty();