author | stefank |
Tue, 28 Nov 2017 21:43:45 +0100 | |
changeset 48157 | 7c4d43c26352 |
parent 47216 | 71c04702a3d5 |
child 51444 | 3e5d28e6de32 |
permissions | -rw-r--r-- |
34666 | 1 |
/* |
46329
53ccc37bda19
8155672: Remove instanceKlassHandles and KlassHandles
coleenp
parents:
41182
diff
changeset
|
2 |
* Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. |
34666 | 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_VM_CLASSFILE_KLASSFACTORY_HPP |
|
26 |
#define SHARE_VM_CLASSFILE_KLASSFACTORY_HPP |
|
27 |
||
48157 | 28 |
#include "memory/allocation.hpp" |
34666 | 29 |
#include "runtime/handles.hpp" |
30 |
||
31 |
class ClassFileStream; |
|
32 |
class ClassLoaderData; |
|
33 |
template <typename> |
|
34 |
class GrowableArray; |
|
35 |
class Klass; |
|
36 |
class Symbol; |
|
37 |
class TempNewSymbol; |
|
38 |
||
39 |
/* |
|
40 |
* KlassFactory is an interface to implementations of the following mapping/function: |
|
41 |
* |
|
42 |
* Summary: create a VM internal runtime representation ("Klass") |
|
43 |
from a bytestream (classfile). |
|
44 |
* |
|
45 |
* Input: a named bytestream in the Java class file format (see JVMS, chapter 4). |
|
46 |
* Output: a VM runtime representation of a Java class |
|
47 |
* |
|
48 |
* Pre-conditions: |
|
49 |
* a non-NULL ClassFileStream* // the classfile bytestream |
|
50 |
* a non-NULL Symbol* // the name of the class |
|
51 |
* a non-NULL ClassLoaderData* // the metaspace allocator |
|
52 |
* (no pending exceptions) |
|
53 |
* |
|
54 |
* Returns: |
|
55 |
* if the returned value is non-NULL, that value is an indirection (pointer/handle) |
|
56 |
* to a Klass. The caller will not have a pending exception. |
|
57 |
* |
|
58 |
* On broken invariants and/or runtime errors the returned value will be |
|
59 |
* NULL (or a NULL handle) and the caller *might* now have a pending exception. |
|
60 |
* |
|
61 |
*/ |
|
62 |
||
63 |
class KlassFactory : AllStatic { |
|
64 |
||
65 |
// approved clients |
|
66 |
friend class ClassLoader; |
|
67 |
friend class ClassLoaderExt; |
|
68 |
friend class SystemDictionary; |
|
69 |
||
70 |
private: |
|
46329
53ccc37bda19
8155672: Remove instanceKlassHandles and KlassHandles
coleenp
parents:
41182
diff
changeset
|
71 |
static InstanceKlass* create_from_stream(ClassFileStream* stream, |
53ccc37bda19
8155672: Remove instanceKlassHandles and KlassHandles
coleenp
parents:
41182
diff
changeset
|
72 |
Symbol* name, |
53ccc37bda19
8155672: Remove instanceKlassHandles and KlassHandles
coleenp
parents:
41182
diff
changeset
|
73 |
ClassLoaderData* loader_data, |
53ccc37bda19
8155672: Remove instanceKlassHandles and KlassHandles
coleenp
parents:
41182
diff
changeset
|
74 |
Handle protection_domain, |
53ccc37bda19
8155672: Remove instanceKlassHandles and KlassHandles
coleenp
parents:
41182
diff
changeset
|
75 |
const InstanceKlass* host_klass, |
53ccc37bda19
8155672: Remove instanceKlassHandles and KlassHandles
coleenp
parents:
41182
diff
changeset
|
76 |
GrowableArray<Handle>* cp_patches, |
53ccc37bda19
8155672: Remove instanceKlassHandles and KlassHandles
coleenp
parents:
41182
diff
changeset
|
77 |
TRAPS); |
41182 | 78 |
public: |
46329
53ccc37bda19
8155672: Remove instanceKlassHandles and KlassHandles
coleenp
parents:
41182
diff
changeset
|
79 |
static InstanceKlass* check_shared_class_file_load_hook( |
53ccc37bda19
8155672: Remove instanceKlassHandles and KlassHandles
coleenp
parents:
41182
diff
changeset
|
80 |
InstanceKlass* ik, |
41182 | 81 |
Symbol* class_name, |
82 |
Handle class_loader, |
|
83 |
Handle protection_domain, TRAPS); |
|
34666 | 84 |
}; |
85 |
||
86 |
#endif // SHARE_VM_CLASSFILE_KLASSFACTORY_HPP |