[foreign-memaccess+abi] RFR: 8306668: Some foreign tests fail on x86
Maurizio Cimadamore
mcimadamore at openjdk.org
Fri Apr 21 10:17:57 UTC 2023
On Fri, 21 Apr 2023 10:09:08 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:
> Some foreign tests fail on x86, as a result of the changes in https://github.com/openjdk/panama-foreign/pull/775.
> This patch reverts the `long` -> `int` conversion logic in `Utils`, and it also fixes the following:
> * a new microbenchmark fails compilation on x86 because of a bad cast from pointer to long
> * exclude WindowsCallArrangerTest on x86
>
> I've tested this by building (and testing) a 32-bit JDK on my Linux x64 using `--with-target-bits=32`.
test/micro/org/openjdk/bench/java/lang/foreign/libPtr.c line 39:
> 37:
> 38: EXPORT long long id_ptr_long(void* ptr) {
> 39: return (long long)(size_t)ptr;
Note - these benchmarks do not care about the fact that some bits in the original value could be dropped to the floor. The benchmark aims at comparing the performance of passing/returning longs with that of passing/returning segments (e.g. to make sure that escape analysis works its magic). As such, lossy conversions are immaterial here.
-------------
PR Review Comment: https://git.openjdk.org/panama-foreign/pull/828#discussion_r1173598323
More information about the panama-dev
mailing list