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 *
23 */
24
25 #ifndef SHARE_OOPS_TYPEARRAYOOP_INLINE_HPP
26 #define SHARE_OOPS_TYPEARRAYOOP_INLINE_HPP
27
28 #include "oops/typeArrayOop.hpp"
29
30 #include "oops/access.inline.hpp"
31 #include "oops/oop.inline.hpp"
32 #include "oops/arrayOop.hpp"
33
34 size_t typeArrayOopDesc::object_size(const TypeArrayKlass* tk) const {
35 return object_size(tk->layout_helper(), length());
36 }
37
38 inline jchar* typeArrayOopDesc::char_base() const { return (jchar*) base(T_CHAR); }
39 inline jboolean* typeArrayOopDesc::bool_base() const { return (jboolean*)base(T_BOOLEAN); }
40 inline jbyte* typeArrayOopDesc::byte_base() const { return (jbyte*) base(T_BYTE); }
41 inline jint* typeArrayOopDesc::int_base() const { return (jint*) base(T_INT); }
42 inline jlong* typeArrayOopDesc::long_base() const { return (jlong*) base(T_LONG); }
43 inline jshort* typeArrayOopDesc::short_base() const { return (jshort*) base(T_SHORT); }
44 inline jfloat* typeArrayOopDesc::float_base() const { return (jfloat*) base(T_FLOAT); }
45 inline jdouble* typeArrayOopDesc::double_base() const { return (jdouble*) base(T_DOUBLE); }
46
47 inline jbyte* typeArrayOopDesc::byte_at_addr(int which) const {
48 assert(is_within_bounds(which), "index %d out of bounds %d", which, length());
49 return &byte_base()[which];
50 }
51
52 inline jboolean* typeArrayOopDesc::bool_at_addr(int which) const {
53 assert(is_within_bounds(which), "index %d out of bounds %d", which, length());
54 return &bool_base()[which];
55 }
|
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 *
23 */
24
25 #ifndef SHARE_OOPS_TYPEARRAYOOP_INLINE_HPP
26 #define SHARE_OOPS_TYPEARRAYOOP_INLINE_HPP
27
28 #include "oops/typeArrayOop.hpp"
29
30 #include "oops/access.inline.hpp"
31 #include "oops/oop.inline.hpp"
32 #include "oops/arrayOop.hpp"
33
34 size_t typeArrayOopDesc::object_size(const TypeArrayKlass* tk, int length) const {
35 return object_size(tk->layout_helper(), length);
36 }
37
38 size_t typeArrayOopDesc::object_size(const TypeArrayKlass* tk) const {
39 return object_size(tk, length());
40 }
41
42 inline jchar* typeArrayOopDesc::char_base() const { return (jchar*) base(T_CHAR); }
43 inline jboolean* typeArrayOopDesc::bool_base() const { return (jboolean*)base(T_BOOLEAN); }
44 inline jbyte* typeArrayOopDesc::byte_base() const { return (jbyte*) base(T_BYTE); }
45 inline jint* typeArrayOopDesc::int_base() const { return (jint*) base(T_INT); }
46 inline jlong* typeArrayOopDesc::long_base() const { return (jlong*) base(T_LONG); }
47 inline jshort* typeArrayOopDesc::short_base() const { return (jshort*) base(T_SHORT); }
48 inline jfloat* typeArrayOopDesc::float_base() const { return (jfloat*) base(T_FLOAT); }
49 inline jdouble* typeArrayOopDesc::double_base() const { return (jdouble*) base(T_DOUBLE); }
50
51 inline jbyte* typeArrayOopDesc::byte_at_addr(int which) const {
52 assert(is_within_bounds(which), "index %d out of bounds %d", which, length());
53 return &byte_base()[which];
54 }
55
56 inline jboolean* typeArrayOopDesc::bool_at_addr(int which) const {
57 assert(is_within_bounds(which), "index %d out of bounds %d", which, length());
58 return &bool_base()[which];
59 }
|