Skip to content
Snippets Groups Projects
Commit f0200120 authored by Mick Jordan's avatar Mick Jordan
Browse files

[GR-2798] Fixes for SVM build.

parents 15b76eaa 77505fa4
No related branches found
No related tags found
No related merge requests found
......@@ -156,6 +156,7 @@ public class DebugFunctions {
}
@Specialization
@TruffleBoundary
protected Object setBreakpoint(String fileName, int lineNr, boolean clear) {
try {
......
......@@ -257,7 +257,7 @@ public class FastRInterop {
}
@Fallback
public byte isNull(Object obj) {
public byte isNull(@SuppressWarnings("unused") Object obj) {
return RRuntime.asLogical(false);
}
}
......@@ -277,7 +277,7 @@ public class FastRInterop {
}
@Fallback
public byte isExecutable(Object obj) {
public byte isExecutable(@SuppressWarnings("unused") Object obj) {
return RRuntime.asLogical(false);
}
}
......@@ -450,8 +450,7 @@ public class FastRInterop {
@TruffleBoundary
public TruffleObject javaClass(String clazz, boolean silent) {
try {
ClassLoader interopClassLoader = RContext.getInstance().getInteropClassLoader();
return JavaInterop.asTruffleObject(interopClassLoader.loadClass(clazz.replaceAll("/", ".")));
return JavaInterop.asTruffleObject(RContext.getInstance().loadClass(clazz.replaceAll("/", ".")));
} catch (ClassNotFoundException | SecurityException | IllegalArgumentException e) {
if (silent) {
return RNull.instance;
......
......@@ -26,6 +26,7 @@ import static com.oracle.truffle.r.nodes.builtin.CastBuilder.Predef.instanceOf;
import static com.oracle.truffle.r.runtime.RVisibility.ON;
import static com.oracle.truffle.r.runtime.builtins.RBuiltinKind.PRIMITIVE;
import com.oracle.truffle.api.CompilerDirectives.TruffleBoundary;
import com.oracle.truffle.api.dsl.Fallback;
import com.oracle.truffle.api.dsl.Specialization;
import com.oracle.truffle.api.nodes.Node;
......@@ -59,6 +60,7 @@ public abstract class FastRSourceInfo extends RBuiltinNode.Arg1 {
return srcInfo(fun.getRep());
}
@TruffleBoundary
private static Object srcInfo(Node fun) {
SourceSection ss = fun.getSourceSection();
if (ss != null) {
......
......@@ -66,6 +66,7 @@ import com.oracle.truffle.api.vm.PolyglotEngine;
import com.oracle.truffle.r.launcher.RCmdOptions;
import com.oracle.truffle.r.launcher.RCmdOptions.Client;
import com.oracle.truffle.r.launcher.RStartParams;
import com.oracle.truffle.r.runtime.FastRConfig;
import com.oracle.truffle.r.runtime.LazyDBCache;
import com.oracle.truffle.r.runtime.PrimitiveMethodsInfo;
import com.oracle.truffle.r.runtime.REnvVars;
......@@ -289,7 +290,7 @@ public final class RContext implements RTruffleObject {
private PrimitiveMethodsInfo primitiveMethodsInfo;
/** Class loader for Java interop. */
private ClassLoader interopClassLoader = getClass().getClassLoader();
private ClassLoader interopClassLoader = FastRConfig.InternalGridAwtSupport ? getClass().getClassLoader() : null;
/**
* Set to {@code true} when in embedded mode to allow other parts of the system to determine
......@@ -890,8 +891,11 @@ public final class RContext implements RTruffleObject {
}
};
public ClassLoader getInteropClassLoader() {
return interopClassLoader;
public Class<?> loadClass(String className) throws ClassNotFoundException {
if (FastRConfig.InternalGridAwtSupport) {
return interopClassLoader.loadClass(className);
}
return Class.forName(className);
}
/**
......@@ -899,6 +903,10 @@ public final class RContext implements RTruffleObject {
* loader with the previous one as parent.
*/
public void addInteropClasspathEntries(String... entries) throws MalformedURLException {
if (!FastRConfig.InternalGridAwtSupport) {
throw RError.error(RError.NO_CALLER, RError.Message.GENERIC, "Custom class loading not supported.");
}
URL[] urls = new URL[entries.length];
for (int i = 0; i < entries.length; i++) {
urls[i] = Paths.get(entries[i]).toUri().toURL();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment