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