Class HeapIsolationException
- All Implemented Interfaces:
Serializable
TruffleObject cannot unbox a host object because the object
resides in a foreign heap.- Since:
- 25.1
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic HeapIsolationExceptioncreate()Creates a newHeapIsolationExceptionindicating that a host object cannot be unboxed because it was allocated in a foreign heap.static HeapIsolationExceptionCreates a newHeapIsolationExceptionindicating that a host object cannot be unboxed because it was allocated in a foreign heap.Methods inherited from class InteropException
fillInStackTrace, getCause, initCauseMethods inherited from class Throwable
addSuppressed, getLocalizedMessage, getStackTrace, getSuppressed, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Method Details
-
getMessage
- Overrides:
getMessagein classThrowable- Since:
- 25.1
-
create
Creates a newHeapIsolationExceptionindicating that a host object cannot be unboxed because it was allocated in a foreign heap. For example, whenInteropLibrary.asHostObject(Object)is invoked from within a polyglot isolate.This factory method is intended for use in
compiled code paths.- Since:
- 25.1
-
create
Creates a newHeapIsolationExceptionindicating that a host object cannot be unboxed because it was allocated in a foreign heap. For example, whenInteropLibrary.asHostObject(Object)is invoked from within a polyglot isolate.In addition, a cause may be provided. The cause should only be set if the guest language code caused this problem. An example for this is a language specific proxy mechanism that invokes guest language code to describe an object. If the guest language code fails to execute and this interop exception is a valid interpretation of the error, then the error should be provided as cause. The cause can then be used by the source language as new exception cause if the
InteropExceptionis translated to a source language error. If theInteropExceptionis discarded, then the cause will most likely get discarded by the source language as well. Note that the cause must be of typeAbstractTruffleExceptionotherwise anIllegalArgumentExceptionis thrown.This factory method is intended for use in
compiled code paths.- Since:
- 25.1
-