com.oracle.truffle.api.dsl.UnsupportedSpecializationException Java Examples
The following examples show how to use
com.oracle.truffle.api.dsl.UnsupportedSpecializationException.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: HashemTaRepeatingNode.java From mr-hashemi with Universal Permissive License v1.0 | 6 votes |
private boolean evaluateCondition(VirtualFrame frame) { try { /* * The condition must evaluate to a boolean value, so we call the boolean-specialized * execute method. */ return conditionNode.executeBoolean(frame); } catch (UnexpectedResultException ex) { /* * The condition evaluated to a non-boolean result. This is a type error in the SL * program. We report it with the same exception that Truffle DSL generated nodes use to * report type errors. */ throw new UnsupportedSpecializationException(this, new Node[]{conditionNode}, ex.getResult()); } }
Example #2
Source File: HashemBuiltinNode.java From mr-hashemi with Universal Permissive License v1.0 | 5 votes |
@Override public final Object executeGeneric(VirtualFrame frame) { try { return execute(frame); } catch (UnsupportedSpecializationException e) { throw HashemException.typeError(e.getNode(), e.getSuppliedValues()); } }
Example #3
Source File: JavaObjectWrapper.java From trufflesqueak with MIT License | 5 votes |
@ExportMessage @ExportMessage(name = "isArrayElementModifiable") @TruffleBoundary protected boolean isArrayElementReadable(final long index, @Shared("sizeNode") @Cached final ArraySizeNode sizeNode) { try { return 0 <= index && index < sizeNode.execute(wrappedObject); } catch (final UnsupportedSpecializationException | UnsupportedMessageException e) { return false; } }
Example #4
Source File: JavaObjectWrapper.java From trufflesqueak with MIT License | 5 votes |
@ExportMessage @TruffleBoundary public long getArraySize(@Shared("sizeNode") @Cached final ArraySizeNode sizeNode) throws UnsupportedMessageException { try { return sizeNode.execute(wrappedObject); } catch (final UnsupportedSpecializationException e) { throw UnsupportedMessageException.create(); } }
Example #5
Source File: InvokeNode.java From mumbler with GNU General Public License v3.0 | 5 votes |
private MumblerFunction evaluateFunction(VirtualFrame virtualFrame) { try { return this.functionNode.executeMumblerFunction(virtualFrame); } catch (UnexpectedResultException e) { throw new UnsupportedSpecializationException(this, new Node[] {this.functionNode}, e); } }
Example #6
Source File: JavaObjectWrapper.java From trufflesqueak with MIT License | votes |
protected abstract int execute(Object object) throws UnsupportedSpecializationException, UnsupportedMessageException;