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