annotate src/share/vm/oops/compiledICHolderKlass.cpp @ 1972:f95d63e2154a

6989984: Use standard include model for Hospot Summary: Replaced MakeDeps and the includeDB files with more standardized solutions. Reviewed-by: coleenp, kvn, kamg
author stefank
date Tue, 23 Nov 2010 13:22:55 -0800
parents 7fcd5f39bd7a
children e5383553fd4e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a61af66fc99e Initial load
duke
parents:
diff changeset
1 /*
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1713
diff changeset
2 * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
0
a61af66fc99e Initial load
duke
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
a61af66fc99e Initial load
duke
parents:
diff changeset
4 *
a61af66fc99e Initial load
duke
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
a61af66fc99e Initial load
duke
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
a61af66fc99e Initial load
duke
parents:
diff changeset
7 * published by the Free Software Foundation.
a61af66fc99e Initial load
duke
parents:
diff changeset
8 *
a61af66fc99e Initial load
duke
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
a61af66fc99e Initial load
duke
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
a61af66fc99e Initial load
duke
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
a61af66fc99e Initial load
duke
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
a61af66fc99e Initial load
duke
parents:
diff changeset
13 * accompanied this code).
a61af66fc99e Initial load
duke
parents:
diff changeset
14 *
a61af66fc99e Initial load
duke
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
a61af66fc99e Initial load
duke
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
a61af66fc99e Initial load
duke
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
a61af66fc99e Initial load
duke
parents:
diff changeset
18 *
1552
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 1155
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 1155
diff changeset
20 * or visit www.oracle.com if you need additional information or have any
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 1155
diff changeset
21 * questions.
0
a61af66fc99e Initial load
duke
parents:
diff changeset
22 *
a61af66fc99e Initial load
duke
parents:
diff changeset
23 */
a61af66fc99e Initial load
duke
parents:
diff changeset
24
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1713
diff changeset
25 #include "precompiled.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1713
diff changeset
26 #include "classfile/javaClasses.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1713
diff changeset
27 #include "gc_implementation/shared/markSweep.inline.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1713
diff changeset
28 #include "gc_interface/collectedHeap.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1713
diff changeset
29 #include "gc_interface/collectedHeap.inline.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1713
diff changeset
30 #include "memory/permGen.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1713
diff changeset
31 #include "memory/universe.inline.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1713
diff changeset
32 #include "oops/compiledICHolderKlass.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1713
diff changeset
33 #include "oops/oop.inline.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1713
diff changeset
34 #include "oops/oop.inline2.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1713
diff changeset
35 #include "runtime/handles.inline.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1713
diff changeset
36 #ifndef SERIALGC
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1713
diff changeset
37 #include "oops/oop.pcgc.inline.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1713
diff changeset
38 #endif
0
a61af66fc99e Initial load
duke
parents:
diff changeset
39
a61af66fc99e Initial load
duke
parents:
diff changeset
40 klassOop compiledICHolderKlass::create_klass(TRAPS) {
a61af66fc99e Initial load
duke
parents:
diff changeset
41 compiledICHolderKlass o;
a61af66fc99e Initial load
duke
parents:
diff changeset
42 KlassHandle h_this_klass(THREAD, Universe::klassKlassObj());
a61af66fc99e Initial load
duke
parents:
diff changeset
43 KlassHandle k = base_create_klass(h_this_klass, header_size(), o.vtbl_value(), CHECK_NULL);
a61af66fc99e Initial load
duke
parents:
diff changeset
44 // Make sure size calculation is right
a61af66fc99e Initial load
duke
parents:
diff changeset
45 assert(k()->size() == align_object_size(header_size()), "wrong size for object");
a61af66fc99e Initial load
duke
parents:
diff changeset
46 java_lang_Class::create_mirror(k, CHECK_NULL); // Allocate mirror
a61af66fc99e Initial load
duke
parents:
diff changeset
47 return k();
a61af66fc99e Initial load
duke
parents:
diff changeset
48 }
a61af66fc99e Initial load
duke
parents:
diff changeset
49
a61af66fc99e Initial load
duke
parents:
diff changeset
50
a61af66fc99e Initial load
duke
parents:
diff changeset
51 compiledICHolderOop compiledICHolderKlass::allocate(TRAPS) {
a61af66fc99e Initial load
duke
parents:
diff changeset
52 KlassHandle h_k(THREAD, as_klassOop());
a61af66fc99e Initial load
duke
parents:
diff changeset
53 int size = compiledICHolderOopDesc::object_size();
a61af66fc99e Initial load
duke
parents:
diff changeset
54 compiledICHolderOop c = (compiledICHolderOop)
a61af66fc99e Initial load
duke
parents:
diff changeset
55 CollectedHeap::permanent_obj_allocate(h_k, size, CHECK_NULL);
a61af66fc99e Initial load
duke
parents:
diff changeset
56 c->set_holder_method(NULL);
a61af66fc99e Initial load
duke
parents:
diff changeset
57 c->set_holder_klass(NULL);
a61af66fc99e Initial load
duke
parents:
diff changeset
58 return c;
a61af66fc99e Initial load
duke
parents:
diff changeset
59 }
a61af66fc99e Initial load
duke
parents:
diff changeset
60
a61af66fc99e Initial load
duke
parents:
diff changeset
61
a61af66fc99e Initial load
duke
parents:
diff changeset
62 int compiledICHolderKlass::oop_size(oop obj) const {
a61af66fc99e Initial load
duke
parents:
diff changeset
63 assert(obj->is_compiledICHolder(), "must be compiledICHolder");
a61af66fc99e Initial load
duke
parents:
diff changeset
64 return compiledICHolderOop(obj)->object_size();
a61af66fc99e Initial load
duke
parents:
diff changeset
65 }
a61af66fc99e Initial load
duke
parents:
diff changeset
66
a61af66fc99e Initial load
duke
parents:
diff changeset
67 void compiledICHolderKlass::oop_follow_contents(oop obj) {
a61af66fc99e Initial load
duke
parents:
diff changeset
68 assert(obj->is_compiledICHolder(), "must be compiledICHolder");
a61af66fc99e Initial load
duke
parents:
diff changeset
69 compiledICHolderOop c = compiledICHolderOop(obj);
a61af66fc99e Initial load
duke
parents:
diff changeset
70
a61af66fc99e Initial load
duke
parents:
diff changeset
71 obj->follow_header();
a61af66fc99e Initial load
duke
parents:
diff changeset
72 MarkSweep::mark_and_push(c->adr_holder_method());
a61af66fc99e Initial load
duke
parents:
diff changeset
73 MarkSweep::mark_and_push(c->adr_holder_klass());
a61af66fc99e Initial load
duke
parents:
diff changeset
74 }
a61af66fc99e Initial load
duke
parents:
diff changeset
75
a61af66fc99e Initial load
duke
parents:
diff changeset
76 #ifndef SERIALGC
a61af66fc99e Initial load
duke
parents:
diff changeset
77 void compiledICHolderKlass::oop_follow_contents(ParCompactionManager* cm,
a61af66fc99e Initial load
duke
parents:
diff changeset
78 oop obj) {
a61af66fc99e Initial load
duke
parents:
diff changeset
79 assert(obj->is_compiledICHolder(), "must be compiledICHolder");
a61af66fc99e Initial load
duke
parents:
diff changeset
80 compiledICHolderOop c = compiledICHolderOop(obj);
a61af66fc99e Initial load
duke
parents:
diff changeset
81
a61af66fc99e Initial load
duke
parents:
diff changeset
82 obj->follow_header(cm);
a61af66fc99e Initial load
duke
parents:
diff changeset
83 PSParallelCompact::mark_and_push(cm, c->adr_holder_method());
a61af66fc99e Initial load
duke
parents:
diff changeset
84 PSParallelCompact::mark_and_push(cm, c->adr_holder_klass());
a61af66fc99e Initial load
duke
parents:
diff changeset
85 }
a61af66fc99e Initial load
duke
parents:
diff changeset
86 #endif // SERIALGC
a61af66fc99e Initial load
duke
parents:
diff changeset
87
a61af66fc99e Initial load
duke
parents:
diff changeset
88
a61af66fc99e Initial load
duke
parents:
diff changeset
89 int compiledICHolderKlass::oop_oop_iterate(oop obj, OopClosure* blk) {
a61af66fc99e Initial load
duke
parents:
diff changeset
90 assert(obj->is_compiledICHolder(), "must be compiledICHolder");
a61af66fc99e Initial load
duke
parents:
diff changeset
91 compiledICHolderOop c = compiledICHolderOop(obj);
a61af66fc99e Initial load
duke
parents:
diff changeset
92 // Get size before changing pointers.
a61af66fc99e Initial load
duke
parents:
diff changeset
93 // Don't call size() or oop_size() since that is a virtual call.
a61af66fc99e Initial load
duke
parents:
diff changeset
94 int size = c->object_size();
a61af66fc99e Initial load
duke
parents:
diff changeset
95
a61af66fc99e Initial load
duke
parents:
diff changeset
96 obj->oop_iterate_header(blk);
a61af66fc99e Initial load
duke
parents:
diff changeset
97 blk->do_oop(c->adr_holder_method());
a61af66fc99e Initial load
duke
parents:
diff changeset
98 blk->do_oop(c->adr_holder_klass());
a61af66fc99e Initial load
duke
parents:
diff changeset
99 return size;
a61af66fc99e Initial load
duke
parents:
diff changeset
100 }
a61af66fc99e Initial load
duke
parents:
diff changeset
101
a61af66fc99e Initial load
duke
parents:
diff changeset
102 int compiledICHolderKlass::oop_oop_iterate_m(oop obj, OopClosure* blk,
a61af66fc99e Initial load
duke
parents:
diff changeset
103 MemRegion mr) {
a61af66fc99e Initial load
duke
parents:
diff changeset
104 assert(obj->is_compiledICHolder(), "must be compiledICHolder");
a61af66fc99e Initial load
duke
parents:
diff changeset
105 compiledICHolderOop c = compiledICHolderOop(obj);
a61af66fc99e Initial load
duke
parents:
diff changeset
106 // Get size before changing pointers.
a61af66fc99e Initial load
duke
parents:
diff changeset
107 // Don't call size() or oop_size() since that is a virtual call.
a61af66fc99e Initial load
duke
parents:
diff changeset
108 int size = c->object_size();
a61af66fc99e Initial load
duke
parents:
diff changeset
109
a61af66fc99e Initial load
duke
parents:
diff changeset
110 obj->oop_iterate_header(blk, mr);
a61af66fc99e Initial load
duke
parents:
diff changeset
111
a61af66fc99e Initial load
duke
parents:
diff changeset
112 oop* adr;
a61af66fc99e Initial load
duke
parents:
diff changeset
113 adr = c->adr_holder_method();
a61af66fc99e Initial load
duke
parents:
diff changeset
114 if (mr.contains(adr)) blk->do_oop(adr);
a61af66fc99e Initial load
duke
parents:
diff changeset
115 adr = c->adr_holder_klass();
a61af66fc99e Initial load
duke
parents:
diff changeset
116 if (mr.contains(adr)) blk->do_oop(adr);
a61af66fc99e Initial load
duke
parents:
diff changeset
117 return size;
a61af66fc99e Initial load
duke
parents:
diff changeset
118 }
a61af66fc99e Initial load
duke
parents:
diff changeset
119
a61af66fc99e Initial load
duke
parents:
diff changeset
120
a61af66fc99e Initial load
duke
parents:
diff changeset
121 int compiledICHolderKlass::oop_adjust_pointers(oop obj) {
a61af66fc99e Initial load
duke
parents:
diff changeset
122 assert(obj->is_compiledICHolder(), "must be compiledICHolder");
a61af66fc99e Initial load
duke
parents:
diff changeset
123 compiledICHolderOop c = compiledICHolderOop(obj);
a61af66fc99e Initial load
duke
parents:
diff changeset
124 // Get size before changing pointers.
a61af66fc99e Initial load
duke
parents:
diff changeset
125 // Don't call size() or oop_size() since that is a virtual call.
a61af66fc99e Initial load
duke
parents:
diff changeset
126 int size = c->object_size();
a61af66fc99e Initial load
duke
parents:
diff changeset
127
a61af66fc99e Initial load
duke
parents:
diff changeset
128 MarkSweep::adjust_pointer(c->adr_holder_method());
a61af66fc99e Initial load
duke
parents:
diff changeset
129 MarkSweep::adjust_pointer(c->adr_holder_klass());
a61af66fc99e Initial load
duke
parents:
diff changeset
130 obj->adjust_header();
a61af66fc99e Initial load
duke
parents:
diff changeset
131 return size;
a61af66fc99e Initial load
duke
parents:
diff changeset
132 }
a61af66fc99e Initial load
duke
parents:
diff changeset
133
a61af66fc99e Initial load
duke
parents:
diff changeset
134 #ifndef SERIALGC
a61af66fc99e Initial load
duke
parents:
diff changeset
135 void compiledICHolderKlass::oop_push_contents(PSPromotionManager* pm, oop obj) {
a61af66fc99e Initial load
duke
parents:
diff changeset
136 assert(obj->is_compiledICHolder(), "must be compiledICHolder");
a61af66fc99e Initial load
duke
parents:
diff changeset
137 }
a61af66fc99e Initial load
duke
parents:
diff changeset
138
a61af66fc99e Initial load
duke
parents:
diff changeset
139 int compiledICHolderKlass::oop_update_pointers(ParCompactionManager* cm,
a61af66fc99e Initial load
duke
parents:
diff changeset
140 oop obj) {
a61af66fc99e Initial load
duke
parents:
diff changeset
141 assert(obj->is_compiledICHolder(), "must be compiledICHolder");
a61af66fc99e Initial load
duke
parents:
diff changeset
142 compiledICHolderOop c = compiledICHolderOop(obj);
a61af66fc99e Initial load
duke
parents:
diff changeset
143
a61af66fc99e Initial load
duke
parents:
diff changeset
144 PSParallelCompact::adjust_pointer(c->adr_holder_method());
a61af66fc99e Initial load
duke
parents:
diff changeset
145 PSParallelCompact::adjust_pointer(c->adr_holder_klass());
a61af66fc99e Initial load
duke
parents:
diff changeset
146 return c->object_size();
a61af66fc99e Initial load
duke
parents:
diff changeset
147 }
a61af66fc99e Initial load
duke
parents:
diff changeset
148
a61af66fc99e Initial load
duke
parents:
diff changeset
149 int compiledICHolderKlass::oop_update_pointers(ParCompactionManager* cm,
a61af66fc99e Initial load
duke
parents:
diff changeset
150 oop obj,
a61af66fc99e Initial load
duke
parents:
diff changeset
151 HeapWord* beg_addr,
a61af66fc99e Initial load
duke
parents:
diff changeset
152 HeapWord* end_addr) {
a61af66fc99e Initial load
duke
parents:
diff changeset
153 assert(obj->is_compiledICHolder(), "must be compiledICHolder");
a61af66fc99e Initial load
duke
parents:
diff changeset
154 compiledICHolderOop c = compiledICHolderOop(obj);
a61af66fc99e Initial load
duke
parents:
diff changeset
155
a61af66fc99e Initial load
duke
parents:
diff changeset
156 oop* p;
a61af66fc99e Initial load
duke
parents:
diff changeset
157 p = c->adr_holder_method();
a61af66fc99e Initial load
duke
parents:
diff changeset
158 PSParallelCompact::adjust_pointer(p, beg_addr, end_addr);
a61af66fc99e Initial load
duke
parents:
diff changeset
159 p = c->adr_holder_klass();
a61af66fc99e Initial load
duke
parents:
diff changeset
160 PSParallelCompact::adjust_pointer(p, beg_addr, end_addr);
a61af66fc99e Initial load
duke
parents:
diff changeset
161 return c->object_size();
a61af66fc99e Initial load
duke
parents:
diff changeset
162 }
a61af66fc99e Initial load
duke
parents:
diff changeset
163 #endif // SERIALGC
a61af66fc99e Initial load
duke
parents:
diff changeset
164
a61af66fc99e Initial load
duke
parents:
diff changeset
165 // Printing
a61af66fc99e Initial load
duke
parents:
diff changeset
166
a61af66fc99e Initial load
duke
parents:
diff changeset
167 void compiledICHolderKlass::oop_print_on(oop obj, outputStream* st) {
a61af66fc99e Initial load
duke
parents:
diff changeset
168 assert(obj->is_compiledICHolder(), "must be compiledICHolder");
a61af66fc99e Initial load
duke
parents:
diff changeset
169 Klass::oop_print_on(obj, st);
a61af66fc99e Initial load
duke
parents:
diff changeset
170 compiledICHolderOop c = compiledICHolderOop(obj);
a61af66fc99e Initial load
duke
parents:
diff changeset
171 st->print(" - method: "); c->holder_method()->print_value_on(st); st->cr();
a61af66fc99e Initial load
duke
parents:
diff changeset
172 st->print(" - klass: "); c->holder_klass()->print_value_on(st); st->cr();
a61af66fc99e Initial load
duke
parents:
diff changeset
173 }
a61af66fc99e Initial load
duke
parents:
diff changeset
174
a61af66fc99e Initial load
duke
parents:
diff changeset
175 void compiledICHolderKlass::oop_print_value_on(oop obj, outputStream* st) {
a61af66fc99e Initial load
duke
parents:
diff changeset
176 assert(obj->is_compiledICHolder(), "must be compiledICHolder");
a61af66fc99e Initial load
duke
parents:
diff changeset
177 Klass::oop_print_value_on(obj, st);
a61af66fc99e Initial load
duke
parents:
diff changeset
178 }
a61af66fc99e Initial load
duke
parents:
diff changeset
179
a61af66fc99e Initial load
duke
parents:
diff changeset
180 const char* compiledICHolderKlass::internal_name() const {
a61af66fc99e Initial load
duke
parents:
diff changeset
181 return "{compiledICHolder}";
a61af66fc99e Initial load
duke
parents:
diff changeset
182 }
a61af66fc99e Initial load
duke
parents:
diff changeset
183
a61af66fc99e Initial load
duke
parents:
diff changeset
184 // Verification
a61af66fc99e Initial load
duke
parents:
diff changeset
185
a61af66fc99e Initial load
duke
parents:
diff changeset
186 void compiledICHolderKlass::oop_verify_on(oop obj, outputStream* st) {
a61af66fc99e Initial load
duke
parents:
diff changeset
187 Klass::oop_verify_on(obj, st);
a61af66fc99e Initial load
duke
parents:
diff changeset
188 guarantee(obj->is_compiledICHolder(), "must be compiledICHolder");
a61af66fc99e Initial load
duke
parents:
diff changeset
189 compiledICHolderOop c = compiledICHolderOop(obj);
a61af66fc99e Initial load
duke
parents:
diff changeset
190 guarantee(c->is_perm(), "should be in permspace");
a61af66fc99e Initial load
duke
parents:
diff changeset
191 guarantee(c->holder_method()->is_perm(), "should be in permspace");
a61af66fc99e Initial load
duke
parents:
diff changeset
192 guarantee(c->holder_method()->is_method(), "should be method");
a61af66fc99e Initial load
duke
parents:
diff changeset
193 guarantee(c->holder_klass()->is_perm(), "should be in permspace");
a61af66fc99e Initial load
duke
parents:
diff changeset
194 guarantee(c->holder_klass()->is_klass(), "should be klass");
a61af66fc99e Initial load
duke
parents:
diff changeset
195 }