@Override @SuppressWarnings("deprecation") protected Object executeImpl(VirtualFrame frame) { final TruffleObject receiver = ForeignAccess.getReceiver(frame); final Object[] args = ForeignAccess.getArguments(frame).toArray(); unwrapArgs(engine, args); Object tmp = ForeignAccess.execute(messageNode, null, receiver, args); return returnConvertNode.convert(tmp); } }
protected final boolean isBoxedPrimitive(VirtualFrame frame, TruffleObject object) { if (isBoxed == null) { CompilerDirectives.transferToInterpreterAndInvalidate(); isBoxed = insert(Message.IS_BOXED.createNode()); } return (boolean) ForeignAccess.execute(isBoxed, frame, object); }
@Specialization(guards = "isBoxedPrimitive(frame, foreignValue)") public Object executeUnbox(VirtualFrame frame, TruffleObject foreignValue) { if (unbox == null) { CompilerDirectives.transferToInterpreterAndInvalidate(); unbox = insert(Message.UNBOX.createNode()); } return ForeignAccess.execute(unbox, frame, foreignValue); }