annotate src/share/vm/oops/compiledICHolderKlass.cpp @ 1713:7fcd5f39bd7a

Merge
author johnc
date Sat, 14 Aug 2010 00:47:52 -0700
parents 126ea7725993 9d7a8ab3736b
children f95d63e2154a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a61af66fc99e Initial load
duke
parents:
diff changeset
1 /*
1552
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 1155
diff changeset
2 * Copyright (c) 1998, 2006, 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
a61af66fc99e Initial load
duke
parents:
diff changeset
25 # include "incls/_precompiled.incl"
a61af66fc99e Initial load
duke
parents:
diff changeset
26 # include "incls/_compiledICHolderKlass.cpp.incl"
a61af66fc99e Initial load
duke
parents:
diff changeset
27
a61af66fc99e Initial load
duke
parents:
diff changeset
28 klassOop compiledICHolderKlass::create_klass(TRAPS) {
a61af66fc99e Initial load
duke
parents:
diff changeset
29 compiledICHolderKlass o;
a61af66fc99e Initial load
duke
parents:
diff changeset
30 KlassHandle h_this_klass(THREAD, Universe::klassKlassObj());
a61af66fc99e Initial load
duke
parents:
diff changeset
31 KlassHandle k = base_create_klass(h_this_klass, header_size(), o.vtbl_value(), CHECK_NULL);
a61af66fc99e Initial load
duke
parents:
diff changeset
32 // Make sure size calculation is right
a61af66fc99e Initial load
duke
parents:
diff changeset
33 assert(k()->size() == align_object_size(header_size()), "wrong size for object");
a61af66fc99e Initial load
duke
parents:
diff changeset
34 java_lang_Class::create_mirror(k, CHECK_NULL); // Allocate mirror
a61af66fc99e Initial load
duke
parents:
diff changeset
35 return k();
a61af66fc99e Initial load
duke
parents:
diff changeset
36 }
a61af66fc99e Initial load
duke
parents:
diff changeset
37
a61af66fc99e Initial load
duke
parents:
diff changeset
38
a61af66fc99e Initial load
duke
parents:
diff changeset
39 compiledICHolderOop compiledICHolderKlass::allocate(TRAPS) {
a61af66fc99e Initial load
duke
parents:
diff changeset
40 KlassHandle h_k(THREAD, as_klassOop());
a61af66fc99e Initial load
duke
parents:
diff changeset
41 int size = compiledICHolderOopDesc::object_size();
a61af66fc99e Initial load
duke
parents:
diff changeset
42 compiledICHolderOop c = (compiledICHolderOop)
a61af66fc99e Initial load
duke
parents:
diff changeset
43 CollectedHeap::permanent_obj_allocate(h_k, size, CHECK_NULL);
a61af66fc99e Initial load
duke
parents:
diff changeset
44 c->set_holder_method(NULL);
a61af66fc99e Initial load
duke
parents:
diff changeset
45 c->set_holder_klass(NULL);
a61af66fc99e Initial load
duke
parents:
diff changeset
46 return c;
a61af66fc99e Initial load
duke
parents:
diff changeset
47 }
a61af66fc99e Initial load
duke
parents:
diff changeset
48
a61af66fc99e Initial load
duke
parents:
diff changeset
49
a61af66fc99e Initial load
duke
parents:
diff changeset
50 int compiledICHolderKlass::oop_size(oop obj) const {
a61af66fc99e Initial load
duke
parents:
diff changeset
51 assert(obj->is_compiledICHolder(), "must be compiledICHolder");
a61af66fc99e Initial load
duke
parents:
diff changeset
52 return compiledICHolderOop(obj)->object_size();
a61af66fc99e Initial load
duke
parents:
diff changeset
53 }
a61af66fc99e Initial load
duke
parents:
diff changeset
54
a61af66fc99e Initial load
duke
parents:
diff changeset
55 void compiledICHolderKlass::oop_follow_contents(oop obj) {
a61af66fc99e Initial load
duke
parents:
diff changeset
56 assert(obj->is_compiledICHolder(), "must be compiledICHolder");
a61af66fc99e Initial load
duke
parents:
diff changeset
57 compiledICHolderOop c = compiledICHolderOop(obj);
a61af66fc99e Initial load
duke
parents:
diff changeset
58
a61af66fc99e Initial load
duke
parents:
diff changeset
59 obj->follow_header();
a61af66fc99e Initial load
duke
parents:
diff changeset
60 MarkSweep::mark_and_push(c->adr_holder_method());
a61af66fc99e Initial load
duke
parents:
diff changeset
61 MarkSweep::mark_and_push(c->adr_holder_klass());
a61af66fc99e Initial load
duke
parents:
diff changeset
62 }
a61af66fc99e Initial load
duke
parents:
diff changeset
63
a61af66fc99e Initial load
duke
parents:
diff changeset
64 #ifndef SERIALGC
a61af66fc99e Initial load
duke
parents:
diff changeset
65 void compiledICHolderKlass::oop_follow_contents(ParCompactionManager* cm,
a61af66fc99e Initial load
duke
parents:
diff changeset
66 oop obj) {
a61af66fc99e Initial load
duke
parents:
diff changeset
67 assert(obj->is_compiledICHolder(), "must be compiledICHolder");
a61af66fc99e Initial load
duke
parents:
diff changeset
68 compiledICHolderOop c = compiledICHolderOop(obj);
a61af66fc99e Initial load
duke
parents:
diff changeset
69
a61af66fc99e Initial load
duke
parents:
diff changeset
70 obj->follow_header(cm);
a61af66fc99e Initial load
duke
parents:
diff changeset
71 PSParallelCompact::mark_and_push(cm, c->adr_holder_method());
a61af66fc99e Initial load
duke
parents:
diff changeset
72 PSParallelCompact::mark_and_push(cm, c->adr_holder_klass());
a61af66fc99e Initial load
duke
parents:
diff changeset
73 }
a61af66fc99e Initial load
duke
parents:
diff changeset
74 #endif // SERIALGC
a61af66fc99e Initial load
duke
parents:
diff changeset
75
a61af66fc99e Initial load
duke
parents:
diff changeset
76
a61af66fc99e Initial load
duke
parents:
diff changeset
77 int compiledICHolderKlass::oop_oop_iterate(oop obj, OopClosure* blk) {
a61af66fc99e Initial load
duke
parents:
diff changeset
78 assert(obj->is_compiledICHolder(), "must be compiledICHolder");
a61af66fc99e Initial load
duke
parents:
diff changeset
79 compiledICHolderOop c = compiledICHolderOop(obj);
a61af66fc99e Initial load
duke
parents:
diff changeset
80 // Get size before changing pointers.
a61af66fc99e Initial load
duke
parents:
diff changeset
81 // Don't call size() or oop_size() since that is a virtual call.
a61af66fc99e Initial load
duke
parents:
diff changeset
82 int size = c->object_size();
a61af66fc99e Initial load
duke
parents:
diff changeset
83
a61af66fc99e Initial load
duke
parents:
diff changeset
84 obj->oop_iterate_header(blk);
a61af66fc99e Initial load
duke
parents:
diff changeset
85 blk->do_oop(c->adr_holder_method());
a61af66fc99e Initial load
duke
parents:
diff changeset
86 blk->do_oop(c->adr_holder_klass());
a61af66fc99e Initial load
duke
parents:
diff changeset
87 return size;
a61af66fc99e Initial load
duke
parents:
diff changeset
88 }
a61af66fc99e Initial load
duke
parents:
diff changeset
89
a61af66fc99e Initial load
duke
parents:
diff changeset
90 int compiledICHolderKlass::oop_oop_iterate_m(oop obj, OopClosure* blk,
a61af66fc99e Initial load
duke
parents:
diff changeset
91 MemRegion mr) {
a61af66fc99e Initial load
duke
parents:
diff changeset
92 assert(obj->is_compiledICHolder(), "must be compiledICHolder");
a61af66fc99e Initial load
duke
parents:
diff changeset
93 compiledICHolderOop c = compiledICHolderOop(obj);
a61af66fc99e Initial load
duke
parents:
diff changeset
94 // Get size before changing pointers.
a61af66fc99e Initial load
duke
parents:
diff changeset
95 // Don't call size() or oop_size() since that is a virtual call.
a61af66fc99e Initial load
duke
parents:
diff changeset
96 int size = c->object_size();
a61af66fc99e Initial load
duke
parents:
diff changeset
97
a61af66fc99e Initial load
duke
parents:
diff changeset
98 obj->oop_iterate_header(blk, mr);
a61af66fc99e Initial load
duke
parents:
diff changeset
99
a61af66fc99e Initial load
duke
parents:
diff changeset
100 oop* adr;
a61af66fc99e Initial load
duke
parents:
diff changeset
101 adr = c->adr_holder_method();
a61af66fc99e Initial load
duke
parents:
diff changeset
102 if (mr.contains(adr)) blk->do_oop(adr);
a61af66fc99e Initial load
duke
parents:
diff changeset
103 adr = c->adr_holder_klass();
a61af66fc99e Initial load
duke
parents:
diff changeset
104 if (mr.contains(adr)) blk->do_oop(adr);
a61af66fc99e Initial load
duke
parents:
diff changeset
105 return size;
a61af66fc99e Initial load
duke
parents:
diff changeset
106 }
a61af66fc99e Initial load
duke
parents:
diff changeset
107
a61af66fc99e Initial load
duke
parents:
diff changeset
108
a61af66fc99e Initial load
duke
parents:
diff changeset
109 int compiledICHolderKlass::oop_adjust_pointers(oop obj) {
a61af66fc99e Initial load
duke
parents:
diff changeset
110 assert(obj->is_compiledICHolder(), "must be compiledICHolder");
a61af66fc99e Initial load
duke
parents:
diff changeset
111 compiledICHolderOop c = compiledICHolderOop(obj);
a61af66fc99e Initial load
duke
parents:
diff changeset
112 // Get size before changing pointers.
a61af66fc99e Initial load
duke
parents:
diff changeset
113 // Don't call size() or oop_size() since that is a virtual call.
a61af66fc99e Initial load
duke
parents:
diff changeset
114 int size = c->object_size();
a61af66fc99e Initial load
duke
parents:
diff changeset
115
a61af66fc99e Initial load
duke
parents:
diff changeset
116 MarkSweep::adjust_pointer(c->adr_holder_method());
a61af66fc99e Initial load
duke
parents:
diff changeset
117 MarkSweep::adjust_pointer(c->adr_holder_klass());
a61af66fc99e Initial load
duke
parents:
diff changeset
118 obj->adjust_header();
a61af66fc99e Initial load
duke
parents:
diff changeset
119 return size;
a61af66fc99e Initial load
duke
parents:
diff changeset
120 }
a61af66fc99e Initial load
duke
parents:
diff changeset
121
a61af66fc99e Initial load
duke
parents:
diff changeset
122 #ifndef SERIALGC
a61af66fc99e Initial load
duke
parents:
diff changeset
123 void compiledICHolderKlass::oop_push_contents(PSPromotionManager* pm, oop obj) {
a61af66fc99e Initial load
duke
parents:
diff changeset
124 assert(obj->is_compiledICHolder(), "must be compiledICHolder");
a61af66fc99e Initial load
duke
parents:
diff changeset
125 }
a61af66fc99e Initial load
duke
parents:
diff changeset
126
a61af66fc99e Initial load
duke
parents:
diff changeset
127 int compiledICHolderKlass::oop_update_pointers(ParCompactionManager* cm,
a61af66fc99e Initial load
duke
parents:
diff changeset
128 oop obj) {
a61af66fc99e Initial load
duke
parents:
diff changeset
129 assert(obj->is_compiledICHolder(), "must be compiledICHolder");
a61af66fc99e Initial load
duke
parents:
diff changeset
130 compiledICHolderOop c = compiledICHolderOop(obj);
a61af66fc99e Initial load
duke
parents:
diff changeset
131
a61af66fc99e Initial load
duke
parents:
diff changeset
132 PSParallelCompact::adjust_pointer(c->adr_holder_method());
a61af66fc99e Initial load
duke
parents:
diff changeset
133 PSParallelCompact::adjust_pointer(c->adr_holder_klass());
a61af66fc99e Initial load
duke
parents:
diff changeset
134 return c->object_size();
a61af66fc99e Initial load
duke
parents:
diff changeset
135 }
a61af66fc99e Initial load
duke
parents:
diff changeset
136
a61af66fc99e Initial load
duke
parents:
diff changeset
137 int compiledICHolderKlass::oop_update_pointers(ParCompactionManager* cm,
a61af66fc99e Initial load
duke
parents:
diff changeset
138 oop obj,
a61af66fc99e Initial load
duke
parents:
diff changeset
139 HeapWord* beg_addr,
a61af66fc99e Initial load
duke
parents:
diff changeset
140 HeapWord* end_addr) {
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 oop* p;
a61af66fc99e Initial load
duke
parents:
diff changeset
145 p = c->adr_holder_method();
a61af66fc99e Initial load
duke
parents:
diff changeset
146 PSParallelCompact::adjust_pointer(p, beg_addr, end_addr);
a61af66fc99e Initial load
duke
parents:
diff changeset
147 p = c->adr_holder_klass();
a61af66fc99e Initial load
duke
parents:
diff changeset
148 PSParallelCompact::adjust_pointer(p, beg_addr, end_addr);
a61af66fc99e Initial load
duke
parents:
diff changeset
149 return c->object_size();
a61af66fc99e Initial load
duke
parents:
diff changeset
150 }
a61af66fc99e Initial load
duke
parents:
diff changeset
151 #endif // SERIALGC
a61af66fc99e Initial load
duke
parents:
diff changeset
152
a61af66fc99e Initial load
duke
parents:
diff changeset
153 // Printing
a61af66fc99e Initial load
duke
parents:
diff changeset
154
a61af66fc99e Initial load
duke
parents:
diff changeset
155 void compiledICHolderKlass::oop_print_on(oop obj, outputStream* st) {
a61af66fc99e Initial load
duke
parents:
diff changeset
156 assert(obj->is_compiledICHolder(), "must be compiledICHolder");
a61af66fc99e Initial load
duke
parents:
diff changeset
157 Klass::oop_print_on(obj, st);
a61af66fc99e Initial load
duke
parents:
diff changeset
158 compiledICHolderOop c = compiledICHolderOop(obj);
a61af66fc99e Initial load
duke
parents:
diff changeset
159 st->print(" - method: "); c->holder_method()->print_value_on(st); st->cr();
a61af66fc99e Initial load
duke
parents:
diff changeset
160 st->print(" - klass: "); c->holder_klass()->print_value_on(st); st->cr();
a61af66fc99e Initial load
duke
parents:
diff changeset
161 }
a61af66fc99e Initial load
duke
parents:
diff changeset
162
a61af66fc99e Initial load
duke
parents:
diff changeset
163 void compiledICHolderKlass::oop_print_value_on(oop obj, outputStream* st) {
a61af66fc99e Initial load
duke
parents:
diff changeset
164 assert(obj->is_compiledICHolder(), "must be compiledICHolder");
a61af66fc99e Initial load
duke
parents:
diff changeset
165 Klass::oop_print_value_on(obj, st);
a61af66fc99e Initial load
duke
parents:
diff changeset
166 }
a61af66fc99e Initial load
duke
parents:
diff changeset
167
a61af66fc99e Initial load
duke
parents:
diff changeset
168 const char* compiledICHolderKlass::internal_name() const {
a61af66fc99e Initial load
duke
parents:
diff changeset
169 return "{compiledICHolder}";
a61af66fc99e Initial load
duke
parents:
diff changeset
170 }
a61af66fc99e Initial load
duke
parents:
diff changeset
171
a61af66fc99e Initial load
duke
parents:
diff changeset
172 // Verification
a61af66fc99e Initial load
duke
parents:
diff changeset
173
a61af66fc99e Initial load
duke
parents:
diff changeset
174 void compiledICHolderKlass::oop_verify_on(oop obj, outputStream* st) {
a61af66fc99e Initial load
duke
parents:
diff changeset
175 Klass::oop_verify_on(obj, st);
a61af66fc99e Initial load
duke
parents:
diff changeset
176 guarantee(obj->is_compiledICHolder(), "must be compiledICHolder");
a61af66fc99e Initial load
duke
parents:
diff changeset
177 compiledICHolderOop c = compiledICHolderOop(obj);
a61af66fc99e Initial load
duke
parents:
diff changeset
178 guarantee(c->is_perm(), "should be in permspace");
a61af66fc99e Initial load
duke
parents:
diff changeset
179 guarantee(c->holder_method()->is_perm(), "should be in permspace");
a61af66fc99e Initial load
duke
parents:
diff changeset
180 guarantee(c->holder_method()->is_method(), "should be method");
a61af66fc99e Initial load
duke
parents:
diff changeset
181 guarantee(c->holder_klass()->is_perm(), "should be in permspace");
a61af66fc99e Initial load
duke
parents:
diff changeset
182 guarantee(c->holder_klass()->is_klass(), "should be klass");
a61af66fc99e Initial load
duke
parents:
diff changeset
183 }