Mercurial > hg > truffle
comparison src/share/vm/oops/arrayOop.cpp @ 4708:3c648b9ad052
7121373: Clean up CollectedHeap::is_in
Summary: Fixed G1CollectedHeap::is_in, added tests, cleaned up comments and made Space::is_in pure virtual.
Reviewed-by: brutisso, tonyp, jcoomes
author | stefank |
---|---|
date | Wed, 14 Dec 2011 12:15:26 +0100 |
parents | 6fd81579526f |
children | 0382d2b469b2 |
comparison
equal
deleted
inserted
replaced
4132:6d7d0790074d | 4708:3c648b9ad052 |
---|---|
36 julong bytes_per_element = type2aelembytes(type); | 36 julong bytes_per_element = type2aelembytes(type); |
37 julong bytes = length * bytes_per_element + header_size_in_bytes(); | 37 julong bytes = length * bytes_per_element + header_size_in_bytes(); |
38 return (julong)(size_t)bytes == bytes; | 38 return (julong)(size_t)bytes == bytes; |
39 } | 39 } |
40 | 40 |
41 bool arrayOopDesc::test_max_array_length() { | 41 void arrayOopDesc::test_max_array_length() { |
42 tty->print_cr("test_max_array_length"); | |
43 | |
44 assert(check_max_length_overflow(T_BOOLEAN), "size_t overflow for boolean array"); | 42 assert(check_max_length_overflow(T_BOOLEAN), "size_t overflow for boolean array"); |
45 assert(check_max_length_overflow(T_CHAR), "size_t overflow for char array"); | 43 assert(check_max_length_overflow(T_CHAR), "size_t overflow for char array"); |
46 assert(check_max_length_overflow(T_FLOAT), "size_t overflow for float array"); | 44 assert(check_max_length_overflow(T_FLOAT), "size_t overflow for float array"); |
47 assert(check_max_length_overflow(T_DOUBLE), "size_t overflow for double array"); | 45 assert(check_max_length_overflow(T_DOUBLE), "size_t overflow for double array"); |
48 assert(check_max_length_overflow(T_BYTE), "size_t overflow for byte array"); | 46 assert(check_max_length_overflow(T_BYTE), "size_t overflow for byte array"); |
52 assert(check_max_length_overflow(T_OBJECT), "size_t overflow for object array"); | 50 assert(check_max_length_overflow(T_OBJECT), "size_t overflow for object array"); |
53 assert(check_max_length_overflow(T_ARRAY), "size_t overflow for array array"); | 51 assert(check_max_length_overflow(T_ARRAY), "size_t overflow for array array"); |
54 assert(check_max_length_overflow(T_NARROWOOP), "size_t overflow for narrowOop array"); | 52 assert(check_max_length_overflow(T_NARROWOOP), "size_t overflow for narrowOop array"); |
55 | 53 |
56 // T_VOID and T_ADDRESS are not supported by max_array_length() | 54 // T_VOID and T_ADDRESS are not supported by max_array_length() |
57 | |
58 return true; | |
59 } | 55 } |
60 | 56 |
61 | 57 |
62 #endif //PRODUCT | 58 #endif //PRODUCT |