use of org.graalvm.polyglot.impl.AbstractPolyglotImpl.AbstractSourceDispatch in project graal by oracle.
the class HostContextDispatch method eval.
@Override
public Value eval(Object receiver, String language, Source source) {
HostContext context = (HostContext) receiver;
APIAccess apiAccess = polyglot.getAPIAccess();
AbstractSourceDispatch sourceDispatch = apiAccess.getDispatch(source);
Object sourceImpl = apiAccess.getReceiver(source);
String languageId = sourceDispatch.getLanguage(sourceImpl);
String characters = sourceDispatch.getCharacters(sourceImpl).toString();
long remoteValue = hostToGuest.remoteEval(context.remoteContext, languageId, characters);
return context.localContext.asValue(new HostGuestValue(hostToGuest, context.remoteContext, remoteValue));
}
Aggregations