356 static size_t align_up_to_region_byte_size(size_t sz) {
357 return (sz + (size_t) GrainBytes - 1) &
358 ~((1 << (size_t) LogOfHRGrainBytes) - 1);
359 }
360
361 // It sets up the heap region size (GrainBytes / GrainWords), as
362 // well as other related fields that are based on the heap region
363 // size (LogOfHRGrainBytes / LogOfHRGrainWords /
364 // CardsPerRegion). All those fields are considered constant
365 // throughout the JVM's execution, therefore they should only be set
366 // up once during initialization time.
367 static void setup_heap_region_size(uintx min_heap_size);
368
369 enum ClaimValues {
370 InitialClaimValue = 0,
371 FinalCountClaimValue = 1,
372 NoteEndClaimValue = 2,
373 ScrubRemSetClaimValue = 3,
374 ParVerifyClaimValue = 4,
375 RebuildRSClaimValue = 5,
376 CompleteMarkCSetClaimValue = 6
377 };
378
379 inline HeapWord* par_allocate_no_bot_updates(size_t word_size) {
380 assert(is_young(), "we can only skip BOT updates on young regions");
381 return ContiguousSpace::par_allocate(word_size);
382 }
383 inline HeapWord* allocate_no_bot_updates(size_t word_size) {
384 assert(is_young(), "we can only skip BOT updates on young regions");
385 return ContiguousSpace::allocate(word_size);
386 }
387
388 // If this region is a member of a HeapRegionSeq, the index in that
389 // sequence, otherwise -1.
390 size_t hrs_index() const { return _hrs_index; }
391
392 // The number of bytes marked live in the region in the last marking phase.
393 size_t marked_bytes() { return _prev_marked_bytes; }
394 size_t live_bytes() {
395 return (top() - prev_top_at_mark_start()) * HeapWordSize + marked_bytes();
396 }
|
356 static size_t align_up_to_region_byte_size(size_t sz) {
357 return (sz + (size_t) GrainBytes - 1) &
358 ~((1 << (size_t) LogOfHRGrainBytes) - 1);
359 }
360
361 // It sets up the heap region size (GrainBytes / GrainWords), as
362 // well as other related fields that are based on the heap region
363 // size (LogOfHRGrainBytes / LogOfHRGrainWords /
364 // CardsPerRegion). All those fields are considered constant
365 // throughout the JVM's execution, therefore they should only be set
366 // up once during initialization time.
367 static void setup_heap_region_size(uintx min_heap_size);
368
369 enum ClaimValues {
370 InitialClaimValue = 0,
371 FinalCountClaimValue = 1,
372 NoteEndClaimValue = 2,
373 ScrubRemSetClaimValue = 3,
374 ParVerifyClaimValue = 4,
375 RebuildRSClaimValue = 5,
376 CompleteMarkCSetClaimValue = 6,
377 AggregateCountClaimValue = 7,
378 VerifyCountClaimValue = 8
379 };
380
381 inline HeapWord* par_allocate_no_bot_updates(size_t word_size) {
382 assert(is_young(), "we can only skip BOT updates on young regions");
383 return ContiguousSpace::par_allocate(word_size);
384 }
385 inline HeapWord* allocate_no_bot_updates(size_t word_size) {
386 assert(is_young(), "we can only skip BOT updates on young regions");
387 return ContiguousSpace::allocate(word_size);
388 }
389
390 // If this region is a member of a HeapRegionSeq, the index in that
391 // sequence, otherwise -1.
392 size_t hrs_index() const { return _hrs_index; }
393
394 // The number of bytes marked live in the region in the last marking phase.
395 size_t marked_bytes() { return _prev_marked_bytes; }
396 size_t live_bytes() {
397 return (top() - prev_top_at_mark_start()) * HeapWordSize + marked_bytes();
398 }
|