Esempio n. 1
0
 int offset_from_char_index(int index) const { 
   GUARANTEE(is_char_array(), "Array must be char array");
   GUARANTEE(is_within_bounds(index), "Array index out of bounds");
   return base_offset() + (index * sizeof(jchar));
 }
Esempio n. 2
0
 int offset_from_ubyte_index(int index) const { 
   GUARANTEE(ObjectHeap::is_gc_active() || is_byte_array(),
              "Array must be byte array");
   GUARANTEE(is_within_bounds(index), "Array index out of bounds");
   return base_offset() + (index * sizeof(jubyte));
 }
Esempio n. 3
0
 int offset_from_bool_index(int index) const { 
   GUARANTEE(is_bool_array(), "Array must be bool array");
   GUARANTEE(is_within_bounds(index), "Array index out of bounds");
   return base_offset() + (index * sizeof(jboolean));
 }
Esempio n. 4
0
 int offset_from_double_index(int index) const { 
   GUARANTEE(is_double_array(), "Array must be double array"); 
   GUARANTEE(is_within_bounds(index), "Array index out of bounds");
   return base_offset() + (index * sizeof(jdouble));
 }
Esempio n. 5
0
 int offset_from_float_index(int index) const { 
   GUARANTEE(is_float_array(), "Array must be float array"); 
   GUARANTEE(is_within_bounds(index), "Array index out of bounds");
   return base_offset() + (index * sizeof(jfloat));
 }
Esempio n. 6
0
 int offset_from_long_index(int index) const { 
   GUARANTEE(is_long_array(), "Array must be long array"); 
   GUARANTEE(is_within_bounds(index), "Array index out of bounds");
   return base_offset() + (index * sizeof(jlong));
 }
 // Returns the address of the index'th element
 oop* obj_at_addr(int index) const {
   assert(is_within_bounds(index), "index out of bounds");
   return &base()[index];
 }
Esempio n. 8
0
 template <class T> T* obj_at_addr(int index) const {
   assert(is_within_bounds(index), "index out of bounds");
   return &((T*)base())[index];
 }