1 /* |
1 /* |
2 * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2001, 2017, 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. |
53 bool clear_all_softrefs); |
53 bool clear_all_softrefs); |
54 |
54 |
55 static STWGCTimer* gc_timer() { return GenMarkSweep::_gc_timer; } |
55 static STWGCTimer* gc_timer() { return GenMarkSweep::_gc_timer; } |
56 static SerialOldTracer* gc_tracer() { return GenMarkSweep::_gc_tracer; } |
56 static SerialOldTracer* gc_tracer() { return GenMarkSweep::_gc_tracer; } |
57 |
57 |
58 // Create the _archive_region_map which is used to identify archive objects. |
58 private: |
59 static void enable_archive_object_check(); |
|
60 |
|
61 // Set the regions containing the specified address range as archive/non-archive. |
|
62 static void set_range_archive(MemRegion range, bool is_archive); |
|
63 |
|
64 // Check if an object is in an archive region using the _archive_region_map. |
|
65 static bool in_archive_range(oop object); |
|
66 |
|
67 // Check if archive object checking is enabled, to avoid calling in_archive_range |
|
68 // unnecessarily. |
|
69 static bool archive_check_enabled() { return G1MarkSweep::_archive_check_enabled; } |
|
70 |
|
71 private: |
|
72 static bool _archive_check_enabled; |
|
73 static G1ArchiveRegionMap _archive_region_map; |
|
74 |
|
75 // Mark live objects |
59 // Mark live objects |
76 static void mark_sweep_phase1(bool& marked_for_deopt, |
60 static void mark_sweep_phase1(bool& marked_for_deopt, |
77 bool clear_all_softrefs); |
61 bool clear_all_softrefs); |
78 // Calculate new addresses |
62 // Calculate new addresses |
79 static void mark_sweep_phase2(); |
63 static void mark_sweep_phase2(); |
107 |
91 |
108 void update_sets(); |
92 void update_sets(); |
109 bool doHeapRegion(HeapRegion* hr); |
93 bool doHeapRegion(HeapRegion* hr); |
110 }; |
94 }; |
111 |
95 |
112 // G1ArchiveRegionMap is a boolean array used to mark G1 regions as |
|
113 // archive regions. This allows a quick check for whether an object |
|
114 // should not be marked because it is in an archive region. |
|
115 class G1ArchiveRegionMap : public G1BiasedMappedArray<bool> { |
|
116 protected: |
|
117 bool default_value() const { return false; } |
|
118 }; |
|
119 |
|
120 #endif // SHARE_VM_GC_G1_G1MARKSWEEP_HPP |
96 #endif // SHARE_VM_GC_G1_G1MARKSWEEP_HPP |