/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
#ifndef SHARE_VM_OOPS_ARRAYKLASS_HPP
#define SHARE_VM_OOPS_ARRAYKLASS_HPP
#include "memory/universe.hpp"
#include "oops/klassOop.hpp"
#include "oops/klassVtable.hpp"
// arrayKlass is the abstract baseclass for all array classes
friend class VMStructs;
private:
public:
// Testing operation
bool oop_is_array() const { return true; }
// Instance variables
void set_higher_dimension(klassOop k) { oop_store_without_check((oop*) &_higher_dimension, (oop) k); }
void set_lower_dimension(klassOop k) { oop_store_without_check((oop*) &_lower_dimension, (oop) k); }
// Allocation profiling support
// offset of first element, including any padding for the sake of alignment
// type of elements (T_OBJECT for both oop arrays and array-arrays)
// Compiler/Interpreter offset
static ByteSize component_mirror_offset() { return in_ByteSize(sizeof(klassOopDesc) + offset_of(arrayKlass, _component_mirror)); }
// Allocation
// Sizes points to the first dimension of the array, subsequent dimensions
// are always in higher memory. The callers of these set that up.
// Lookup operations
// Casting from klassOop
return (arrayKlass*) kp;
}
bool compute_is_subtype_of(klassOop k);
// Sizing
int object_size(int header_size) const;
// Java vtable
void set_vtable_length(int len) { assert(len == base_vtable_length(), "bad length"); _vtable_len = len; }
protected:
inline intptr_t* start_of_vtable() const;
public:
// Iterators
void array_klasses_do(void f(klassOop k));
void with_array_klasses_do(void f(klassOop k));
// Shared creation method
const Klass_vtbl& vtbl,
TRAPS);
// Return a handle.
// jvm support
// JVMTI support
jint jvmti_class_status() const;
// Printing
// Verification
};
#endif // SHARE_VM_OOPS_ARRAYKLASS_HPP