author | trims |
Thu, 27 May 2010 19:08:38 -0700 | |
changeset 5547 | f4b087cbb361 |
parent 4567 | 7fc02fbe5c7a |
child 7397 | 5b173b4ca846 |
permissions | -rw-r--r-- |
1 | 1 |
/* |
5547
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
4567
diff
changeset
|
2 |
* Copyright (c) 1999, 2009, Oracle and/or its affiliates. All rights reserved. |
1 | 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 |
* |
|
5547
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
4567
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
4567
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
4567
diff
changeset
|
21 |
* questions. |
1 | 22 |
* |
23 |
*/ |
|
24 |
||
25 |
// ciKlass |
|
26 |
// |
|
27 |
// This class and its subclasses represent klassOops in the |
|
28 |
// HotSpot virtual machine. In the vm, each klassOop contains an |
|
29 |
// embedded Klass object. ciKlass is subclassed to explicitly |
|
30 |
// represent the kind of Klass embedded in the klassOop. For |
|
31 |
// example, a klassOop with an embedded objArrayKlass object is |
|
32 |
// represented in the ciObject hierarchy by the class |
|
33 |
// ciObjArrayKlass. |
|
34 |
class ciKlass : public ciType { |
|
35 |
CI_PACKAGE_ACCESS |
|
36 |
friend class ciEnv; |
|
37 |
friend class ciField; |
|
38 |
friend class ciMethod; |
|
39 |
friend class ciObjArrayKlass; |
|
40 |
||
41 |
private: |
|
42 |
ciSymbol* _name; |
|
43 |
jint _layout_helper; |
|
44 |
||
45 |
protected: |
|
46 |
ciKlass(KlassHandle k_h, ciSymbol* name); |
|
47 |
ciKlass(ciSymbol* name, ciKlass* klass); |
|
48 |
||
49 |
klassOop get_klassOop() const { |
|
50 |
klassOop k = (klassOop)get_oop(); |
|
51 |
assert(k != NULL, "illegal use of unloaded klass"); |
|
52 |
return k; |
|
53 |
} |
|
54 |
||
55 |
Klass* get_Klass() const { return get_klassOop()->klass_part(); } |
|
56 |
||
57 |
// Certain subklasses have an associated class loader. |
|
58 |
virtual oop loader() { return NULL; } |
|
59 |
virtual jobject loader_handle() { return NULL; } |
|
60 |
||
61 |
virtual oop protection_domain() { return NULL; } |
|
62 |
virtual jobject protection_domain_handle() { return NULL; } |
|
63 |
||
64 |
const char* type_string() { return "ciKlass"; } |
|
65 |
||
66 |
void print_impl(outputStream* st); |
|
67 |
||
68 |
public: |
|
69 |
ciKlass(KlassHandle k_h); |
|
70 |
||
71 |
// What is the name of this klass? |
|
4567
7fc02fbe5c7a
6893268: additional dynamic language related optimizations in C2
twisti
parents:
1
diff
changeset
|
72 |
ciSymbol* name() const { return _name; } |
1 | 73 |
|
74 |
// What is its layout helper value? |
|
75 |
jint layout_helper() { return _layout_helper; } |
|
76 |
||
77 |
bool is_subtype_of(ciKlass* klass); |
|
78 |
bool is_subclass_of(ciKlass* klass); |
|
79 |
juint super_depth(); |
|
80 |
juint super_check_offset(); |
|
81 |
ciKlass* super_of_depth(juint i); |
|
82 |
bool can_be_primary_super(); |
|
83 |
static juint primary_super_limit() { return Klass::primary_super_limit(); } |
|
84 |
||
85 |
// Get the shared parent of two klasses. |
|
86 |
ciKlass* least_common_ancestor(ciKlass* k); |
|
87 |
||
88 |
virtual bool is_interface() { |
|
89 |
return false; |
|
90 |
} |
|
91 |
||
92 |
virtual bool is_abstract() { |
|
93 |
return false; |
|
94 |
} |
|
95 |
||
96 |
// Does this type (array, class, interface) have no subtypes? |
|
97 |
virtual bool is_leaf_type() { |
|
98 |
return false; |
|
99 |
} |
|
100 |
||
101 |
// Attempt to get a klass using this ciKlass's loader. |
|
102 |
ciKlass* find_klass(ciSymbol* klass_name); |
|
103 |
// Note: To find a class from its name string, use ciSymbol::make, |
|
104 |
// but consider adding to vmSymbols.hpp instead. |
|
105 |
||
106 |
// Get the instance of java.lang.Class corresponding to this klass. |
|
107 |
ciInstance* java_mirror(); |
|
108 |
||
109 |
// Fetch Klass::modifier_flags. |
|
110 |
jint modifier_flags(); |
|
111 |
||
112 |
// Fetch Klass::access_flags. |
|
113 |
jint access_flags(); |
|
114 |
||
115 |
// What kind of ciObject is this? |
|
116 |
bool is_klass() { return true; } |
|
117 |
||
118 |
void print_name_on(outputStream* st); |
|
119 |
}; |