There are lots of places in the VM that assume that if a double is
{big,little}-endian, then so is a jlong/int64_t. Apparently this is not true
for all platforms (ARM reported this problem), so the code is not portable if
the ll_* functions are operating on the native long long type. It is
undesirable to rewrite all the ll_* functions just to change the endianness,
because it would slow down math operations on Java long values.
Example from classload.c:
case CONSTANT_Long:
case CONSTANT_Double: {
unsigned high = get4bytes(context);
unsigned low = get4bytes(context);
int64_t value;
value = ll_add(ll_shl(uint2ll(high), 32), uint2ll(low));
SET_INT64(t1, &constant_pool[i], value);
dean.long@Eng 1997-07-31
{big,little}-endian, then so is a jlong/int64_t. Apparently this is not true
for all platforms (ARM reported this problem), so the code is not portable if
the ll_* functions are operating on the native long long type. It is
undesirable to rewrite all the ll_* functions just to change the endianness,
because it would slow down math operations on Java long values.
Example from classload.c:
case CONSTANT_Long:
case CONSTANT_Double: {
unsigned high = get4bytes(context);
unsigned low = get4bytes(context);
int64_t value;
value = ll_add(ll_shl(uint2ll(high), 32), uint2ll(low));
SET_INT64(t1, &constant_pool[i], value);
dean.long@Eng 1997-07-31
- duplicates
-
JDK-4085671 shared code assumes that the IEEE 64-bit can be interchanged with int64_t
-
- Closed
-