Mercurial > hg > graal-compiler
comparison src/share/vm/oops/arrayOop.hpp @ 29:d5fc211aea19
6633953: type2aelembytes{T_ADDRESS} should be 8 bytes in 64 bit VM
Summary: T_ADDRESS size is defined as 'int' size (4 bytes) but C2 use it for raw pointers and as memory type for StoreP and LoadP nodes.
Reviewed-by: jrose
author | kvn |
---|---|
date | Mon, 25 Feb 2008 15:05:44 -0800 |
parents | a61af66fc99e |
children | ba764ed4b6f2 |
comparison
equal
deleted
inserted
replaced
28:67914967a4b5 | 29:d5fc211aea19 |
---|---|
56 // typeArrayOop::object_size(scale, length, header_size) without causing an | 56 // typeArrayOop::object_size(scale, length, header_size) without causing an |
57 // overflow. We substract an extra 2*wordSize to guard against double word | 57 // overflow. We substract an extra 2*wordSize to guard against double word |
58 // alignments. It gets the scale from the type2aelembytes array. | 58 // alignments. It gets the scale from the type2aelembytes array. |
59 static int32_t max_array_length(BasicType type) { | 59 static int32_t max_array_length(BasicType type) { |
60 assert(type >= 0 && type < T_CONFLICT, "wrong type"); | 60 assert(type >= 0 && type < T_CONFLICT, "wrong type"); |
61 assert(type2aelembytes[type] != 0, "wrong type"); | 61 assert(type2aelembytes(type) != 0, "wrong type"); |
62 // We use max_jint, since object_size is internally represented by an 'int' | 62 // We use max_jint, since object_size is internally represented by an 'int' |
63 // This gives us an upper bound of max_jint words for the size of the oop. | 63 // This gives us an upper bound of max_jint words for the size of the oop. |
64 int32_t max_words = (max_jint - header_size(type) - 2); | 64 int32_t max_words = (max_jint - header_size(type) - 2); |
65 int elembytes = (type == T_OBJECT) ? T_OBJECT_aelem_bytes : type2aelembytes[type]; | 65 int elembytes = (type == T_OBJECT) ? T_OBJECT_aelem_bytes : type2aelembytes(type); |
66 jlong len = ((jlong)max_words * HeapWordSize) / elembytes; | 66 jlong len = ((jlong)max_words * HeapWordSize) / elembytes; |
67 return (len > max_jint) ? max_jint : (int32_t)len; | 67 return (len > max_jint) ? max_jint : (int32_t)len; |
68 } | 68 } |
69 | 69 |
70 }; | 70 }; |