JDK-8297431 added code for special handling of OutOfMemoryError when 
translating an exception between libjvmci and HotSpot[1].
Unfortunately, this code was deleted by JDK-8298099 when moving the exception 
translation mechanism to VMSupport[2].
This causes the VM to crash when an OOME occurs while translating an exception 
from HotSpot to libjvmci.
This PR revives the deleted code.

This bug was found by running 
`test/jdk/java/util/concurrent/locks/Lock/OOMEInAQS.java` on libgraal. The fix 
now makes the test pass.

[1] 
https://github.com/openjdk/jdk/commit/952e10055135613e8ea2b818a4f35842936f5633#diff-4d3a3b7e7e12e1d5b4cf3e4677d9e0de5e9df3bbf1bbfa0d8d43d12098d67dc4R222-R234
[2] 
https://github.com/openjdk/jdk/commit/8b69a2e434ad2fa3369079622b57afb973d5bd9a#diff-7292551772c27b7152a3333f03cbbad90a897c5e37c6a97d4026be835e6d8fe1R121-R125

-------------

Commit messages:
 - decodeAndThrowThrowable needs to handle error codes

Changes: https://git.openjdk.org/jdk/pull/12857/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=12857&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8303577
  Stats: 31 lines in 5 files changed: 22 ins; 0 del; 9 mod
  Patch: https://git.openjdk.org/jdk/pull/12857.diff
  Fetch: git fetch https://git.openjdk.org/jdk pull/12857/head:pull/12857

PR: https://git.openjdk.org/jdk/pull/12857

Reply via email to