diff --git a/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/graphics/RGraphics.java b/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/graphics/RGraphics.java index bfb6cdde08b5aaa102fd4c791238cdd8d7bb453a..6aa3aada262c0373c5b3a4d04ead7cc74dbe9a59 100644 --- a/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/graphics/RGraphics.java +++ b/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/graphics/RGraphics.java @@ -64,7 +64,7 @@ public class RGraphics { DLL.RegisteredNativeSymbol rns = DLL.RegisteredNativeSymbol.any(); DLL.SymbolHandle func = DLL.findSymbol("InitGraphics", null, rns); assert func != DLL.SYMBOL_NOT_FOUND; - RFFIFactory.getRFFI().getCallRFFI().callRFFINode().invokeVoidCall(new NativeCallInfo("InitGraphics", func, DLL.findLibrary("graphics")), new Object[0]); + RFFIFactory.getRFFI().getCallRFFI().createCallRFFINode().invokeVoidCall(new NativeCallInfo("InitGraphics", func, DLL.findLibrary("graphics")), new Object[0]); } } } diff --git a/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/grid/GridFunctions.java b/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/grid/GridFunctions.java index 71cf528a84ff3e9f6eb91a48a91ac1b8319701e2..d5b7d3673e414fdb57e61d873620e74941340b9a 100644 --- a/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/grid/GridFunctions.java +++ b/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/grid/GridFunctions.java @@ -32,7 +32,7 @@ import com.oracle.truffle.r.runtime.ffi.RFFIFactory; public class GridFunctions { public abstract static class InitGrid extends RExternalBuiltinNode.Arg1 { - @Child GridRFFI.GridRFFINode gridRFFINode = RFFIFactory.getRFFI().getGridRFFI().gridRFFINode(); + @Child GridRFFI.GridRFFINode gridRFFINode = RFFIFactory.getRFFI().getGridRFFI().createGridRFFINode(); @Specialization @TruffleBoundary @@ -42,7 +42,7 @@ public class GridFunctions { } public static final class KillGrid extends RExternalBuiltinNode { - @Child GridRFFI.GridRFFINode gridRFFINode = RFFIFactory.getRFFI().getGridRFFI().gridRFFINode(); + @Child GridRFFI.GridRFFINode gridRFFINode = RFFIFactory.getRFFI().getGridRFFI().createGridRFFINode(); @Override @TruffleBoundary diff --git a/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/stats/Geom.java b/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/stats/Geom.java index ca8331b6c4f278d88f6fca1b4bce1bb4ded1a96e..2d9c81f9f15d5b506cc803b3adabdd34cf30ade5 100644 --- a/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/stats/Geom.java +++ b/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/stats/Geom.java @@ -37,6 +37,7 @@ import com.oracle.truffle.r.library.stats.StatsFunctions.Function2_2; public class Geom { public static final class QGeom implements Function2_2 { + @Override public double evaluate(double p, double prob, boolean lowerTail, boolean logP) { if (prob <= 0 || prob > 1) { return RMath.mlError(); diff --git a/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/tools/C_ParseRd.java b/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/tools/C_ParseRd.java index 6e4b0c668a53fb90eb00a80bd21e0cb9716a9acd..d1ca9be10dc5ac29f642f8960f8e0c504341cff1 100644 --- a/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/tools/C_ParseRd.java +++ b/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/tools/C_ParseRd.java @@ -40,7 +40,7 @@ import com.oracle.truffle.r.runtime.ffi.RFFIFactory; import com.oracle.truffle.r.runtime.ffi.ToolsRFFI; public abstract class C_ParseRd extends RExternalBuiltinNode.Arg9 { - @Child ToolsRFFI.ToolsRFFINode toolsRFFINode = RFFIFactory.getRFFI().getToolsRFFI().toolsRFFINode(); + @Child ToolsRFFI.ToolsRFFINode toolsRFFINode = RFFIFactory.getRFFI().getToolsRFFI().createToolsRFFINode(); @Override protected void createCasts(CastBuilder casts) { diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/RBuiltinPackages.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/RBuiltinPackages.java index 0550a55c3bdd9628b69680a20f5fda5193ade6b6..535045ab1cba59cf3f21c3d8f60549161d9a1f2c 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/RBuiltinPackages.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/RBuiltinPackages.java @@ -38,6 +38,7 @@ import com.oracle.truffle.r.nodes.builtin.base.BaseVariables; import com.oracle.truffle.r.runtime.RDeparse; import com.oracle.truffle.r.runtime.REnvVars; import com.oracle.truffle.r.runtime.RInternalError; +import com.oracle.truffle.r.runtime.RRuntime; import com.oracle.truffle.r.runtime.RSource; import com.oracle.truffle.r.runtime.Utils; import com.oracle.truffle.r.runtime.builtins.RBuiltin; @@ -50,8 +51,6 @@ import com.oracle.truffle.r.runtime.data.RDataFactory; import com.oracle.truffle.r.runtime.data.RFunction; import com.oracle.truffle.r.runtime.env.REnvironment; import com.oracle.truffle.r.runtime.env.REnvironment.PutException; -import com.oracle.truffle.r.runtime.ffi.DLL; -import com.oracle.truffle.r.runtime.ffi.DLL.DLLException; /** * Support for loading the base package and also optional overrides for the packages provided with @@ -98,11 +97,10 @@ public final class RBuiltinPackages implements RBuiltinLookup { Utils.rSuicide(String.format("unable to open the base package %s", basePathbase)); } // Load the (stub) DLL for base - try { - DLL.loadPackageDLL(baseDirPath.resolve("libs").resolve("base.so").toString(), true, true); - } catch (DLLException ex) { - Utils.rSuicide(ex.getMessage()); - } + String path = baseDirPath.resolve("libs").resolve("base.so").toString(); + Source loadSource = RSource.fromTextInternal(".Internal(dyn.load(" + RRuntime.quoteString(path, false) + ", TRUE, TRUE, \"\"))", RSource.Internal.R_IMPL); + RContext.getEngine().parseAndEval(loadSource, baseFrame, false); + // Any RBuiltinKind.SUBSTITUTE functions installed above should not be overridden try { RContext.getInstance().setLoadingBase(true); diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/DynLoadFunctions.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/DynLoadFunctions.java index 9edab7fbd30972db49f6a3a5f47d2996403c446e..91b440abc58300884c1fe7ce11b3eb9cdef5690f 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/DynLoadFunctions.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/DynLoadFunctions.java @@ -55,6 +55,8 @@ public class DynLoadFunctions { @RBuiltin(name = "dyn.load", visibility = OFF, kind = INTERNAL, parameterNames = {"lib", "local", "now", "unused"}, behavior = COMPLEX) public abstract static class DynLoad extends RBuiltinNode { + @Child private DLL.LoadPackageDLLNode loadPackageDLLNode = DLL.LoadPackageDLLNode.create(); + @Override protected void createCasts(CastBuilder casts) { casts.arg("lib").mustBe(stringValue()).asStringVector().mustBe(size(1), RError.Message.CHAR_ARGUMENT).findFirst(); @@ -67,7 +69,7 @@ public class DynLoadFunctions { @TruffleBoundary protected RList doDynLoad(String lib, boolean local, boolean now, @SuppressWarnings("unused") String unused) { try { - DLLInfo dllInfo = DLL.loadPackageDLL(lib, local, now); + DLLInfo dllInfo = loadPackageDLLNode.loadPackageDLL(lib, local, now); return dllInfo.toRList(); } catch (DLLException ex) { // This is not a recoverable error diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/GrepFunctions.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/GrepFunctions.java index 06999f6a158957e5ea50770f8477daea0db39bec..fbaf2c1d0ed89cda0558bcd0e1b6be5d675a333b 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/GrepFunctions.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/GrepFunctions.java @@ -63,7 +63,7 @@ import com.oracle.truffle.r.runtime.ops.na.NACheck; */ public class GrepFunctions { public abstract static class CommonCodeAdapter extends RBuiltinNode { - @Child protected PCRERFFI.PCRERFFINode pcreRFFINode = RFFIFactory.getRFFI().getPCRERFFI().pcreRFFINode(); + @Child protected PCRERFFI.PCRERFFINode pcreRFFINode = RFFIFactory.getRFFI().getPCRERFFI().createPCRERFFINode(); /** * This profile is needed to satisfy API requirements. diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/LaFunctions.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/LaFunctions.java index bd82f21a35e201aa79282e19a78421de2cdd864c..2dad6301ea6eca72e44a2a179ab7ffb2d0f5c549 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/LaFunctions.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/LaFunctions.java @@ -63,7 +63,7 @@ import com.oracle.truffle.r.runtime.ops.na.NACheck; public class LaFunctions { protected abstract static class Adapter extends RBuiltinNode { - @Child protected LapackRFFI.LapackRFFINode lapackRFFINode = RFFIFactory.getRFFI().getLapackRFFI().getLapackRFFINode(); + @Child protected LapackRFFI.LapackRFFINode lapackRFFINode = RFFIFactory.getRFFI().getLapackRFFI().createLapackRFFINode(); } @RBuiltin(name = "La_version", kind = INTERNAL, parameterNames = {}, behavior = READS_STATE) diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/foreign/CallAndExternalFunctions.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/foreign/CallAndExternalFunctions.java index f143ca599f53f21618f57a0740fdf1daf303f033..6d1559d763aeafa49e50270dfe01f3a47718ce14 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/foreign/CallAndExternalFunctions.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/foreign/CallAndExternalFunctions.java @@ -141,7 +141,7 @@ public class CallAndExternalFunctions { } protected abstract static class CallRFFIAdapter extends LookupAdapter { - @Child protected CallRFFI.CallRFFINode callRFFINode = RFFIFactory.getRFFI().getCallRFFI().callRFFINode(); + @Child protected CallRFFI.CallRFFINode callRFFINode = RFFIFactory.getRFFI().getCallRFFI().createCallRFFINode(); } /** diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/foreign/Dqrcf.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/foreign/Dqrcf.java index ebf0fb5462597a941b316806e45c1e71959e5bc5..a8ac59b7406f81e36680f9a5cf2596b7d4b3c6d8 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/foreign/Dqrcf.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/foreign/Dqrcf.java @@ -25,7 +25,7 @@ import com.oracle.truffle.r.runtime.ffi.RApplRFFI; import com.oracle.truffle.r.runtime.ffi.RFFIFactory; public final class Dqrcf extends RExternalBuiltinNode { - @Child private RApplRFFI.RApplRFFINode rApplRFFINode = RFFIFactory.getRFFI().getRApplRFFI().rApplRFFINode(); + @Child private RApplRFFI.RApplRFFINode rApplRFFINode = RFFIFactory.getRFFI().getRApplRFFI().createRApplRFFINode(); private static final String E = RRuntime.NAMES_ATTR_EMPTY_VALUE; private static final RStringVector DQRCF_NAMES = RDataFactory.createStringVector(new String[]{E, E, E, E, E, E, "coef", "info"}, RDataFactory.COMPLETE_VECTOR); diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/foreign/Dqrdc2.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/foreign/Dqrdc2.java index d1cac035699cd82ebef27232c8f901a9bdff7631..7c9ae20b0b01c46ebfc2fb1f4fe44946c839c083 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/foreign/Dqrdc2.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/foreign/Dqrdc2.java @@ -24,7 +24,7 @@ import com.oracle.truffle.r.runtime.ffi.RApplRFFI; import com.oracle.truffle.r.runtime.ffi.RFFIFactory; public final class Dqrdc2 extends RExternalBuiltinNode { - @Child private RApplRFFI.RApplRFFINode rApplRFFINode = RFFIFactory.getRFFI().getRApplRFFI().rApplRFFINode(); + @Child private RApplRFFI.RApplRFFINode rApplRFFINode = RFFIFactory.getRFFI().getRApplRFFI().createRApplRFFINode(); private static final String E = RRuntime.NAMES_ATTR_EMPTY_VALUE; private static final RStringVector DQRDC2_NAMES = RDataFactory.createStringVector(new String[]{"qr", E, E, E, E, "rank", "qraux", "pivot", E}, RDataFactory.COMPLETE_VECTOR); diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/foreign/Fft.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/foreign/Fft.java index 16254566d51a4ccb1200c9ec529a2c4b8028a5c1..31db4963325002d4c9ddb1db5826bcefc7247f2a 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/foreign/Fft.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/foreign/Fft.java @@ -26,7 +26,7 @@ public abstract class Fft extends RExternalBuiltinNode.Arg2 { private final ConditionProfile zVecLgt1 = ConditionProfile.createBinaryProfile(); private final ConditionProfile noDims = ConditionProfile.createBinaryProfile(); - @Child private StatsRFFI.FFTNode fftNode = RFFIFactory.getRFFI().getStatsRFFI().fftNode(); + @Child private StatsRFFI.FFTNode fftNode = RFFIFactory.getRFFI().getStatsRFFI().createFFTNode(); @Override protected void createCasts(CastBuilder casts) { diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/foreign/FortranAndCFunctions.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/foreign/FortranAndCFunctions.java index af635ab2ccb0f6d77da60a71153212ff6c1d9f93..abf14d088d7d3deceb19912bb0298050b8343eb5 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/foreign/FortranAndCFunctions.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/foreign/FortranAndCFunctions.java @@ -62,7 +62,7 @@ public class FortranAndCFunctions { private static final int VECTOR_LOGICAL = 12; @SuppressWarnings("unused") private static final int VECTOR_STRING = 12; - @Child private CRFFI.CRFFINode cRFFINode = RFFIFactory.getRFFI().getCRFFI().getCRFFINode(); + @Child private CRFFI.CRFFINode cRFFINode = RFFIFactory.getRFFI().getCRFFI().createCRFFINode(); @Override public Object[] getDefaultParameterValues() { diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/fastr/FastrDqrls.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/fastr/FastrDqrls.java index 81767da8e0d65ae564317aac007716c30fede1f5..c739ffe80e385fe6d6f4ea1f1241ffe44e63e9eb 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/fastr/FastrDqrls.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/fastr/FastrDqrls.java @@ -39,7 +39,7 @@ import com.oracle.truffle.r.runtime.ffi.RFFIFactory; */ @RBuiltin(name = ".fastr.dqrls", visibility = OFF, kind = PRIMITIVE, parameterNames = {"x", "n", "p", "y", "ny", "tol", "coeff"}, behavior = PURE) public abstract class FastrDqrls extends RBuiltinNode { - @Child private RApplRFFI.RApplRFFINode rApplRFFINode = RFFIFactory.getRFFI().getRApplRFFI().rApplRFFINode(); + @Child private RApplRFFI.RApplRFFINode rApplRFFINode = RFFIFactory.getRFFI().getRApplRFFI().createRApplRFFINode(); private static final String[] NAMES = new String[]{"qr", "coefficients", "residuals", "effects", "rank", "pivot", "qraux", "tol", "pivoted"}; private static RStringVector namesVector = null; diff --git a/com.oracle.truffle.r.runtime.ffi/src/com/oracle/truffle/r/runtime/ffi/generic/Generic_Grid.java b/com.oracle.truffle.r.runtime.ffi/src/com/oracle/truffle/r/runtime/ffi/generic/Generic_Grid.java index f44263215c268e63a6344ef7b65906778e93d5a8..6161b0e4e724a3d1ddf555a888b9a41cf75a3858 100644 --- a/com.oracle.truffle.r.runtime.ffi/src/com/oracle/truffle/r/runtime/ffi/generic/Generic_Grid.java +++ b/com.oracle.truffle.r.runtime.ffi/src/com/oracle/truffle/r/runtime/ffi/generic/Generic_Grid.java @@ -34,7 +34,7 @@ import com.oracle.truffle.r.runtime.ffi.RFFIFactory; public class Generic_Grid implements GridRFFI { private static class Generic_GridRFFINode extends GridRFFINode { - private CallRFFI.CallRFFINode callRFFINode = RFFIFactory.getRFFI().getCallRFFI().callRFFINode(); + @Child private CallRFFI.CallRFFINode callRFFINode = RFFIFactory.getRFFI().getCallRFFI().createCallRFFINode(); private static final class GridProvider { private static GridProvider grid; @@ -81,7 +81,7 @@ public class Generic_Grid implements GridRFFI { } @Override - public GridRFFINode gridRFFINode() { + public GridRFFINode createGridRFFINode() { return new Generic_GridRFFINode(); } } diff --git a/com.oracle.truffle.r.runtime.ffi/src/com/oracle/truffle/r/runtime/ffi/generic/Generic_Tools.java b/com.oracle.truffle.r.runtime.ffi/src/com/oracle/truffle/r/runtime/ffi/generic/Generic_Tools.java index a7d4a797d516586fcb2b64369b4487be785948d0..6b8a93ca053a86a81ca62bbd16f8e73368633144 100644 --- a/com.oracle.truffle.r.runtime.ffi/src/com/oracle/truffle/r/runtime/ffi/generic/Generic_Tools.java +++ b/com.oracle.truffle.r.runtime.ffi/src/com/oracle/truffle/r/runtime/ffi/generic/Generic_Tools.java @@ -40,7 +40,7 @@ import com.oracle.truffle.r.runtime.ffi.ToolsRFFI; public class Generic_Tools implements ToolsRFFI { private static class Generic_ToolsRFFINode extends ToolsRFFINode { - private CallRFFI.CallRFFINode callRFFINode = RFFIFactory.getRFFI().getCallRFFI().callRFFINode(); + @Child private CallRFFI.CallRFFINode callRFFINode = RFFIFactory.getRFFI().getCallRFFI().createCallRFFINode(); private static final class ToolsProvider { private static final String C_PARSE_RD = "C_parseRd"; @@ -91,7 +91,7 @@ public class Generic_Tools implements ToolsRFFI { } @Override - public ToolsRFFINode toolsRFFINode() { + public ToolsRFFINode createToolsRFFINode() { return new Generic_ToolsRFFINode(); } } diff --git a/com.oracle.truffle.r.runtime.ffi/src/com/oracle/truffle/r/runtime/ffi/jni/JNI_C.java b/com.oracle.truffle.r.runtime.ffi/src/com/oracle/truffle/r/runtime/ffi/jni/JNI_C.java index 13092011133a88a6f06d7c522d8694b2cc92518f..2e7a4c3d7aef66bdb52e71eaafcc12f347d7858e 100644 --- a/com.oracle.truffle.r.runtime.ffi/src/com/oracle/truffle/r/runtime/ffi/jni/JNI_C.java +++ b/com.oracle.truffle.r.runtime.ffi/src/com/oracle/truffle/r/runtime/ffi/jni/JNI_C.java @@ -50,7 +50,7 @@ public class JNI_C implements CRFFI { private static native void c(long address, Object[] args); @Override - public CRFFINode getCRFFINode() { + public CRFFINode createCRFFINode() { return new JNI_CRFFINode(); } } diff --git a/com.oracle.truffle.r.runtime.ffi/src/com/oracle/truffle/r/runtime/ffi/jni/JNI_Call.java b/com.oracle.truffle.r.runtime.ffi/src/com/oracle/truffle/r/runtime/ffi/jni/JNI_Call.java index f39d93925ece061d526918cda5dd6933dec4b809..c543c998c7d80d7ef13fb33a23d3acb64187c309 100644 --- a/com.oracle.truffle.r.runtime.ffi/src/com/oracle/truffle/r/runtime/ffi/jni/JNI_Call.java +++ b/com.oracle.truffle.r.runtime.ffi/src/com/oracle/truffle/r/runtime/ffi/jni/JNI_Call.java @@ -137,7 +137,7 @@ public class JNI_Call implements CallRFFI { private static final boolean ForceRTLDGlobal = false; protected JNI_Call() { - loadLibrary(); + loadLibRLibrary(); } /** @@ -151,13 +151,13 @@ public class JNI_Call implements CallRFFI { * {@link DLLRFFI#dlopen} is called by {@link DLL#load} which uses JNI! */ @TruffleBoundary - private static void loadLibrary() { + private static void loadLibRLibrary() { String libjnibootPath = LibPaths.getBuiltinLibPath("jniboot"); System.load(libjnibootPath); String librffiPath = LibPaths.getBuiltinLibPath("R"); try { - DLL.load(librffiPath, ForceRTLDGlobal, false); + DLL.loadLibR(librffiPath, ForceRTLDGlobal, false); } catch (DLLException ex) { throw new RInternalError(ex, "error while loading " + librffiPath); } @@ -209,7 +209,7 @@ public class JNI_Call implements CallRFFI { private static native void callVoid1(long address, Object arg1); @Override - public CallRFFINode callRFFINode() { + public CallRFFINode createCallRFFINode() { return new JNI_CallRFFINode(); } diff --git a/com.oracle.truffle.r.runtime.ffi/src/com/oracle/truffle/r/runtime/ffi/jni/JNI_Lapack.java b/com.oracle.truffle.r.runtime.ffi/src/com/oracle/truffle/r/runtime/ffi/jni/JNI_Lapack.java index 6550897121e2872e3904231456e8e42fc25a22b2..7b0a29a0be58fd01a27701d12c1644b9c192da9e 100644 --- a/com.oracle.truffle.r.runtime.ffi/src/com/oracle/truffle/r/runtime/ffi/jni/JNI_Lapack.java +++ b/com.oracle.truffle.r.runtime.ffi/src/com/oracle/truffle/r/runtime/ffi/jni/JNI_Lapack.java @@ -101,7 +101,7 @@ public class JNI_Lapack implements LapackRFFI { } @Override - public LapackRFFINode getLapackRFFINode() { + public LapackRFFINode createLapackRFFINode() { return new JNI_LapackRFFINode(); } diff --git a/com.oracle.truffle.r.runtime.ffi/src/com/oracle/truffle/r/runtime/ffi/jni/JNI_PCRE.java b/com.oracle.truffle.r.runtime.ffi/src/com/oracle/truffle/r/runtime/ffi/jni/JNI_PCRE.java index cfad8dc4d53dd71361b00604d684f8cd5b28dde9..7ddfbc4b4367672b27f892e18660395cfce4bac6 100644 --- a/com.oracle.truffle.r.runtime.ffi/src/com/oracle/truffle/r/runtime/ffi/jni/JNI_PCRE.java +++ b/com.oracle.truffle.r.runtime.ffi/src/com/oracle/truffle/r/runtime/ffi/jni/JNI_PCRE.java @@ -83,7 +83,7 @@ public class JNI_PCRE implements PCRERFFI { int options, int[] ovector, int ovectorLen); @Override - public PCRERFFINode pcreRFFINode() { + public PCRERFFINode createPCRERFFINode() { return new JNI_PCRERFFINode(); } diff --git a/com.oracle.truffle.r.runtime.ffi/src/com/oracle/truffle/r/runtime/ffi/jni/JNI_RAppl.java b/com.oracle.truffle.r.runtime.ffi/src/com/oracle/truffle/r/runtime/ffi/jni/JNI_RAppl.java index 84e9f41389ea11c075246182b01961df103c41c7..995c4d0914be9d4c7a26355f15cf063fcc3a1cfe 100644 --- a/com.oracle.truffle.r.runtime.ffi/src/com/oracle/truffle/r/runtime/ffi/jni/JNI_RAppl.java +++ b/com.oracle.truffle.r.runtime.ffi/src/com/oracle/truffle/r/runtime/ffi/jni/JNI_RAppl.java @@ -47,7 +47,7 @@ public class JNI_RAppl implements RApplRFFI { } @Override - public RApplRFFINode rApplRFFINode() { + public RApplRFFINode createRApplRFFINode() { return new JNI_RApplRFFINode(); } // Checkstyle: stop method name diff --git a/com.oracle.truffle.r.runtime.ffi/src/com/oracle/truffle/r/runtime/ffi/jni/JNI_Stats.java b/com.oracle.truffle.r.runtime.ffi/src/com/oracle/truffle/r/runtime/ffi/jni/JNI_Stats.java index 9d9c6e186761d08d0260b495e0a95dd08a877d77..0905a092aa7460837a4c2a5129f538687ba18e59 100644 --- a/com.oracle.truffle.r.runtime.ffi/src/com/oracle/truffle/r/runtime/ffi/jni/JNI_Stats.java +++ b/com.oracle.truffle.r.runtime.ffi/src/com/oracle/truffle/r/runtime/ffi/jni/JNI_Stats.java @@ -68,7 +68,7 @@ public class JNI_Stats implements StatsRFFI { } @Override - public FFTNode fftNode() { + public FFTNode createFFTNode() { return new JNI_FFTNode(); } diff --git a/com.oracle.truffle.r.runtime.ffi/src/com/oracle/truffle/r/runtime/ffi/jni/JNI_UserRng.java b/com.oracle.truffle.r.runtime.ffi/src/com/oracle/truffle/r/runtime/ffi/jni/JNI_UserRng.java index d3df6fab2cec55f4abe60efa82b11b30dcdd99fc..e6e374a7981eb37e4eaba2cb5cc281b4a18d3185 100644 --- a/com.oracle.truffle.r.runtime.ffi/src/com/oracle/truffle/r/runtime/ffi/jni/JNI_UserRng.java +++ b/com.oracle.truffle.r.runtime.ffi/src/com/oracle/truffle/r/runtime/ffi/jni/JNI_UserRng.java @@ -55,7 +55,7 @@ public class JNI_UserRng implements UserRngRFFI { } @Override - public UserRngRFFINode userRngRFFINode() { + public UserRngRFFINode createUserRngRFFINode() { return new JNI_UserRngRFFINode(); } diff --git a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/TempPathName.java b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/TempPathName.java index cfea6f2476c315463f3cd03983a49b3ff3b3cb02..fcc8f9710fb7126add02d5490531426fe29d5974 100644 --- a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/TempPathName.java +++ b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/TempPathName.java @@ -68,7 +68,7 @@ public class TempPathName { } else { Utils.rSuicide("cannot create 'R_TempDir'"); } - RFFIFactory.getRFFI().getCallRFFI().callRFFINode().setTempDir(tempDirPath); + RFFIFactory.getRFFI().getCallRFFI().createCallRFFINode().setTempDir(tempDirPath); } } diff --git a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/context/RContext.java b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/context/RContext.java index 025fd11d7fdf7709d0c9bd88d687a2a8d839ed86..2067774aaf7ea5aefc56dfe42a2138cae2177b61 100644 --- a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/context/RContext.java +++ b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/context/RContext.java @@ -73,6 +73,7 @@ import com.oracle.truffle.r.runtime.data.RFunction; import com.oracle.truffle.r.runtime.data.RList; import com.oracle.truffle.r.runtime.data.RStringVector; import com.oracle.truffle.r.runtime.env.REnvironment; +import com.oracle.truffle.r.runtime.ffi.DLL; import com.oracle.truffle.r.runtime.ffi.RFFIContextStateFactory; import com.oracle.truffle.r.runtime.ffi.RFFIFactory; import com.oracle.truffle.r.runtime.instrument.InstrumentationState; @@ -410,6 +411,7 @@ public final class RContext extends ExecutionContext implements TruffleObject { public final LazyDBCache.ContextStateImpl stateLazyDBCache; public final InstrumentationState stateInstrumentation; public final ContextStateImpl stateInternalCode; + public final DLL.ContextStateImpl stateDLL; /** * RFFI implementation state. Cannot be final as choice of FFI implementation is not made at the * time the constructor is called. @@ -420,7 +422,7 @@ public final class RContext extends ExecutionContext implements TruffleObject { private ContextState[] contextStates() { return new ContextState[]{stateREnvVars, stateRProfile, stateROptions, stateREnvironment, stateRErrorHandling, stateRConnection, stateStdConnections, stateRNG, stateRFFI, stateRSerialize, - stateLazyDBCache, stateInstrumentation}; + stateLazyDBCache, stateInstrumentation, stateDLL}; } public static void setEmbedded() { @@ -464,6 +466,7 @@ public final class RContext extends ExecutionContext implements TruffleObject { this.stateLazyDBCache = LazyDBCache.ContextStateImpl.newContextState(); this.stateInstrumentation = InstrumentationState.newContextState(instrumenter); this.stateInternalCode = ContextStateImpl.newContextState(); + this.stateDLL = DLL.ContextStateImpl.newContextState(); this.engine = RContext.getRRuntimeASTAccess().createEngine(this); state.add(State.CONSTRUCTED); } @@ -521,11 +524,14 @@ public final class RContext extends ExecutionContext implements TruffleObject { stateRConnection.initialize(this); stateStdConnections.initialize(this); stateRNG.initialize(this); - this.stateRFFI = RFFIContextStateFactory.newContextState().initialize(this); + stateRFFI = RFFIContextStateFactory.newContextState(); + // separate in case initialize calls getStateRFFI()! + stateRFFI.initialize(this); stateRSerialize.initialize(this); stateLazyDBCache.initialize(this); stateInstrumentation.initialize(this); stateInternalCode.initialize(this); + stateDLL.initialize(this); state.add(State.INITIALIZED); if (!embedded) { @@ -544,7 +550,7 @@ public final class RContext extends ExecutionContext implements TruffleObject { this.methodTableDispatchOn = info.getParent().methodTableDispatchOn; } if (initial && !embedded) { - RFFIFactory.getRFFI().getCallRFFI().callRFFINode().setInteractive(isInteractive()); + RFFIFactory.getRFFI().getCallRFFI().createCallRFFINode().setInteractive(isInteractive()); initialContextInitialized = true; } return this; @@ -809,6 +815,10 @@ public final class RContext extends ExecutionContext implements TruffleObject { return exportedSymbols; } + public void addExportedSymbol(String name, TruffleObject obj) { + exportedSymbols.put(name, obj); + } + public TimeZone getSystemTimeZone() { return info.getSystemTimeZone(); } diff --git a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/ffi/CRFFI.java b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/ffi/CRFFI.java index 25fa782b9c8939f4717495b7b6a312bdcc6416e1..e8f6e117dc99f28a7193e8c03c849a5072386021 100644 --- a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/ffi/CRFFI.java +++ b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/ffi/CRFFI.java @@ -37,5 +37,5 @@ public interface CRFFI { public abstract void invoke(NativeCallInfo nativeCallInfo, Object[] args); } - CRFFINode getCRFFINode(); + CRFFINode createCRFFINode(); } diff --git a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/ffi/CallRFFI.java b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/ffi/CallRFFI.java index a773e43a2fc7d8d6af75ded36a1c99cb23c42971..8620608493e7cdee94b262335f988a7db60b54f5 100644 --- a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/ffi/CallRFFI.java +++ b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/ffi/CallRFFI.java @@ -54,6 +54,6 @@ public interface CallRFFI { public abstract void setInteractive(boolean interactive); } - CallRFFINode callRFFINode(); + CallRFFINode createCallRFFINode(); } diff --git a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/ffi/DLL.java b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/ffi/DLL.java index d76229b958d71e2df6fc08aaf7c2bd3af1e8c577..181da4cc9d31082accd86f6a2728539eb311a475 100644 --- a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/ffi/DLL.java +++ b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/ffi/DLL.java @@ -13,13 +13,12 @@ package com.oracle.truffle.r.runtime.ffi; import java.io.File; import java.util.ArrayList; -import java.util.Deque; -import java.util.concurrent.ConcurrentLinkedDeque; import java.util.concurrent.atomic.AtomicInteger; import com.oracle.truffle.api.CompilerAsserts; import com.oracle.truffle.api.CompilerDirectives.TruffleBoundary; import com.oracle.truffle.api.interop.TruffleObject; +import com.oracle.truffle.api.nodes.Node; import com.oracle.truffle.r.runtime.RError; import com.oracle.truffle.r.runtime.RError.RErrorException; import com.oracle.truffle.r.runtime.RInternalError; @@ -27,6 +26,7 @@ import com.oracle.truffle.r.runtime.RRuntime; import com.oracle.truffle.r.runtime.ReturnException; import com.oracle.truffle.r.runtime.Utils; import com.oracle.truffle.r.runtime.context.RContext; +import com.oracle.truffle.r.runtime.context.RContext.ContextState; import com.oracle.truffle.r.runtime.data.RDataFactory; import com.oracle.truffle.r.runtime.data.RExternalPtr; import com.oracle.truffle.r.runtime.data.RList; @@ -47,34 +47,63 @@ import com.oracle.truffle.r.runtime.ffi.CallRFFI.CallRFFINode; * <li>support native code of dynamically loaded user packages</li> * </ol> * - * In general, unloading a DLL may not be possible, so the set of DLLs have to be considered VM - * wide, in the sense of multiple {@link RContext}s. TODO what about mutable state in native code? - * So in the case of multiple {@link RContext}s package shared libraries may be registered multiple - * times and we must take care not to duplicate them in the meta-data here ({@link #list}). - * * Logic derived from Rdynload.c. For the most part we use the same type/function names as GnuR, * e.g. {@link NativeSymbolType}. + * + * Abstractly every {@link RContext} has its own unique list of loaded libraries, stored in the + * {@link ContextStateImpl} class. Concretely, an implementation of the {@link DLLRFFI} may or may + * not maintain separate instances. + * + * The {@code libR} library is a special case, as it is an implementation artifact and not visible + * at the R level. However, it is convenient to manage it in a similar way in this code. It is + * always stored in slot 0 of the list, and is hidden from R code. It is loaded by the + * {@link RFFIFactory} early in the startup, before the initial {@link RContext} is created, by + * {@link #loadLibR}. This should only be called once. */ public class DLL { + public static class ContextStateImpl implements RContext.ContextState { + private ArrayList<DLLInfo> list; + private RContext context; + + public static ContextStateImpl newContextState() { + return new ContextStateImpl(); + } + + @Override + public ContextState initialize(RContext contextArg) { + this.context = contextArg; + if (context.getKind() == RContext.ContextKind.SHARE_PARENT_RW) { + list = context.getParent().stateDLL.list; + } else { + list = new ArrayList<>(); + list.add(libRDLLInfo); + } + return this; + } + + @Override + public void beforeDestroy(RContext contextArg) { + if (context.getKind() != RContext.ContextKind.SHARE_PARENT_RW) { + for (int i = 1; i < list.size(); i++) { + DLLInfo dllInfo = list.get(i); + RFFIFactory.getRFFI().getDLLRFFI().dlclose(dllInfo.handle); + } + } + list = null; + } + + } + /** * The list of loaded DLLs. */ - private static Deque<DLLInfo> list = new ConcurrentLinkedDeque<>(); /** * Uniquely identifies the DLL (for use in an {@code externalptr}). */ private static final AtomicInteger ID = new AtomicInteger(); - public static Deque<DLLInfo> getList() { - return list; - } - - public static void addDLL(DLLInfo dllInfo) { - list.add(dllInfo); - } - public enum NativeSymbolType { C, Call, @@ -145,9 +174,12 @@ public class DLL { this.handle = handle; } - private static synchronized DLLInfo create(String name, String path, boolean dynamicLookup, Object handle) { + private static DLLInfo create(String name, String path, boolean dynamicLookup, Object handle, boolean addToList) { DLLInfo result = new DLLInfo(name, path, dynamicLookup, handle); - list.add(result); + if (addToList) { + ContextStateImpl contextState = getContextState(); + contextState.list.add(result); + } return result; } @@ -290,6 +322,10 @@ public class DLL { public static final SymbolHandle SYMBOL_NOT_FOUND = null; + private static ContextStateImpl getContextState() { + return RContext.getInstance().stateDLL; + } + public static boolean isDLLInfo(RExternalPtr info) { RSymbol tag = (RSymbol) info.getTag(); return tag.getName().equals(DLLInfo.DLL_INFO_REFERENCE); @@ -310,55 +346,85 @@ public class DLL { } } - /* - * There is no sense in throwing an RError if we fail to load/init a (default) package during - * initial context initialization, as it is essentially fatal for any of the standard packages - * and indicates a bug in the RFFI implementation. So we call Utils.fatalError instead. When the - * system is stable, we can undo this, so that errors loading (user) packages added to - * R_DEFAULT_PACKAGES do throw RErrors. + /** + * A temporary stash until such time as the initial context is initialized. */ + private static DLLInfo libRDLLInfo; + + /** + * Loads a the {@code libR} library. This is an implementation specific library N.B., when this + * is called for the first time, there is no {@link RContext} available, so we stash the result + * until {@link ContextStateImpl#initialize} is called. + */ + public static void loadLibR(String path, boolean local, boolean now) throws DLLException { + assert libRDLLInfo == null; + libRDLLInfo = doLoad(path, local, now, false); + } @TruffleBoundary - public static synchronized DLLInfo load(String path, boolean local, boolean now) throws DLLException { + public static DLLInfo load(String path, boolean local, boolean now) throws DLLException { String absPath = Utils.tildeExpand(path); - for (DLLInfo dllInfo : list) { + ContextStateImpl contextState = getContextState(); + for (DLLInfo dllInfo : contextState.list) { if (dllInfo.path.equals(absPath)) { // already loaded return dllInfo; } } - File file = new File(absPath); - Object handle = RFFIFactory.getRFFI().getDLLRFFI().dlopen(path, local, now); + return doLoad(absPath, local, now, true); + } + + /* + * There is no sense in throwing an RError if we fail to load/init a (default) package during + * initial context initialization, as it is essentially fatal for any of the standard packages + * and indicates a bug in the RFFI implementation. So we call Utils.fatalError instead. When the + * system is stable, we can undo this, so that errors loading (user) packages added to + * R_DEFAULT_PACKAGES do throw RErrors. + */ + + private static DLLInfo doLoad(String absPath, boolean local, boolean now, boolean addToList) throws DLLException { + Object handle = RFFIFactory.getRFFI().getDLLRFFI().dlopen(absPath, local, now); if (handle == null) { String dlError = RFFIFactory.getRFFI().getDLLRFFI().dlerror(); if (RContext.isInitialContextInitialized()) { - throw new DLLException(RError.Message.DLL_LOAD_ERROR, path, dlError); + throw new DLLException(RError.Message.DLL_LOAD_ERROR, absPath, dlError); } else { - throw Utils.rSuicide("error loading default package: " + path + "\n" + dlError); + throw Utils.rSuicide("error loading default package: " + absPath + "\n" + dlError); } } + DLLInfo dllInfo = DLLInfo.create(libName(absPath), absPath, true, handle, addToList); + return dllInfo; + } + + private static String libName(String absPath) { + File file = new File(absPath); String name = file.getName(); int dx = name.lastIndexOf('.'); if (dx > 0) { name = name.substring(0, dx); } - return DLLInfo.create(name, absPath, true, handle); + return name; } - private static final String R_INIT_PREFIX = "R_init_"; - private static CallRFFINode callRFFINode; + public static final String R_INIT_PREFIX = "R_init_"; - @TruffleBoundary - public static DLLInfo loadPackageDLL(String path, boolean local, boolean now) throws DLLException { - DLLInfo dllInfo = load(path, local, now); - // Search for init method - String pkgInit = R_INIT_PREFIX + dllInfo.name; - SymbolHandle initFunc = RFFIFactory.getRFFI().getDLLRFFI().dlsym(dllInfo.handle, pkgInit); - if (initFunc != SYMBOL_NOT_FOUND) { - synchronized (DLL.class) { + public static class LoadPackageDLLNode extends Node { + @Child private CallRFFINode callRFFINode; + + public static LoadPackageDLLNode create() { + return new LoadPackageDLLNode(); + } + + @TruffleBoundary + public DLLInfo loadPackageDLL(String path, boolean local, boolean now) throws DLLException { + DLLInfo dllInfo = load(path, local, now); + // Search for init method + String pkgInit = R_INIT_PREFIX + dllInfo.name; + SymbolHandle initFunc = RFFIFactory.getRFFI().getDLLRFFI().dlsym(dllInfo.handle, pkgInit); + if (initFunc != SYMBOL_NOT_FOUND) { try { if (callRFFINode == null) { - callRFFINode = RFFIFactory.getRFFI().getCallRFFI().callRFFINode(); + callRFFINode = insert(RFFIFactory.getRFFI().getCallRFFI().createCallRFFINode()); } callRFFINode.invokeVoidCall(new NativeCallInfo(pkgInit, initFunc, dllInfo), new Object[]{dllInfo}); } catch (ReturnException ex) { @@ -373,29 +439,33 @@ public class DLL { } } } + return dllInfo; } - return dllInfo; } @TruffleBoundary - public static synchronized void unload(String path) throws DLLException { + public static void unload(String path) throws DLLException { String absPath = Utils.tildeExpand(path); - for (DLLInfo info : list) { + ContextStateImpl contextState = getContextState(); + for (DLLInfo info : contextState.list) { if (info.path.equals(absPath)) { int rc = RFFIFactory.getRFFI().getDLLRFFI().dlclose(info.handle); if (rc != 0) { throw new DLLException(RError.Message.DLL_LOAD_ERROR, path, ""); } - list.remove(info); + contextState.list.remove(info); return; } } throw new DLLException(RError.Message.DLL_NOT_LOADED, path); } - public static synchronized ArrayList<DLLInfo> getLoadedDLLs() { + public static ArrayList<DLLInfo> getLoadedDLLs() { ArrayList<DLLInfo> result = new ArrayList<>(); - for (DLLInfo dllInfo : list) { + ContextStateImpl contextState = getContextState(); + // skip first entry (libR) + for (int i = 1; i < contextState.list.size(); i++) { + DLLInfo dllInfo = contextState.list.get(i); result.add(dllInfo); } return result; @@ -471,9 +541,10 @@ public class DLL { * {@code null}) */ @TruffleBoundary - public static synchronized SymbolHandle findSymbol(String name, String libName, RegisteredNativeSymbol rns) { + public static SymbolHandle findSymbol(String name, String libName, RegisteredNativeSymbol rns) { boolean all = libName == null || libName.length() == 0; - for (DLLInfo dllInfo : list) { + ContextStateImpl contextState = getContextState(); + for (DLLInfo dllInfo : contextState.list) { if (dllInfo.forceSymbols) { continue; } @@ -493,8 +564,9 @@ public class DLL { return SYMBOL_NOT_FOUND; } - public static synchronized DLLInfo findLibrary(String name) { - for (DLLInfo dllInfo : list) { + public static DLLInfo findLibrary(String name) { + ContextStateImpl contextState = getContextState(); + for (DLLInfo dllInfo : contextState.list) { if (dllInfo.name.equals(name)) { return dllInfo; } @@ -535,7 +607,7 @@ public class DLL { public static DLLInfo getEmbeddingDLLInfo() { DLLInfo result = findLibrary(EMBEDDING); if (result == null) { - result = DLLInfo.create(EMBEDDING, EMBEDDING, false, null); + result = DLLInfo.create(EMBEDDING, EMBEDDING, false, null, true); } return result; } diff --git a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/ffi/GridRFFI.java b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/ffi/GridRFFI.java index f413af683385fc1a4e029e7c9df982189261cd0c..9d410b1054b72fa146627a30012e09c103dbdcc8 100644 --- a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/ffi/GridRFFI.java +++ b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/ffi/GridRFFI.java @@ -32,5 +32,5 @@ public interface GridRFFI { public abstract Object killGrid(); } - GridRFFINode gridRFFINode(); + GridRFFINode createGridRFFINode(); } diff --git a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/ffi/LapackRFFI.java b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/ffi/LapackRFFI.java index 306186a614732b107b6f5bd119ede7fde980fe78..a8f3622fa426a6c5a8d5070705abf8a160e4ed08 100644 --- a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/ffi/LapackRFFI.java +++ b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/ffi/LapackRFFI.java @@ -90,5 +90,5 @@ public interface LapackRFFI { double[] z, int ldz, int[] isuppz, double[] work, int lwork, int[] iwork, int liwork); } - LapackRFFINode getLapackRFFINode(); + LapackRFFINode createLapackRFFINode(); } diff --git a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/ffi/PCRERFFI.java b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/ffi/PCRERFFI.java index 81a91ecb1dd6fc3fb695490d70743683550d32a6..cff6aadebf60cdce9f6b0f3aa44fd5789218a020 100644 --- a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/ffi/PCRERFFI.java +++ b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/ffi/PCRERFFI.java @@ -64,6 +64,6 @@ public interface PCRERFFI { public abstract int exec(long code, long extra, String subject, int offset, int options, int[] ovector); } - PCRERFFINode pcreRFFINode(); + PCRERFFINode createPCRERFFINode(); } diff --git a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/ffi/RApplRFFI.java b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/ffi/RApplRFFI.java index bc40f240118696438a50e3bb626e0b2501351e3a..189f88165c856c4296e52f25bdb2be52f43ec268 100644 --- a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/ffi/RApplRFFI.java +++ b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/ffi/RApplRFFI.java @@ -39,6 +39,6 @@ public interface RApplRFFI { public abstract void dqrls(double[] x, int n, int p, double[] y, int ny, double tol, double[] b, double[] rsd, double[] qty, int[] k, int[] jpvt, double[] qraux, double[] work); } - RApplRFFINode rApplRFFINode(); + RApplRFFINode createRApplRFFINode(); } diff --git a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/ffi/StatsRFFI.java b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/ffi/StatsRFFI.java index 6e4d58f145b96e6a330566e47c53d54e9842dfeb..67adab0639211e28786f15af9be6578e12abcdb6 100644 --- a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/ffi/StatsRFFI.java +++ b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/ffi/StatsRFFI.java @@ -36,6 +36,6 @@ public interface StatsRFFI { public abstract int executeWork(double[] a, int nseg, int n, int nspn, int isn, double[] work, int[] iwork); } - FFTNode fftNode(); + FFTNode createFFTNode(); } diff --git a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/ffi/ToolsRFFI.java b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/ffi/ToolsRFFI.java index 85538d2347d6d48776c8adab362c2db9ff192377..290daad5f02a030ce1c177c3b461f7332fb3fae4 100644 --- a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/ffi/ToolsRFFI.java +++ b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/ffi/ToolsRFFI.java @@ -45,5 +45,5 @@ public interface ToolsRFFI { RLogicalVector warndups); } - ToolsRFFINode toolsRFFINode(); + ToolsRFFINode createToolsRFFINode(); } diff --git a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/ffi/UserRngRFFI.java b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/ffi/UserRngRFFI.java index 569540ed503d52b74af5861cfab8276f66a275a7..64059decbdafae4071c9165e91a345da6c2f313d 100644 --- a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/ffi/UserRngRFFI.java +++ b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/ffi/UserRngRFFI.java @@ -39,6 +39,6 @@ public interface UserRngRFFI { public abstract void seeds(int[] n); } - UserRngRFFINode userRngRFFINode(); + UserRngRFFINode createUserRngRFFINode(); } diff --git a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/rng/user/UserRNG.java b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/rng/user/UserRNG.java index b209867c61113a26a4bd9f902f9a66675a84a2ae..dda0917b27a66980e39009f4f8094e370ac9c384 100644 --- a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/rng/user/UserRNG.java +++ b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/rng/user/UserRNG.java @@ -71,7 +71,7 @@ public final class UserRNG implements RandomNumberGenerator { private UserRngRFFI.UserRngRFFINode getUserRngRFFINode() { if (userRngRFFINode == null) { - userRngRFFINode = RFFIFactory.getRFFI().getUserRngRFFI().userRngRFFINode(); + userRngRFFINode = RFFIFactory.getRFFI().getUserRngRFFI().createUserRngRFFINode(); } return userRngRFFINode; }