src/share/vm/oops/klassOop.hpp

Fri, 18 Mar 2011 16:00:34 -0700

author
never
date
Fri, 18 Mar 2011 16:00:34 -0700
changeset 2658
c7f3d0b4570f
parent 2314
f95d63e2154a
child 3131
b0efc7ee3b31
permissions
-rw-r--r--

7017732: move static fields into Class to prepare for perm gen removal
Reviewed-by: kvn, coleenp, twisti, stefank

duke@435 1 /*
never@2658 2 * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
duke@435 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
duke@435 4 *
duke@435 5 * This code is free software; you can redistribute it and/or modify it
duke@435 6 * under the terms of the GNU General Public License version 2 only, as
duke@435 7 * published by the Free Software Foundation.
duke@435 8 *
duke@435 9 * This code is distributed in the hope that it will be useful, but WITHOUT
duke@435 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
duke@435 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
duke@435 12 * version 2 for more details (a copy is included in the LICENSE file that
duke@435 13 * accompanied this code).
duke@435 14 *
duke@435 15 * You should have received a copy of the GNU General Public License version
duke@435 16 * 2 along with this work; if not, write to the Free Software Foundation,
duke@435 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
duke@435 18 *
trims@1907 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
trims@1907 20 * or visit www.oracle.com if you need additional information or have any
trims@1907 21 * questions.
duke@435 22 *
duke@435 23 */
duke@435 24
stefank@2314 25 #ifndef SHARE_VM_OOPS_KLASSOOP_HPP
stefank@2314 26 #define SHARE_VM_OOPS_KLASSOOP_HPP
stefank@2314 27
stefank@2314 28 #include "oops/oop.hpp"
stefank@2314 29
duke@435 30 // A klassOop is the C++ equivalent of a Java class.
duke@435 31 // Part of a klassOopDesc is a Klass which handle the
duke@435 32 // dispatching for the C++ method calls.
duke@435 33
duke@435 34 // klassOop object layout:
duke@435 35 // [header ]
duke@435 36 // [klass_field]
duke@435 37 // [KLASS ]
duke@435 38
duke@435 39 class klassOopDesc : public oopDesc {
duke@435 40 public:
duke@435 41 // size operation
duke@435 42 static int header_size() { return sizeof(klassOopDesc)/HeapWordSize; }
duke@435 43
duke@435 44 // support for code generation
duke@435 45 static int klass_part_offset_in_bytes() { return sizeof(klassOopDesc); }
duke@435 46
duke@435 47 // returns the Klass part containing dispatching behavior
never@2658 48 Klass* klass_part() const { return (Klass*)((address)this + klass_part_offset_in_bytes()); }
never@2658 49
never@2658 50 // Convenience wrapper
never@2658 51 inline oop java_mirror() const;
never@2658 52
never@2658 53 private:
never@2658 54 // These have no implementation since klassOop should never be accessed in this fashion
never@2658 55 oop obj_field(int offset) const;
never@2658 56 void obj_field_put(int offset, oop value);
never@2658 57 void obj_field_raw_put(int offset, oop value);
never@2658 58
never@2658 59 jbyte byte_field(int offset) const;
never@2658 60 void byte_field_put(int offset, jbyte contents);
never@2658 61
never@2658 62 jchar char_field(int offset) const;
never@2658 63 void char_field_put(int offset, jchar contents);
never@2658 64
never@2658 65 jboolean bool_field(int offset) const;
never@2658 66 void bool_field_put(int offset, jboolean contents);
never@2658 67
never@2658 68 jint int_field(int offset) const;
never@2658 69 void int_field_put(int offset, jint contents);
never@2658 70
never@2658 71 jshort short_field(int offset) const;
never@2658 72 void short_field_put(int offset, jshort contents);
never@2658 73
never@2658 74 jlong long_field(int offset) const;
never@2658 75 void long_field_put(int offset, jlong contents);
never@2658 76
never@2658 77 jfloat float_field(int offset) const;
never@2658 78 void float_field_put(int offset, jfloat contents);
never@2658 79
never@2658 80 jdouble double_field(int offset) const;
never@2658 81 void double_field_put(int offset, jdouble contents);
never@2658 82
never@2658 83 address address_field(int offset) const;
never@2658 84 void address_field_put(int offset, address contents);
never@2658 85
never@2658 86 oop obj_field_acquire(int offset) const;
never@2658 87 void release_obj_field_put(int offset, oop value);
never@2658 88
never@2658 89 jbyte byte_field_acquire(int offset) const;
never@2658 90 void release_byte_field_put(int offset, jbyte contents);
never@2658 91
never@2658 92 jchar char_field_acquire(int offset) const;
never@2658 93 void release_char_field_put(int offset, jchar contents);
never@2658 94
never@2658 95 jboolean bool_field_acquire(int offset) const;
never@2658 96 void release_bool_field_put(int offset, jboolean contents);
never@2658 97
never@2658 98 jint int_field_acquire(int offset) const;
never@2658 99 void release_int_field_put(int offset, jint contents);
never@2658 100
never@2658 101 jshort short_field_acquire(int offset) const;
never@2658 102 void release_short_field_put(int offset, jshort contents);
never@2658 103
never@2658 104 jlong long_field_acquire(int offset) const;
never@2658 105 void release_long_field_put(int offset, jlong contents);
never@2658 106
never@2658 107 jfloat float_field_acquire(int offset) const;
never@2658 108 void release_float_field_put(int offset, jfloat contents);
never@2658 109
never@2658 110 jdouble double_field_acquire(int offset) const;
never@2658 111 void release_double_field_put(int offset, jdouble contents);
never@2658 112
never@2658 113 address address_field_acquire(int offset) const;
never@2658 114 void release_address_field_put(int offset, address contents);
duke@435 115 };
stefank@2314 116
stefank@2314 117 #endif // SHARE_VM_OOPS_KLASSOOP_HPP

mercurial