annotate src/share/vm/oops/typeArrayKlass.hpp @ 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 c18cbe5936b8
children a92cdbac8b9e
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: 1552
diff changeset
2 * Copyright (c) 1997, 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: 579
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 579
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: 579
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: 1552
diff changeset
25 #ifndef SHARE_VM_OOPS_TYPEARRAYKLASS_HPP
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
26 #define SHARE_VM_OOPS_TYPEARRAYKLASS_HPP
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
27
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
28 #include "oops/arrayKlass.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
29
0
a61af66fc99e Initial load
duke
parents:
diff changeset
30 // A typeArrayKlass is the klass of a typeArray
a61af66fc99e Initial load
duke
parents:
diff changeset
31 // It contains the type and size of the elements
a61af66fc99e Initial load
duke
parents:
diff changeset
32
a61af66fc99e Initial load
duke
parents:
diff changeset
33 class typeArrayKlass : public arrayKlass {
a61af66fc99e Initial load
duke
parents:
diff changeset
34 friend class VMStructs;
a61af66fc99e Initial load
duke
parents:
diff changeset
35 private:
a61af66fc99e Initial load
duke
parents:
diff changeset
36 jint _max_length; // maximum number of elements allowed in an array
a61af66fc99e Initial load
duke
parents:
diff changeset
37 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
38 // instance variables
a61af66fc99e Initial load
duke
parents:
diff changeset
39 jint max_length() { return _max_length; }
a61af66fc99e Initial load
duke
parents:
diff changeset
40 void set_max_length(jint m) { _max_length = m; }
a61af66fc99e Initial load
duke
parents:
diff changeset
41
a61af66fc99e Initial load
duke
parents:
diff changeset
42 // testers
a61af66fc99e Initial load
duke
parents:
diff changeset
43 bool oop_is_typeArray_slow() const { return true; }
a61af66fc99e Initial load
duke
parents:
diff changeset
44
a61af66fc99e Initial load
duke
parents:
diff changeset
45 // klass allocation
a61af66fc99e Initial load
duke
parents:
diff changeset
46 DEFINE_ALLOCATE_PERMANENT(typeArrayKlass);
481
7d7a7c599c17 6578152: fill_region_with_object has usability and safety issues
jcoomes
parents: 0
diff changeset
47 static klassOop create_klass(BasicType type, int scale, const char* name_str,
7d7a7c599c17 6578152: fill_region_with_object has usability and safety issues
jcoomes
parents: 0
diff changeset
48 TRAPS);
7d7a7c599c17 6578152: fill_region_with_object has usability and safety issues
jcoomes
parents: 0
diff changeset
49 static inline klassOop create_klass(BasicType type, int scale, TRAPS) {
7d7a7c599c17 6578152: fill_region_with_object has usability and safety issues
jcoomes
parents: 0
diff changeset
50 return create_klass(type, scale, external_name(type), CHECK_NULL);
7d7a7c599c17 6578152: fill_region_with_object has usability and safety issues
jcoomes
parents: 0
diff changeset
51 }
0
a61af66fc99e Initial load
duke
parents:
diff changeset
52
a61af66fc99e Initial load
duke
parents:
diff changeset
53 int oop_size(oop obj) const;
a61af66fc99e Initial load
duke
parents:
diff changeset
54 int klass_oop_size() const { return object_size(); }
a61af66fc99e Initial load
duke
parents:
diff changeset
55
a61af66fc99e Initial load
duke
parents:
diff changeset
56 bool compute_is_subtype_of(klassOop k);
a61af66fc99e Initial load
duke
parents:
diff changeset
57
a61af66fc99e Initial load
duke
parents:
diff changeset
58 // Allocation
a61af66fc99e Initial load
duke
parents:
diff changeset
59 typeArrayOop allocate(int length, TRAPS);
a61af66fc99e Initial load
duke
parents:
diff changeset
60 typeArrayOop allocate_permanent(int length, TRAPS); // used for class file structures
a61af66fc99e Initial load
duke
parents:
diff changeset
61 oop multi_allocate(int rank, jint* sizes, TRAPS);
a61af66fc99e Initial load
duke
parents:
diff changeset
62
a61af66fc99e Initial load
duke
parents:
diff changeset
63 // Copying
a61af66fc99e Initial load
duke
parents:
diff changeset
64 void copy_array(arrayOop s, int src_pos, arrayOop d, int dst_pos, int length, TRAPS);
a61af66fc99e Initial load
duke
parents:
diff changeset
65
a61af66fc99e Initial load
duke
parents:
diff changeset
66 // Iteration
a61af66fc99e Initial load
duke
parents:
diff changeset
67 int oop_oop_iterate(oop obj, OopClosure* blk);
a61af66fc99e Initial load
duke
parents:
diff changeset
68 int oop_oop_iterate_m(oop obj, OopClosure* blk, MemRegion mr);
a61af66fc99e Initial load
duke
parents:
diff changeset
69
a61af66fc99e Initial load
duke
parents:
diff changeset
70 // Garbage collection
a61af66fc99e Initial load
duke
parents:
diff changeset
71 void oop_follow_contents(oop obj);
a61af66fc99e Initial load
duke
parents:
diff changeset
72 int oop_adjust_pointers(oop obj);
a61af66fc99e Initial load
duke
parents:
diff changeset
73
a61af66fc99e Initial load
duke
parents:
diff changeset
74 // Parallel Scavenge and Parallel Old
a61af66fc99e Initial load
duke
parents:
diff changeset
75 PARALLEL_GC_DECLS
a61af66fc99e Initial load
duke
parents:
diff changeset
76
a61af66fc99e Initial load
duke
parents:
diff changeset
77 protected:
a61af66fc99e Initial load
duke
parents:
diff changeset
78 // Find n'th dimensional array
a61af66fc99e Initial load
duke
parents:
diff changeset
79 virtual klassOop array_klass_impl(bool or_null, int n, TRAPS);
a61af66fc99e Initial load
duke
parents:
diff changeset
80
a61af66fc99e Initial load
duke
parents:
diff changeset
81 // Returns the array class with this class as element type
a61af66fc99e Initial load
duke
parents:
diff changeset
82 virtual klassOop array_klass_impl(bool or_null, TRAPS);
a61af66fc99e Initial load
duke
parents:
diff changeset
83
a61af66fc99e Initial load
duke
parents:
diff changeset
84 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
85 // Casting from klassOop
a61af66fc99e Initial load
duke
parents:
diff changeset
86 static typeArrayKlass* cast(klassOop k) {
a61af66fc99e Initial load
duke
parents:
diff changeset
87 assert(k->klass_part()->oop_is_typeArray_slow(), "cast to typeArrayKlass");
a61af66fc99e Initial load
duke
parents:
diff changeset
88 return (typeArrayKlass*) k->klass_part();
a61af66fc99e Initial load
duke
parents:
diff changeset
89 }
a61af66fc99e Initial load
duke
parents:
diff changeset
90
a61af66fc99e Initial load
duke
parents:
diff changeset
91 // Naming
a61af66fc99e Initial load
duke
parents:
diff changeset
92 static const char* external_name(BasicType type);
a61af66fc99e Initial load
duke
parents:
diff changeset
93
a61af66fc99e Initial load
duke
parents:
diff changeset
94 // Sizing
a61af66fc99e Initial load
duke
parents:
diff changeset
95 static int header_size() { return oopDesc::header_size() + sizeof(typeArrayKlass)/HeapWordSize; }
a61af66fc99e Initial load
duke
parents:
diff changeset
96 int object_size() const { return arrayKlass::object_size(header_size()); }
a61af66fc99e Initial load
duke
parents:
diff changeset
97
a61af66fc99e Initial load
duke
parents:
diff changeset
98 // Initialization (virtual from Klass)
a61af66fc99e Initial load
duke
parents:
diff changeset
99 void initialize(TRAPS);
a61af66fc99e Initial load
duke
parents:
diff changeset
100
a61af66fc99e Initial load
duke
parents:
diff changeset
101 private:
a61af66fc99e Initial load
duke
parents:
diff changeset
102 // Helpers
a61af66fc99e Initial load
duke
parents:
diff changeset
103 static klassOop array_klass_impl(typeArrayKlassHandle h_this, bool or_null, int n, TRAPS);
a61af66fc99e Initial load
duke
parents:
diff changeset
104
a61af66fc99e Initial load
duke
parents:
diff changeset
105 #ifndef PRODUCT
a61af66fc99e Initial load
duke
parents:
diff changeset
106 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
107 // Printing
a61af66fc99e Initial load
duke
parents:
diff changeset
108 void oop_print_on(oop obj, outputStream* st);
a61af66fc99e Initial load
duke
parents:
diff changeset
109 #endif
a61af66fc99e Initial load
duke
parents:
diff changeset
110 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
111 const char* internal_name() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
112 };
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
113
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
114 #endif // SHARE_VM_OOPS_TYPEARRAYKLASS_HPP