< prev index next >

src/share/vm/oops/typeArrayOop.hpp

Print this page
rev 12906 : [mq]: gc_interface

@@ -42,10 +42,19 @@
   jlong*    long_base()   const { return (jlong*)   base(T_LONG); }
   jshort*   short_base()  const { return (jshort*)  base(T_SHORT); }
   jfloat*   float_base()  const { return (jfloat*)  base(T_FLOAT); }
   jdouble*  double_base() const { return (jdouble*) base(T_DOUBLE); }
 
+  static int char_at_offset(int index)   { return base_offset_in_bytes(T_CHAR) + sizeof(jchar) * index; }
+  static int bool_at_offset(int index)   { return base_offset_in_bytes(T_BOOLEAN) + sizeof(jboolean) * index; }
+  static int byte_at_offset(int index)   { return base_offset_in_bytes(T_BYTE) + sizeof(jbyte) * index; }
+  static int int_at_offset(int index)    { return base_offset_in_bytes(T_INT) + sizeof(jint) * index; }
+  static int long_at_offset(int index)   { return base_offset_in_bytes(T_LONG) + sizeof(jlong) * index; }
+  static int short_at_offset(int index)  { return base_offset_in_bytes(T_SHORT) + sizeof(jshort) * index; }
+  static int float_at_offset(int index)  { return base_offset_in_bytes(T_FLOAT) + sizeof(jfloat) * index; }
+  static int double_at_offset(int index) { return base_offset_in_bytes(T_DOUBLE) + sizeof(jdouble) * index; }
+
   friend class TypeArrayKlass;
 
  public:
   jbyte* byte_at_addr(int which) const {
     assert(is_within_bounds(which), "index %d out of bounds %d", which, length());

@@ -90,39 +99,39 @@
   jdouble* double_at_addr(int which) const {
     assert(is_within_bounds(which), "index %d out of bounds %d", which, length());
     return &double_base()[which];
   }
 
-  jbyte byte_at(int which) const                  { return *byte_at_addr(which); }
-  void byte_at_put(int which, jbyte contents)     { *byte_at_addr(which) = contents; }
+  jbyte byte_at(int which) const;
+  void byte_at_put(int which, jbyte contents);
 
-  jboolean bool_at(int which) const               { return *bool_at_addr(which); }
-  void bool_at_put(int which, jboolean contents)  { *bool_at_addr(which) = (((jint)contents) & 1); }
+  jboolean bool_at(int which) const;
+  void bool_at_put(int which, jboolean contents);
 
-  jchar char_at(int which) const                  { return *char_at_addr(which); }
-  void char_at_put(int which, jchar contents)     { *char_at_addr(which) = contents; }
+  jchar char_at(int which) const;
+  void char_at_put(int which, jchar contents);
 
-  jint int_at(int which) const                    { return *int_at_addr(which); }
-  void int_at_put(int which, jint contents)       { *int_at_addr(which) = contents; }
+  jint int_at(int which) const;
+  void int_at_put(int which, jint contents);
 
-  jshort short_at(int which) const                { return *short_at_addr(which); }
-  void short_at_put(int which, jshort contents)   { *short_at_addr(which) = contents; }
+  jshort short_at(int which) const;
+  void short_at_put(int which, jshort contents);
 
-  jushort ushort_at(int which) const              { return *ushort_at_addr(which); }
-  void ushort_at_put(int which, jushort contents) { *ushort_at_addr(which) = contents; }
+  jushort ushort_at(int which) const;
+  void ushort_at_put(int which, jushort contents);
 
-  jlong long_at(int which) const                  { return *long_at_addr(which); }
-  void long_at_put(int which, jlong contents)     { *long_at_addr(which) = contents; }
+  jlong long_at(int which) const;
+  void long_at_put(int which, jlong contents);
 
-  jfloat float_at(int which) const                { return *float_at_addr(which); }
-  void float_at_put(int which, jfloat contents)   { *float_at_addr(which) = contents; }
+  jfloat float_at(int which) const;
+  void float_at_put(int which, jfloat contents);
 
-  jdouble double_at(int which) const              { return *double_at_addr(which); }
-  void double_at_put(int which, jdouble contents) { *double_at_addr(which) = contents; }
+  jdouble double_at(int which) const;
+  void double_at_put(int which, jdouble contents);
 
-  jbyte byte_at_acquire(int which) const              { return OrderAccess::load_acquire(byte_at_addr(which)); }
-  void release_byte_at_put(int which, jbyte contents) { OrderAccess::release_store(byte_at_addr(which), contents); }
+  jbyte byte_at_acquire(int which) const;
+  void release_byte_at_put(int which, jbyte contents);
 
   // Java thinks Symbol arrays are just arrays of either long or int, since
   // there doesn't seem to be T_ADDRESS, so this is a bit of unfortunate
   // casting
 #ifdef _LP64
< prev index next >