< prev index next >

src/hotspot/share/oops/typeArrayOop.hpp

Print this page

 95 
 96   jushort ushort_at(int which) const;
 97   void ushort_at_put(int which, jushort contents);
 98 
 99   jlong long_at(int which) const;
100   void long_at_put(int which, jlong contents);
101 
102   jfloat float_at(int which) const;
103   void float_at_put(int which, jfloat contents);
104 
105   jdouble double_at(int which) const;
106   void double_at_put(int which, jdouble contents);
107 
108   jbyte byte_at_acquire(int which) const;
109   void release_byte_at_put(int which, jbyte contents);
110 
111   Symbol* symbol_at(int which) const;
112   void symbol_at_put(int which, Symbol* contents);
113 
114   // Sizing



115 
116   // Returns the number of words necessary to hold an array of "len"
117   // elements each of the given "byte_size".
118  private:
119   static int object_size(int lh, int length) {
120     int instance_header_size = Klass::layout_helper_header_size(lh);
121     int element_shift = Klass::layout_helper_log2_element_size(lh);
122     DEBUG_ONLY(BasicType etype = Klass::layout_helper_element_type(lh));
123     assert(length <= arrayOopDesc::max_array_length(etype), "no overflow");
124 
125     julong size_in_bytes = (juint)length;
126     size_in_bytes <<= element_shift;
127     size_in_bytes += instance_header_size;
128     julong size_in_words = ((size_in_bytes + (HeapWordSize-1)) >> LogHeapWordSize);
129     assert(size_in_words <= (julong)max_jint, "no overflow");
130 
131     return align_object_size((intptr_t)size_in_words);
132   }
133 
134  public:

 95 
 96   jushort ushort_at(int which) const;
 97   void ushort_at_put(int which, jushort contents);
 98 
 99   jlong long_at(int which) const;
100   void long_at_put(int which, jlong contents);
101 
102   jfloat float_at(int which) const;
103   void float_at_put(int which, jfloat contents);
104 
105   jdouble double_at(int which) const;
106   void double_at_put(int which, jdouble contents);
107 
108   jbyte byte_at_acquire(int which) const;
109   void release_byte_at_put(int which, jbyte contents);
110 
111   Symbol* symbol_at(int which) const;
112   void symbol_at_put(int which, Symbol* contents);
113 
114   // Sizing
115   static int object_size(TypeArrayKlass* kls, int length) {
116     return object_size(kls->layout_helper(), length);
117   }
118 
119   // Returns the number of words necessary to hold an array of "len"
120   // elements each of the given "byte_size".
121  private:
122   static int object_size(int lh, int length) {
123     int instance_header_size = Klass::layout_helper_header_size(lh);
124     int element_shift = Klass::layout_helper_log2_element_size(lh);
125     DEBUG_ONLY(BasicType etype = Klass::layout_helper_element_type(lh));
126     assert(length <= arrayOopDesc::max_array_length(etype), "no overflow");
127 
128     julong size_in_bytes = (juint)length;
129     size_in_bytes <<= element_shift;
130     size_in_bytes += instance_header_size;
131     julong size_in_words = ((size_in_bytes + (HeapWordSize-1)) >> LogHeapWordSize);
132     assert(size_in_words <= (julong)max_jint, "no overflow");
133 
134     return align_object_size((intptr_t)size_in_words);
135   }
136 
137  public:
< prev index next >