annotate src/share/vm/oops/objArrayKlass.hpp @ 196:d1605aabd0a1

6719955: Update copyright year Summary: Update copyright year for files that have been modified in 2008 Reviewed-by: ohair, tbell
author xdono
date Wed, 02 Jul 2008 12:55:16 -0700
parents ba764ed4b6f2
children 1ee8caae33af
rev   line source
duke@0 1 /*
xdono@196 2 * Copyright 1997-2008 Sun Microsystems, Inc. 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 *
duke@0 19 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
duke@0 20 * CA 95054 USA or visit www.sun.com if you need additional information or
duke@0 21 * have any questions.
duke@0 22 *
duke@0 23 */
duke@0 24
duke@0 25 // objArrayKlass is the klass for objArrays
duke@0 26
duke@0 27 class objArrayKlass : public arrayKlass {
duke@0 28 friend class VMStructs;
duke@0 29 private:
duke@0 30 klassOop _element_klass; // The klass of the elements of this array type
duke@0 31 klassOop _bottom_klass; // The one-dimensional type (instanceKlass or typeArrayKlass)
duke@0 32 public:
duke@0 33 // Instance variables
duke@0 34 klassOop element_klass() const { return _element_klass; }
duke@0 35 void set_element_klass(klassOop k) { oop_store_without_check((oop*) &_element_klass, (oop) k); }
duke@0 36 oop* element_klass_addr() { return (oop*)&_element_klass; }
duke@0 37
duke@0 38 klassOop bottom_klass() const { return _bottom_klass; }
duke@0 39 void set_bottom_klass(klassOop k) { oop_store_without_check((oop*) &_bottom_klass, (oop) k); }
duke@0 40 oop* bottom_klass_addr() { return (oop*)&_bottom_klass; }
duke@0 41
duke@0 42 // Compiler/Interpreter offset
duke@0 43 static int element_klass_offset_in_bytes() { return offset_of(objArrayKlass, _element_klass); }
duke@0 44
duke@0 45 // Dispatched operation
duke@0 46 bool can_be_primary_super_slow() const;
duke@0 47 objArrayOop compute_secondary_supers(int num_extra_slots, TRAPS);
duke@0 48 bool compute_is_subtype_of(klassOop k);
duke@0 49 bool oop_is_objArray_slow() const { return true; }
duke@0 50 int oop_size(oop obj) const;
duke@0 51 int klass_oop_size() const { return object_size(); }
duke@0 52
duke@0 53 // Allocation
duke@0 54 DEFINE_ALLOCATE_PERMANENT(objArrayKlass);
duke@0 55 objArrayOop allocate(int length, TRAPS);
duke@0 56 oop multi_allocate(int rank, jint* sizes, TRAPS);
duke@0 57
duke@0 58 // Copying
duke@0 59 void copy_array(arrayOop s, int src_pos, arrayOop d, int dst_pos, int length, TRAPS);
duke@0 60
duke@0 61 // Compute protection domain
duke@0 62 oop protection_domain() { return Klass::cast(bottom_klass())->protection_domain(); }
duke@0 63 // Compute class loader
duke@0 64 oop class_loader() const { return Klass::cast(bottom_klass())->class_loader(); }
duke@0 65
coleenp@113 66 private:
coleenp@113 67 // Either oop or narrowOop depending on UseCompressedOops.
coleenp@113 68 // must be called from within objArrayKlass.cpp
coleenp@113 69 template <class T> void do_copy(arrayOop s, T* src, arrayOop d,
coleenp@113 70 T* dst, int length, TRAPS);
duke@0 71 protected:
duke@0 72 // Returns the objArrayKlass for n'th dimension.
duke@0 73 virtual klassOop array_klass_impl(bool or_null, int n, TRAPS);
duke@0 74
duke@0 75 // Returns the array class with this class as element type.
duke@0 76 virtual klassOop array_klass_impl(bool or_null, TRAPS);
duke@0 77
duke@0 78 public:
duke@0 79 // Casting from klassOop
duke@0 80 static objArrayKlass* cast(klassOop k) {
duke@0 81 assert(k->klass_part()->oop_is_objArray_slow(), "cast to objArrayKlass");
duke@0 82 return (objArrayKlass*) k->klass_part();
duke@0 83 }
duke@0 84
duke@0 85 // Sizing
duke@0 86 static int header_size() { return oopDesc::header_size() + sizeof(objArrayKlass)/HeapWordSize; }
duke@0 87 int object_size() const { return arrayKlass::object_size(header_size()); }
duke@0 88
duke@0 89 // Initialization (virtual from Klass)
duke@0 90 void initialize(TRAPS);
duke@0 91
duke@0 92 // Garbage collection
duke@0 93 void oop_follow_contents(oop obj);
duke@0 94 int oop_adjust_pointers(oop obj);
duke@0 95
duke@0 96 // Parallel Scavenge and Parallel Old
duke@0 97 PARALLEL_GC_DECLS
duke@0 98
duke@0 99 // Iterators
duke@0 100 int oop_oop_iterate(oop obj, OopClosure* blk) {
duke@0 101 return oop_oop_iterate_v(obj, blk);
duke@0 102 }
duke@0 103 int oop_oop_iterate_m(oop obj, OopClosure* blk, MemRegion mr) {
duke@0 104 return oop_oop_iterate_v_m(obj, blk, mr);
duke@0 105 }
duke@0 106 #define ObjArrayKlass_OOP_OOP_ITERATE_DECL(OopClosureType, nv_suffix) \
duke@0 107 int oop_oop_iterate##nv_suffix(oop obj, OopClosureType* blk); \
duke@0 108 int oop_oop_iterate##nv_suffix##_m(oop obj, OopClosureType* blk, \
coleenp@113 109 MemRegion mr); \
coleenp@113 110 int oop_oop_iterate_range##nv_suffix(oop obj, OopClosureType* blk, \
coleenp@113 111 int start, int end);
duke@0 112
duke@0 113 ALL_OOP_OOP_ITERATE_CLOSURES_1(ObjArrayKlass_OOP_OOP_ITERATE_DECL)
duke@0 114 ALL_OOP_OOP_ITERATE_CLOSURES_3(ObjArrayKlass_OOP_OOP_ITERATE_DECL)
duke@0 115
duke@0 116 // JVM support
duke@0 117 jint compute_modifier_flags(TRAPS) const;
duke@0 118
duke@0 119 private:
duke@0 120 static klassOop array_klass_impl (objArrayKlassHandle this_oop, bool or_null, int n, TRAPS);
duke@0 121
duke@0 122 #ifndef PRODUCT
duke@0 123 public:
duke@0 124 // Printing
duke@0 125 void oop_print_on (oop obj, outputStream* st);
duke@0 126 void oop_print_value_on(oop obj, outputStream* st);
duke@0 127 #endif
duke@0 128
duke@0 129 public:
duke@0 130 // Verification
duke@0 131 const char* internal_name() const;
duke@0 132 void oop_verify_on(oop obj, outputStream* st);
duke@0 133 void oop_verify_old_oop(oop obj, oop* p, bool allow_dirty);
coleenp@113 134 void oop_verify_old_oop(oop obj, narrowOop* p, bool allow_dirty);
duke@0 135
duke@0 136 };