Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/mobile
Path: blob/master/src/hotspot/share/gc/epsilon/epsilonThreadLocalData.hpp
41149 views
1
/*
2
* Copyright (c) 2018, Red Hat, Inc. 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_EPSILON_EPSILONTHREADLOCALDATA_HPP
26
#define SHARE_GC_EPSILON_EPSILONTHREADLOCALDATA_HPP
27
28
#include "gc/shared/gc_globals.hpp"
29
#include "runtime/thread.hpp"
30
#include "utilities/debug.hpp"
31
32
class EpsilonThreadLocalData {
33
private:
34
size_t _ergo_tlab_size;
35
int64_t _last_tlab_time;
36
37
EpsilonThreadLocalData() :
38
_ergo_tlab_size(0),
39
_last_tlab_time(0) {}
40
41
static EpsilonThreadLocalData* data(Thread* thread) {
42
assert(UseEpsilonGC, "Sanity");
43
return thread->gc_data<EpsilonThreadLocalData>();
44
}
45
46
public:
47
static void create(Thread* thread) {
48
new (data(thread)) EpsilonThreadLocalData();
49
}
50
51
static void destroy(Thread* thread) {
52
data(thread)->~EpsilonThreadLocalData();
53
}
54
55
static size_t ergo_tlab_size(Thread *thread) {
56
return data(thread)->_ergo_tlab_size;
57
}
58
59
static int64_t last_tlab_time(Thread *thread) {
60
return data(thread)->_last_tlab_time;
61
}
62
63
static void set_ergo_tlab_size(Thread *thread, size_t val) {
64
data(thread)->_ergo_tlab_size = val;
65
}
66
67
static void set_last_tlab_time(Thread *thread, int64_t time) {
68
data(thread)->_last_tlab_time = time;
69
}
70
};
71
72
#endif // SHARE_GC_EPSILON_EPSILONTHREADLOCALDATA_HPP
73
74