Mercurial > hg > truffle
comparison src/share/vm/gc_implementation/g1/heapRegion.hpp @ 2133:2250ee17e258
7007068: G1: refine the BOT during evac failure handling
Summary: During evacuation failure handling we refine the BOT to reflect the location of all the objects in the regions we scan. The changeset includes some minor cleanup: a) non-product print_on() method on the G1 BOT class, b) added more complete BOT verification during heap / region verification, c) slight modification to the BOT set up for humongous regions to be more consistent with the BOT set up during evac failure handling, and d) removed a couple of unused methods.
Reviewed-by: johnc, ysr
author | tonyp |
---|---|
date | Wed, 12 Jan 2011 13:06:00 -0500 |
parents | f95d63e2154a |
children | b158bed62ef5 |
comparison
equal
deleted
inserted
replaced
2132:4947ee68d19c | 2133:2250ee17e258 |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. | 2 * Copyright (c) 2001, 2011, 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. |
171 // MarkSweep support phase3 | 171 // MarkSweep support phase3 |
172 virtual HeapWord* initialize_threshold(); | 172 virtual HeapWord* initialize_threshold(); |
173 virtual HeapWord* cross_threshold(HeapWord* start, HeapWord* end); | 173 virtual HeapWord* cross_threshold(HeapWord* start, HeapWord* end); |
174 | 174 |
175 virtual void print() const; | 175 virtual void print() const; |
176 | |
177 void reset_bot() { | |
178 _offsets.zero_bottom_entry(); | |
179 _offsets.initialize_threshold(); | |
180 } | |
181 | |
182 void update_bot_for_object(HeapWord* start, size_t word_size) { | |
183 _offsets.alloc_block(start, word_size); | |
184 } | |
185 | |
186 void print_bot_on(outputStream* out) { | |
187 _offsets.print_on(out); | |
188 } | |
176 }; | 189 }; |
177 | 190 |
178 class HeapRegion: public G1OffsetTableContigSpace { | 191 class HeapRegion: public G1OffsetTableContigSpace { |
179 friend class VMStructs; | 192 friend class VMStructs; |
180 private: | 193 private: |
402 // For a humongous region, region in which it starts. | 415 // For a humongous region, region in which it starts. |
403 HeapRegion* humongous_start_region() const { | 416 HeapRegion* humongous_start_region() const { |
404 return _humongous_start_region; | 417 return _humongous_start_region; |
405 } | 418 } |
406 | 419 |
407 // Causes the current region to represent a humongous object spanning "n" | 420 // Makes the current region be a "starts humongous" region, i.e., |
408 // regions. | 421 // the first region in a series of one or more contiguous regions |
409 void set_startsHumongous(HeapWord* new_end); | 422 // that will contain a single "humongous" object. The two parameters |
410 | 423 // are as follows: |
411 // The regions that continue a humongous sequence should be added using | 424 // |
412 // this method, in increasing address order. | 425 // new_top : The new value of the top field of this region which |
413 void set_continuesHumongous(HeapRegion* start); | 426 // points to the end of the humongous object that's being |
427 // allocated. If there is more than one region in the series, top | |
428 // will lie beyond this region's original end field and on the last | |
429 // region in the series. | |
430 // | |
431 // new_end : The new value of the end field of this region which | |
432 // points to the end of the last region in the series. If there is | |
433 // one region in the series (namely: this one) end will be the same | |
434 // as the original end of this region. | |
435 // | |
436 // Updating top and end as described above makes this region look as | |
437 // if it spans the entire space taken up by all the regions in the | |
438 // series and an single allocation moved its top to new_top. This | |
439 // ensures that the space (capacity / allocated) taken up by all | |
440 // humongous regions can be calculated by just looking at the | |
441 // "starts humongous" regions and by ignoring the "continues | |
442 // humongous" regions. | |
443 void set_startsHumongous(HeapWord* new_top, HeapWord* new_end); | |
444 | |
445 // Makes the current region be a "continues humongous' | |
446 // region. first_hr is the "start humongous" region of the series | |
447 // which this region will be part of. | |
448 void set_continuesHumongous(HeapRegion* first_hr); | |
414 | 449 |
415 // If the region has a remembered set, return a pointer to it. | 450 // If the region has a remembered set, return a pointer to it. |
416 HeapRegionRemSet* rem_set() const { | 451 HeapRegionRemSet* rem_set() const { |
417 return _rem_set; | 452 return _rem_set; |
418 } | 453 } |