Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/mobile
Path: blob/master/src/hotspot/share/gc/serial/serialHeap.hpp
41149 views
1
/*
2
* Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
3
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
*
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
7
* published by the Free Software Foundation.
8
*
9
* This code is distributed in the hope that it will be useful, but WITHOUT
10
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12
* version 2 for more details (a copy is included in the LICENSE file that
13
* accompanied this code).
14
*
15
* You should have received a copy of the GNU General Public License version
16
* 2 along with this work; if not, write to the Free Software Foundation,
17
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18
*
19
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20
* or visit www.oracle.com if you need additional information or have any
21
* questions.
22
*
23
*/
24
25
#ifndef SHARE_GC_SERIAL_SERIALHEAP_HPP
26
#define SHARE_GC_SERIAL_SERIALHEAP_HPP
27
28
#include "gc/serial/defNewGeneration.hpp"
29
#include "gc/serial/tenuredGeneration.hpp"
30
#include "gc/shared/genCollectedHeap.hpp"
31
#include "utilities/growableArray.hpp"
32
33
class GCMemoryManager;
34
class MemoryPool;
35
class OopIterateClosure;
36
class TenuredGeneration;
37
38
class SerialHeap : public GenCollectedHeap {
39
private:
40
MemoryPool* _eden_pool;
41
MemoryPool* _survivor_pool;
42
MemoryPool* _old_pool;
43
44
virtual void initialize_serviceability();
45
46
public:
47
static SerialHeap* heap();
48
49
SerialHeap();
50
51
virtual Name kind() const {
52
return CollectedHeap::Serial;
53
}
54
55
virtual const char* name() const {
56
return "Serial";
57
}
58
59
virtual GrowableArray<GCMemoryManager*> memory_managers();
60
virtual GrowableArray<MemoryPool*> memory_pools();
61
62
DefNewGeneration* young_gen() const {
63
assert(_young_gen->kind() == Generation::DefNew, "Wrong generation type");
64
return static_cast<DefNewGeneration*>(_young_gen);
65
}
66
67
TenuredGeneration* old_gen() const {
68
assert(_old_gen->kind() == Generation::MarkSweepCompact, "Wrong generation type");
69
return static_cast<TenuredGeneration*>(_old_gen);
70
}
71
72
// Apply "cur->do_oop" or "older->do_oop" to all the oops in objects
73
// allocated since the last call to save_marks in the young generation.
74
// The "cur" closure is applied to references in the younger generation
75
// at "level", and the "older" closure to older generations.
76
template <typename OopClosureType1, typename OopClosureType2>
77
void oop_since_save_marks_iterate(OopClosureType1* cur,
78
OopClosureType2* older);
79
80
void young_process_roots(OopIterateClosure* root_closure,
81
OopIterateClosure* old_gen_closure,
82
CLDClosure* cld_closure);
83
};
84
85
#endif // SHARE_GC_SERIAL_SERIALHEAP_HPP
86
87