< prev index next >

src/share/vm/gc/parallel/psParallelCompact.hpp

Print this page
rev 13014 : imported patch 8180755-remove-bitmap-inline-hpp-include


1236   static const char* space_names[last_space_id];
1237   static void print_region_ranges();
1238   static void print_dense_prefix_stats(const char* const algorithm,
1239                                        const SpaceId id,
1240                                        const bool maximum_compaction,
1241                                        HeapWord* const addr);
1242   static void summary_phase_msg(SpaceId dst_space_id,
1243                                 HeapWord* dst_beg, HeapWord* dst_end,
1244                                 SpaceId src_space_id,
1245                                 HeapWord* src_beg, HeapWord* src_end);
1246 #endif  // #ifndef PRODUCT
1247 
1248 #ifdef  ASSERT
1249   // Sanity check the new location of a word in the heap.
1250   static inline void check_new_location(HeapWord* old_addr, HeapWord* new_addr);
1251   // Verify that all the regions have been emptied.
1252   static void verify_complete(SpaceId space_id);
1253 #endif  // #ifdef ASSERT
1254 };
1255 
1256 inline bool PSParallelCompact::is_marked(oop obj) {
1257   return mark_bitmap()->is_marked(obj);
1258 }
1259 
1260 inline double PSParallelCompact::normal_distribution(double density) {
1261   assert(_dwl_initialized, "uninitialized");
1262   const double squared_term = (density - _dwl_mean) / _dwl_std_dev;
1263   return _dwl_first_term * exp(-0.5 * squared_term * squared_term);
1264 }
1265 
1266 inline bool
1267 PSParallelCompact::dead_space_crosses_boundary(const RegionData* region,
1268                                                idx_t bit)
1269 {
1270   assert(bit > 0, "cannot call this for the first bit/region");
1271   assert(_summary_data.region_to_addr(region) == _mark_bitmap.bit_to_addr(bit),
1272          "sanity check");
1273 
1274   // Dead space crosses the boundary if (1) a partial object does not extend
1275   // onto the region, (2) an object does not start at the beginning of the
1276   // region, and (3) an object does not end at the end of the prior region.
1277   return region->partial_obj_size() == 0 &&
1278     !_mark_bitmap.is_obj_beg(bit) &&
1279     !_mark_bitmap.is_obj_end(bit - 1);
1280 }
1281 
1282 inline bool
1283 PSParallelCompact::is_in(HeapWord* p, HeapWord* beg_addr, HeapWord* end_addr) {
1284   return p >= beg_addr && p < end_addr;
1285 }
1286 
1287 inline bool
1288 PSParallelCompact::is_in(oop* p, HeapWord* beg_addr, HeapWord* end_addr) {
1289   return is_in((HeapWord*)p, beg_addr, end_addr);
1290 }
1291 
1292 inline MutableSpace* PSParallelCompact::space(SpaceId id) {
1293   assert(id < last_space_id, "id out of range");
1294   return _space_info[id].space();
1295 }
1296 
1297 inline HeapWord* PSParallelCompact::new_top(SpaceId id) {
1298   assert(id < last_space_id, "id out of range");
1299   return _space_info[id].new_top();
1300 }
1301 
1302 inline HeapWord* PSParallelCompact::dense_prefix(SpaceId id) {
1303   assert(id < last_space_id, "id out of range");
1304   return _space_info[id].dense_prefix();
1305 }
1306 
1307 inline ObjectStartArray* PSParallelCompact::start_array(SpaceId id) {
1308   assert(id < last_space_id, "id out of range");
1309   return _space_info[id].start_array();
1310 }
1311 
1312 #ifdef ASSERT
1313 inline void
1314 PSParallelCompact::check_new_location(HeapWord* old_addr, HeapWord* new_addr)
1315 {
1316   assert(old_addr >= new_addr || space_id(old_addr) != space_id(new_addr),
1317          "must move left or to a different space");
1318   assert(is_object_aligned((intptr_t)old_addr) && is_object_aligned((intptr_t)new_addr),
1319          "checking alignment");
1320 }
1321 #endif // ASSERT
1322 
1323 class MoveAndUpdateClosure: public ParMarkBitMapClosure {
1324  public:
1325   inline MoveAndUpdateClosure(ParMarkBitMap* bitmap, ParCompactionManager* cm,
1326                               ObjectStartArray* start_array,
1327                               HeapWord* destination, size_t words);
1328 
1329   // Accessors.
1330   HeapWord* destination() const         { return _destination; }
1331 
1332   // If the object will fit (size <= words_remaining()), copy it to the current
1333   // destination, update the interior oops and the start array and return either
1334   // full (if the closure is full) or incomplete.  If the object will not fit,
1335   // return would_overflow.
1336   virtual IterationStatus do_addr(HeapWord* addr, size_t size);
1337 
1338   // Copy enough words to fill this closure, starting at source().  Interior
1339   // oops and the start array are not updated.  Return full.
1340   IterationStatus copy_until_full();
1341 
1342   // Copy enough words to fill this closure or to the end of an object,


1372 }
1373 
1374 class UpdateOnlyClosure: public ParMarkBitMapClosure {
1375  private:
1376   const PSParallelCompact::SpaceId _space_id;
1377   ObjectStartArray* const          _start_array;
1378 
1379  public:
1380   UpdateOnlyClosure(ParMarkBitMap* mbm,
1381                     ParCompactionManager* cm,
1382                     PSParallelCompact::SpaceId space_id);
1383 
1384   // Update the object.
1385   virtual IterationStatus do_addr(HeapWord* addr, size_t words);
1386 
1387   inline void do_addr(HeapWord* addr);
1388 };
1389 
1390 class FillClosure: public ParMarkBitMapClosure {
1391  public:
1392   FillClosure(ParCompactionManager* cm, PSParallelCompact::SpaceId space_id) :
1393     ParMarkBitMapClosure(PSParallelCompact::mark_bitmap(), cm),
1394     _start_array(PSParallelCompact::start_array(space_id))
1395   {
1396     assert(space_id == PSParallelCompact::old_space_id,
1397            "cannot use FillClosure in the young gen");
1398   }
1399 
1400   virtual IterationStatus do_addr(HeapWord* addr, size_t size);
1401 
1402  private:
1403   ObjectStartArray* const _start_array;
1404 };
1405 
1406 #endif // SHARE_VM_GC_PARALLEL_PSPARALLELCOMPACT_HPP


1236   static const char* space_names[last_space_id];
1237   static void print_region_ranges();
1238   static void print_dense_prefix_stats(const char* const algorithm,
1239                                        const SpaceId id,
1240                                        const bool maximum_compaction,
1241                                        HeapWord* const addr);
1242   static void summary_phase_msg(SpaceId dst_space_id,
1243                                 HeapWord* dst_beg, HeapWord* dst_end,
1244                                 SpaceId src_space_id,
1245                                 HeapWord* src_beg, HeapWord* src_end);
1246 #endif  // #ifndef PRODUCT
1247 
1248 #ifdef  ASSERT
1249   // Sanity check the new location of a word in the heap.
1250   static inline void check_new_location(HeapWord* old_addr, HeapWord* new_addr);
1251   // Verify that all the regions have been emptied.
1252   static void verify_complete(SpaceId space_id);
1253 #endif  // #ifdef ASSERT
1254 };
1255 



































































1256 class MoveAndUpdateClosure: public ParMarkBitMapClosure {
1257  public:
1258   inline MoveAndUpdateClosure(ParMarkBitMap* bitmap, ParCompactionManager* cm,
1259                               ObjectStartArray* start_array,
1260                               HeapWord* destination, size_t words);
1261 
1262   // Accessors.
1263   HeapWord* destination() const         { return _destination; }
1264 
1265   // If the object will fit (size <= words_remaining()), copy it to the current
1266   // destination, update the interior oops and the start array and return either
1267   // full (if the closure is full) or incomplete.  If the object will not fit,
1268   // return would_overflow.
1269   virtual IterationStatus do_addr(HeapWord* addr, size_t size);
1270 
1271   // Copy enough words to fill this closure, starting at source().  Interior
1272   // oops and the start array are not updated.  Return full.
1273   IterationStatus copy_until_full();
1274 
1275   // Copy enough words to fill this closure or to the end of an object,


1305 }
1306 
1307 class UpdateOnlyClosure: public ParMarkBitMapClosure {
1308  private:
1309   const PSParallelCompact::SpaceId _space_id;
1310   ObjectStartArray* const          _start_array;
1311 
1312  public:
1313   UpdateOnlyClosure(ParMarkBitMap* mbm,
1314                     ParCompactionManager* cm,
1315                     PSParallelCompact::SpaceId space_id);
1316 
1317   // Update the object.
1318   virtual IterationStatus do_addr(HeapWord* addr, size_t words);
1319 
1320   inline void do_addr(HeapWord* addr);
1321 };
1322 
1323 class FillClosure: public ParMarkBitMapClosure {
1324  public:
1325   FillClosure(ParCompactionManager* cm, PSParallelCompact::SpaceId space_id);






1326 
1327   virtual IterationStatus do_addr(HeapWord* addr, size_t size);
1328 
1329  private:
1330   ObjectStartArray* const _start_array;
1331 };
1332 
1333 #endif // SHARE_VM_GC_PARALLEL_PSPARALLELCOMPACT_HPP
< prev index next >