mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +02:00
8313899: JVMCI exception Translation can fail in TranslatedException.<clinit>
Reviewed-by: never, thartmann
This commit is contained in:
parent
d97de8260c
commit
6f5c903d10
6 changed files with 59 additions and 2 deletions
|
@ -433,8 +433,7 @@ class HotSpotToSharedLibraryExceptionTranslation : public ExceptionTranslation {
|
|||
private:
|
||||
const Handle& _throwable;
|
||||
|
||||
int encode(JavaThread* THREAD, jlong buffer, int buffer_size) {
|
||||
Klass* vmSupport = SystemDictionary::resolve_or_fail(vmSymbols::jdk_internal_vm_VMSupport(), true, THREAD);
|
||||
bool handle_pending_exception(JavaThread* THREAD, jlong buffer, int buffer_size) {
|
||||
if (HAS_PENDING_EXCEPTION) {
|
||||
Handle throwable = Handle(THREAD, PENDING_EXCEPTION);
|
||||
Symbol *ex_name = throwable->klass()->name();
|
||||
|
@ -451,6 +450,14 @@ class HotSpotToSharedLibraryExceptionTranslation : public ExceptionTranslation {
|
|||
JVMCI_event_1("error translating exception: %s", char_buffer);
|
||||
decode(THREAD, _encode_fail, buffer);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
int encode(JavaThread* THREAD, jlong buffer, int buffer_size) {
|
||||
Klass* vmSupport = SystemDictionary::resolve_or_fail(vmSymbols::jdk_internal_vm_VMSupport(), true, THREAD);
|
||||
if (handle_pending_exception(THREAD, buffer, buffer_size)) {
|
||||
return 0;
|
||||
}
|
||||
JavaCallArguments jargs;
|
||||
|
@ -462,6 +469,9 @@ class HotSpotToSharedLibraryExceptionTranslation : public ExceptionTranslation {
|
|||
vmSupport,
|
||||
vmSymbols::encodeThrowable_name(),
|
||||
vmSymbols::encodeThrowable_signature(), &jargs, THREAD);
|
||||
if (handle_pending_exception(THREAD, buffer, buffer_size)) {
|
||||
return 0;
|
||||
}
|
||||
return result.get_jint();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue