author | pliden |
Mon, 18 Mar 2019 11:50:40 +0100 | |
changeset 54167 | d0d26fc836dd |
parent 53921 | a590b6107ab3 |
child 54171 | 07943af21b96 |
permissions | -rw-r--r-- |
53892 | 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 |
#include "gc/z/zLock.hpp" |
|
53921
a590b6107ab3
8218974: Free GC native structures in nmethod::flush
eosterlund
parents:
53892
diff
changeset
|
25 |
#include "memory/allocation.hpp" |
53892 | 26 |
#include "oops/oopsHierarchy.hpp" |
27 |
#include "utilities/globalDefinitions.hpp" |
|
28 |
||
29 |
#ifndef SHARE_GC_Z_ZNMETHODDATA_HPP |
|
30 |
#define SHARE_GC_Z_ZNMETHODDATA_HPP |
|
31 |
||
32 |
class nmethod; |
|
33 |
template <typename T> class GrowableArray; |
|
34 |
||
35 |
class ZNMethodDataOops { |
|
36 |
private: |
|
37 |
const size_t _nimmediates; |
|
38 |
bool _has_non_immediates; |
|
39 |
||
40 |
static size_t header_size(); |
|
41 |
||
42 |
ZNMethodDataOops(const GrowableArray<oop*>& immediates, bool has_non_immediates); |
|
43 |
||
44 |
public: |
|
45 |
static ZNMethodDataOops* create(const GrowableArray<oop*>& immediates, bool has_non_immediates); |
|
46 |
static void destroy(ZNMethodDataOops* oops); |
|
47 |
||
48 |
size_t immediates_count() const; |
|
49 |
oop** immediates_begin() const; |
|
50 |
oop** immediates_end() const; |
|
51 |
||
52 |
bool has_non_immediates() const; |
|
53 |
}; |
|
54 |
||
53921
a590b6107ab3
8218974: Free GC native structures in nmethod::flush
eosterlund
parents:
53892
diff
changeset
|
55 |
class ZNMethodData : public CHeapObj<mtGC> { |
53892 | 56 |
private: |
57 |
ZReentrantLock _lock; |
|
58 |
ZNMethodDataOops* volatile _oops; |
|
59 |
||
60 |
public: |
|
53921
a590b6107ab3
8218974: Free GC native structures in nmethod::flush
eosterlund
parents:
53892
diff
changeset
|
61 |
ZNMethodData(); |
a590b6107ab3
8218974: Free GC native structures in nmethod::flush
eosterlund
parents:
53892
diff
changeset
|
62 |
~ZNMethodData(); |
53892 | 63 |
|
64 |
ZReentrantLock* lock(); |
|
65 |
||
66 |
ZNMethodDataOops* oops() const; |
|
67 |
ZNMethodDataOops* swap_oops(ZNMethodDataOops* oops); |
|
68 |
}; |
|
69 |
||
70 |
#endif // SHARE_GC_Z_ZNMETHODDATA_HPP |