Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.oracle.truffle.api.impl;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.lang.reflect.Type;
import java.util.Collection;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
import java.util.function.BiFunction;
import java.util.function.Supplier;
import org.graalvm.options.OptionDescriptors;
import org.graalvm.options.OptionValues;
import org.graalvm.polyglot.PolyglotException;
import org.graalvm.polyglot.Value;
import org.graalvm.polyglot.io.FileSystem;
import com.oracle.truffle.api.CallTarget;
import com.oracle.truffle.api.CompilerDirectives.CompilationFinal;
import com.oracle.truffle.api.InstrumentInfo;
import com.oracle.truffle.api.RootCallTarget;
import com.oracle.truffle.api.Scope;
import com.oracle.truffle.api.Truffle;
import com.oracle.truffle.api.TruffleContext;
import com.oracle.truffle.api.TruffleFile;
import com.oracle.truffle.api.TruffleLanguage;
import com.oracle.truffle.api.TruffleLanguage.Env;
import com.oracle.truffle.api.TruffleOptions;
import com.oracle.truffle.api.frame.Frame;
import com.oracle.truffle.api.frame.FrameDescriptor;
import com.oracle.truffle.api.frame.MaterializedFrame;
import com.oracle.truffle.api.nodes.ExecutableNode;
import com.oracle.truffle.api.nodes.LanguageInfo;
import com.oracle.truffle.api.nodes.Node;
import com.oracle.truffle.api.nodes.RootNode;
import com.oracle.truffle.api.source.Source;
import com.oracle.truffle.api.source.SourceSection;
import java.util.logging.Handler;
import java.util.logging.Level;
import java.util.logging.LogRecord;
/**
* Communication between TruffleLanguage API/SPI, and other services.
*/
@SuppressWarnings("deprecation")
public abstract class Accessor {
@SuppressWarnings("all")
protected final Collection loaders() {
return TruffleLocator.loaders();
}
protected void initializeNativeImageTruffleLocator() {
TruffleLocator.initializeNativeImageTruffleLocator();
}
public abstract static class Nodes {
public abstract boolean isInstrumentable(RootNode rootNode);
public abstract boolean isTaggedWith(Node node, Class> tag);
public abstract boolean isCloneUninitializedSupported(RootNode rootNode);
public abstract RootNode cloneUninitialized(RootNode rootNode);
public abstract int adoptChildrenAndCount(RootNode rootNode);
public abstract Object getEngineObject(LanguageInfo languageInfo);
public abstract TruffleLanguage> getLanguage(RootNode languageInfo);
public abstract LanguageInfo createLanguage(Object vmObject, String id, String name, String version, Set mimeTypes, boolean internal, boolean interactive);
public abstract Object getSourceVM(RootNode rootNode);
public abstract int getRootNodeBits(RootNode root);
public abstract void setRootNodeBits(RootNode root, int bits);
public abstract Lock getLock(Node node);
public void reportPolymorphicSpecialize(Node node) {
SUPPORT.reportPolymorphicSpecialize(node);
}
}
public abstract static class SourceSupport {
public abstract Object getSourceIdentifier(Source source);
public abstract Source copySource(Source source);
public abstract void setPolyglotSource(Source source, org.graalvm.polyglot.Source polyglotSource);
public abstract org.graalvm.polyglot.Source getPolyglotSource(Source source);
}
public abstract static class DumpSupport {
public abstract void dump(Node newNode, Node newChild, CharSequence reason);
}
public abstract static class InteropSupport {
public abstract boolean canHandle(Object foreignAccess, Object receiver);
public abstract CallTarget canHandleTarget(Object access);
public abstract boolean isTruffleObject(Object value);
public abstract void checkInteropType(Object result);
public abstract Object createDefaultNodeObject(Node node);
public abstract boolean isValidNodeObject(Object obj);
}
public abstract static class JavaInteropSupport {
public abstract Node createToJavaNode();
public abstract Object toJava(Node toJavaNode, Class> rawType, Type genericType, Object guestObject, Object polyglotContext);
public abstract Object asHostObject(Object guestObject);
public abstract Object toGuestObject(Object hostObject, Object languageContext);
public abstract Object asBoxedGuestValue(Object hostObject, Object languageContext);
public abstract Object asStaticClassObject(Class> clazz, Object hostLanguageContext);
public abstract boolean isHostObject(Object guestObject);
public abstract boolean isHostFunction(Object guestObject);
public abstract String javaGuestFunctionToString(Object object);
public abstract boolean isHostSymbol(Object guestObject);
}
public abstract static class EngineSupport {
public static final int EXECUTION_EVENT = 1;
public static final int SUSPENDED_EVENT = 2;
@SuppressWarnings("rawtypes")
public abstract Env findEnv(Object vm, Class extends TruffleLanguage> languageClass, boolean failIfNotFound);
public abstract Object getInstrumentationHandler(Object languageShared);
public abstract void exportSymbol(Object vmObject, String symbolName, Object value);
public abstract Map getExportedSymbols(Object vmObject);
public abstract Object importSymbol(Object vmObject, Env env, String symbolName);
public abstract boolean isMimeTypeSupported(Object languageShared, String mimeType);
public abstract void registerDebugger(Object vm, Object debugger);
public abstract boolean isEvalRoot(RootNode target);
public abstract Object findOriginalObject(Object truffleObject);
public abstract T lookupJavaInteropCodeCache(Object languageContext, Object key, Class expectedType);
public abstract T installJavaInteropCodeCache(Object languageContext, Object key, T value, Class expectedType);
@SuppressWarnings("static-method")
public final void attachOutputConsumer(DispatchOutputStream dos, OutputStream out) {
dos.attach(out);
}
@SuppressWarnings("static-method")
public final void detachOutputConsumer(DispatchOutputStream dos, OutputStream out) {
dos.detach(out);
}
public abstract Object getCurrentVM();
public abstract CallTarget parseForLanguage(Object vmObject, Source source, String[] argumentNames);
public abstract Env getEnvForInstrument(Object vm, String languageId, String mimeType);
public abstract Env getEnvForInstrument(LanguageInfo language);
public abstract Env getExistingEnvForInstrument(LanguageInfo language);
public abstract LanguageInfo getObjectLanguage(Object obj, Object vmObject);
public abstract Object getCurrentContext(Object languageVMObject);
public abstract boolean isDisposed(Object vmInstance);
public abstract Map getLanguages(Object vmInstance);
public abstract Map getInstruments(Object vmInstance);
public abstract org.graalvm.polyglot.SourceSection createSourceSection(Object vmObject, org.graalvm.polyglot.Source source, SourceSection sectionImpl);
public abstract T lookup(InstrumentInfo info, Class serviceClass);
public abstract S lookup(LanguageInfo language, Class type);
public abstract > T getCurrentLanguage(Class languageClass);
public abstract > C getCurrentContext(Class languageClass);
public abstract TruffleContext getPolyglotContext(Object vmObject);
public abstract Value toHostValue(Object obj, Object languageContext);
public abstract Object toGuestValue(Object obj, Object languageContext);
public abstract Object getVMFromLanguageObject(Object engineObject);
public abstract OptionValues getCompilerOptionValues(RootNode rootNode);
public abstract Object lookupHostSymbol(Object vmObject, Env env, String symbolName);
public abstract Object asHostSymbol(Object vmObject, Class> symbolClass);
public abstract boolean isHostAccessAllowed(Object vmObject, Env env);
public abstract boolean isNativeAccessAllowed(Object vmObject, Env env);
public abstract Object createInternalContext(Object vmObject, Map config, TruffleContext spiContext);
public abstract void initializeInternalContext(Object vmObject, Object contextImpl);
public abstract Object enterInternalContext(Object impl);
public abstract void leaveInternalContext(Object impl, Object prev);
public abstract void closeInternalContext(Object impl);
public abstract void reportAllLanguageContexts(Object vmObject, Object contextsListener);
public abstract void reportAllContextThreads(Object vmObject, Object threadsListener);
public abstract TruffleContext getParentContext(Object impl);
public abstract boolean isCreateThreadAllowed(Object vmObject);
public abstract Thread createThread(Object vmObject, Runnable runnable, Object context);
public abstract Iterable createDefaultLexicalScope(Node node, Frame frame);
public abstract Iterable createDefaultTopScope(Object global);
public abstract RuntimeException wrapHostException(Object languageContext, Throwable exception);
public abstract RootNode wrapHostBoundary(ExecutableNode executableNode, Supplier name);
public abstract BiFunction