Java Code Examples for com.oracle.truffle.api.interop.UnsupportedMessageException#printStackTrace()
The following examples show how to use
com.oracle.truffle.api.interop.UnsupportedMessageException#printStackTrace() .
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: GetArraySizeNode.java From nodeprof.js with Apache License 2.0 | 5 votes |
private static long getSize(DynamicObject arr) { /** * TODO, maybe JSArray.arrayGetLength(thisObj) is faster */ try { return InteropLibrary.getFactory().getUncached().getArraySize(arr); } catch (UnsupportedMessageException e) { Logger.error("ArrayGetSize failed"); e.printStackTrace(); } return -1; }
Example 2
Source File: ConvertToSqueakNode.java From trufflesqueak with MIT License | 5 votes |
@Specialization(guards = "lib.isBoolean(value)", limit = "1") protected static final boolean doBoolean(final Object value, @CachedLibrary("value") final InteropLibrary lib) { try { return lib.asBoolean(value); } catch (final UnsupportedMessageException e) { CompilerDirectives.transferToInterpreter(); e.printStackTrace(); return false; } }
Example 3
Source File: ConvertToSqueakNode.java From trufflesqueak with MIT License | 5 votes |
@Specialization(guards = "lib.isString(value)", limit = "1") protected static final NativeObject doString(final Object value, @CachedLibrary("value") final InteropLibrary lib, @CachedContext(SqueakLanguage.class) final SqueakImageContext image) { try { return image.asByteString(lib.asString(value)); } catch (final UnsupportedMessageException e) { CompilerDirectives.transferToInterpreter(); e.printStackTrace(); return image.asByteString(""); } }
Example 4
Source File: ConvertToSqueakNode.java From trufflesqueak with MIT License | 5 votes |
@Specialization(guards = "lib.fitsInLong(value)", limit = "1") protected static final long doLong(final Object value, @CachedLibrary("value") final InteropLibrary lib) { try { return lib.asLong(value); } catch (final UnsupportedMessageException e) { CompilerDirectives.transferToInterpreter(); e.printStackTrace(); return 0L; } }
Example 5
Source File: ConvertToSqueakNode.java From trufflesqueak with MIT License | 5 votes |
@Specialization(guards = {"lib.fitsInDouble(value)", "!lib.fitsInLong(value)"}, limit = "1") protected static final double doDouble(final Object value, @CachedLibrary("value") final InteropLibrary lib) { try { return lib.asDouble(value); } catch (final UnsupportedMessageException e) { CompilerDirectives.transferToInterpreter(); e.printStackTrace(); return 0D; } }
Example 6
Source File: SqueakFFIPrims.java From trufflesqueak with MIT License | 5 votes |
@Specialization(guards = {"getAtomicType(headerWord) == 10", "isPointerType(headerWord)"}, limit = "1") protected static final String doString(@SuppressWarnings("unused") final int headerWord, final Object value, @CachedLibrary("value") final InteropLibrary lib) { try { return lib.asString(value); } catch (final UnsupportedMessageException e) { CompilerDirectives.transferToInterpreter(); e.printStackTrace(); return "unknown"; } }