Mercurial > hg > truffle
annotate src/share/vm/oops/typeArrayKlass.hpp @ 15177:66e3af78ea96
HSAIL: added safepoint support
Contributed-by: Eric Caspole <eric.caspole@amd.com>
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Thu, 17 Apr 2014 00:44:32 +0200 |
parents | 4ca6dc0799b6 |
children | 89152779163c |
rev | line source |
---|---|
0 | 1 /* |
14909 | 2 * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. |
0 | 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * | |
5 * This code is free software; you can redistribute it and/or modify it | |
6 * under the terms of the GNU General Public License version 2 only, as | |
7 * published by the Free Software Foundation. | |
8 * | |
9 * This code is distributed in the hope that it will be useful, but WITHOUT | |
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
12 * version 2 for more details (a copy is included in the LICENSE file that | |
13 * accompanied this code). | |
14 * | |
15 * You should have received a copy of the GNU General Public License version | |
16 * 2 along with this work; if not, write to the Free Software Foundation, | |
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | |
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 | 22 * |
23 */ | |
24 | |
1972 | 25 #ifndef SHARE_VM_OOPS_TYPEARRAYKLASS_HPP |
26 #define SHARE_VM_OOPS_TYPEARRAYKLASS_HPP | |
27 | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
3961
diff
changeset
|
28 #include "classfile/classLoaderData.hpp" |
1972 | 29 #include "oops/arrayKlass.hpp" |
30 | |
6831
d8ce2825b193
8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents:
6725
diff
changeset
|
31 // A TypeArrayKlass is the klass of a typeArray |
0 | 32 // It contains the type and size of the elements |
33 | |
6831
d8ce2825b193
8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents:
6725
diff
changeset
|
34 class TypeArrayKlass : public ArrayKlass { |
0 | 35 friend class VMStructs; |
36 private: | |
37 jint _max_length; // maximum number of elements allowed in an array | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
3961
diff
changeset
|
38 |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
3961
diff
changeset
|
39 // Constructor |
6831
d8ce2825b193
8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents:
6725
diff
changeset
|
40 TypeArrayKlass(BasicType type, Symbol* name); |
d8ce2825b193
8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents:
6725
diff
changeset
|
41 static TypeArrayKlass* allocate(ClassLoaderData* loader_data, BasicType type, Symbol* name, TRAPS); |
0 | 42 public: |
6831
d8ce2825b193
8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents:
6725
diff
changeset
|
43 TypeArrayKlass() {} // For dummy objects. |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
3961
diff
changeset
|
44 |
0 | 45 // instance variables |
46 jint max_length() { return _max_length; } | |
47 void set_max_length(jint m) { _max_length = m; } | |
48 | |
49 // testers | |
50 bool oop_is_typeArray_slow() const { return true; } | |
51 | |
52 // klass allocation | |
6831
d8ce2825b193
8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents:
6725
diff
changeset
|
53 static TypeArrayKlass* create_klass(BasicType type, const char* name_str, |
481
7d7a7c599c17
6578152: fill_region_with_object has usability and safety issues
jcoomes
parents:
0
diff
changeset
|
54 TRAPS); |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
3961
diff
changeset
|
55 static inline Klass* create_klass(BasicType type, int scale, TRAPS) { |
6831
d8ce2825b193
8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents:
6725
diff
changeset
|
56 TypeArrayKlass* tak = create_klass(type, external_name(type), CHECK_NULL); |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
3961
diff
changeset
|
57 assert(scale == (1 << tak->log2_element_size()), "scale must check out"); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
3961
diff
changeset
|
58 return tak; |
481
7d7a7c599c17
6578152: fill_region_with_object has usability and safety issues
jcoomes
parents:
0
diff
changeset
|
59 } |
0 | 60 |
61 int oop_size(oop obj) const; | |
62 | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
3961
diff
changeset
|
63 bool compute_is_subtype_of(Klass* k); |
0 | 64 |
65 // Allocation | |
3961
a92cdbac8b9e
7081933: Use zeroing elimination optimization for large array
kvn
parents:
1972
diff
changeset
|
66 typeArrayOop allocate_common(int length, bool do_zero, TRAPS); |
a92cdbac8b9e
7081933: Use zeroing elimination optimization for large array
kvn
parents:
1972
diff
changeset
|
67 typeArrayOop allocate(int length, TRAPS) { return allocate_common(length, true, THREAD); } |
0 | 68 oop multi_allocate(int rank, jint* sizes, TRAPS); |
69 | |
10343
6bd680e9ea35
8003421: NPG: Move oops out of InstanceKlass into mirror
coleenp
parents:
6831
diff
changeset
|
70 oop protection_domain() const { return NULL; } |
6bd680e9ea35
8003421: NPG: Move oops out of InstanceKlass into mirror
coleenp
parents:
6831
diff
changeset
|
71 |
0 | 72 // Copying |
73 void copy_array(arrayOop s, int src_pos, arrayOop d, int dst_pos, int length, TRAPS); | |
74 | |
75 // Iteration | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
3961
diff
changeset
|
76 int oop_oop_iterate(oop obj, ExtendedOopClosure* blk); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
3961
diff
changeset
|
77 int oop_oop_iterate_m(oop obj, ExtendedOopClosure* blk, MemRegion mr); |
0 | 78 |
79 // Garbage collection | |
80 void oop_follow_contents(oop obj); | |
81 int oop_adjust_pointers(oop obj); | |
82 | |
83 // Parallel Scavenge and Parallel Old | |
84 PARALLEL_GC_DECLS | |
85 | |
86 protected: | |
87 // Find n'th dimensional array | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
3961
diff
changeset
|
88 virtual Klass* array_klass_impl(bool or_null, int n, TRAPS); |
0 | 89 |
90 // Returns the array class with this class as element type | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
3961
diff
changeset
|
91 virtual Klass* array_klass_impl(bool or_null, TRAPS); |
0 | 92 |
93 public: | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
3961
diff
changeset
|
94 // Casting from Klass* |
6831
d8ce2825b193
8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents:
6725
diff
changeset
|
95 static TypeArrayKlass* cast(Klass* k) { |
d8ce2825b193
8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents:
6725
diff
changeset
|
96 assert(k->oop_is_typeArray(), "cast to TypeArrayKlass"); |
d8ce2825b193
8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents:
6725
diff
changeset
|
97 return (TypeArrayKlass*) k; |
0 | 98 } |
99 | |
100 // Naming | |
101 static const char* external_name(BasicType type); | |
102 | |
103 // Sizing | |
6831
d8ce2825b193
8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents:
6725
diff
changeset
|
104 static int header_size() { return sizeof(TypeArrayKlass)/HeapWordSize; } |
d8ce2825b193
8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents:
6725
diff
changeset
|
105 int size() const { return ArrayKlass::static_size(header_size()); } |
0 | 106 |
107 // Initialization (virtual from Klass) | |
108 void initialize(TRAPS); | |
109 | |
110 public: | |
111 // Printing | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
3961
diff
changeset
|
112 #ifndef PRODUCT |
0 | 113 void oop_print_on(oop obj, outputStream* st); |
114 #endif | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
3961
diff
changeset
|
115 |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
3961
diff
changeset
|
116 void print_on(outputStream* st) const; |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
3961
diff
changeset
|
117 void print_value_on(outputStream* st) const; |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
3961
diff
changeset
|
118 |
0 | 119 public: |
120 const char* internal_name() const; | |
121 }; | |
1972 | 122 |
123 #endif // SHARE_VM_OOPS_TYPEARRAYKLASS_HPP |