1 /*
2 * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
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 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
70 // offset of first element, including any padding for the sake of alignment
71 int array_header_in_bytes() const { return layout_helper_header_size(layout_helper()); }
72 int log2_element_size() const { return layout_helper_log2_element_size(layout_helper()); }
73 // type of elements (T_OBJECT for both oop arrays and array-arrays)
74 BasicType element_type() const { return layout_helper_element_type(layout_helper()); }
75
76 virtual Klass* java_super() const;//{ return SystemDictionary::Object_klass(); }
77
78 // Allocation
79 // Sizes points to the first dimension of the array, subsequent dimensions
80 // are always in higher memory. The callers of these set that up.
81 virtual oop multi_allocate(int rank, jint* sizes, TRAPS);
82 objArrayOop allocate_arrayArray(int n, int length, TRAPS);
83
84 // find field according to JVM spec 5.4.3.2, returns the klass in which the field is defined
85 Klass* find_field(Symbol* name, Symbol* sig, fieldDescriptor* fd) const;
86
87 // Lookup operations
88 Method* uncached_lookup_method(const Symbol* name,
89 const Symbol* signature,
90 OverpassLookupMode overpass_mode) const;
91
92 static ArrayKlass* cast(Klass* k) {
93 return const_cast<ArrayKlass*>(cast(const_cast<const Klass*>(k)));
94 }
95
96 static const ArrayKlass* cast(const Klass* k) {
97 assert(k->is_array_klass(), "cast to ArrayKlass");
98 return static_cast<const ArrayKlass*>(k);
99 }
100
101 GrowableArray<Klass*>* compute_secondary_supers(int num_extra_slots,
102 Array<Klass*>* transitive_interfaces);
103 bool compute_is_subtype_of(Klass* k);
104
105 // Sizing
106 static int static_size(int header_size);
107
108 virtual void metaspace_pointers_do(MetaspaceClosure* iter);
109
110 #if INCLUDE_SERVICES
|
1 /*
2 * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
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 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
70 // offset of first element, including any padding for the sake of alignment
71 int array_header_in_bytes() const { return layout_helper_header_size(layout_helper()); }
72 int log2_element_size() const { return layout_helper_log2_element_size(layout_helper()); }
73 // type of elements (T_OBJECT for both oop arrays and array-arrays)
74 BasicType element_type() const { return layout_helper_element_type(layout_helper()); }
75
76 virtual Klass* java_super() const;//{ return SystemDictionary::Object_klass(); }
77
78 // Allocation
79 // Sizes points to the first dimension of the array, subsequent dimensions
80 // are always in higher memory. The callers of these set that up.
81 virtual oop multi_allocate(int rank, jint* sizes, TRAPS);
82 objArrayOop allocate_arrayArray(int n, int length, TRAPS);
83
84 // find field according to JVM spec 5.4.3.2, returns the klass in which the field is defined
85 Klass* find_field(Symbol* name, Symbol* sig, fieldDescriptor* fd) const;
86
87 // Lookup operations
88 Method* uncached_lookup_method(const Symbol* name,
89 const Symbol* signature,
90 OverpassLookupMode overpass_mode,
91 PrivateLookupMode private_mode = find_private) const;
92
93 static ArrayKlass* cast(Klass* k) {
94 return const_cast<ArrayKlass*>(cast(const_cast<const Klass*>(k)));
95 }
96
97 static const ArrayKlass* cast(const Klass* k) {
98 assert(k->is_array_klass(), "cast to ArrayKlass");
99 return static_cast<const ArrayKlass*>(k);
100 }
101
102 GrowableArray<Klass*>* compute_secondary_supers(int num_extra_slots,
103 Array<Klass*>* transitive_interfaces);
104 bool compute_is_subtype_of(Klass* k);
105
106 // Sizing
107 static int static_size(int header_size);
108
109 virtual void metaspace_pointers_do(MetaspaceClosure* iter);
110
111 #if INCLUDE_SERVICES
|