src/hotspot/share/gc/cms/parNewGeneration.cpp
changeset 49722 a47d1e21b3f1
parent 49592 77fb0be7d19f
child 49964 99e698e94cc7
equal deleted inserted replaced
49721:ea0cc7c74e75 49722:a47d1e21b3f1
     1 /*
     1 /*
     2  * Copyright (c) 2001, 2017, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
  1131   // The sequential code read "old->age()" below.  That doesn't work here,
  1131   // The sequential code read "old->age()" below.  That doesn't work here,
  1132   // since the age is in the mark word, and that might be overwritten with
  1132   // since the age is in the mark word, and that might be overwritten with
  1133   // a forwarding pointer by a parallel thread.  So we must save the mark
  1133   // a forwarding pointer by a parallel thread.  So we must save the mark
  1134   // word in a local and then analyze it.
  1134   // word in a local and then analyze it.
  1135   oopDesc dummyOld;
  1135   oopDesc dummyOld;
  1136   dummyOld.set_mark(m);
  1136   dummyOld.set_mark_raw(m);
  1137   assert(!dummyOld.is_forwarded(),
  1137   assert(!dummyOld.is_forwarded(),
  1138          "should not be called with forwarding pointer mark word.");
  1138          "should not be called with forwarding pointer mark word.");
  1139 
  1139 
  1140   oop new_obj = NULL;
  1140   oop new_obj = NULL;
  1141   oop forward_ptr;
  1141   oop forward_ptr;
  1179     // Is in to-space; do copying ourselves.
  1179     // Is in to-space; do copying ourselves.
  1180     Copy::aligned_disjoint_words((HeapWord*)old, (HeapWord*)new_obj, sz);
  1180     Copy::aligned_disjoint_words((HeapWord*)old, (HeapWord*)new_obj, sz);
  1181     assert(CMSHeap::heap()->is_in_reserved(new_obj), "illegal forwarding pointer value.");
  1181     assert(CMSHeap::heap()->is_in_reserved(new_obj), "illegal forwarding pointer value.");
  1182     forward_ptr = old->forward_to_atomic(new_obj);
  1182     forward_ptr = old->forward_to_atomic(new_obj);
  1183     // Restore the mark word copied above.
  1183     // Restore the mark word copied above.
  1184     new_obj->set_mark(m);
  1184     new_obj->set_mark_raw(m);
  1185     // Increment age if obj still in new generation
  1185     // Increment age if obj still in new generation
  1186     new_obj->incr_age();
  1186     new_obj->incr_age();
  1187     par_scan_state->age_table()->add(new_obj, sz);
  1187     par_scan_state->age_table()->add(new_obj, sz);
  1188   }
  1188   }
  1189   assert(new_obj != NULL, "just checking");
  1189   assert(new_obj != NULL, "just checking");