annotate src/share/vm/oops/typeArrayKlass.hpp @ 1552:c18cbe5936b8

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