diff --git a/com.oracle.truffle.r.engine/src/com/oracle/truffle/r/engine/REngine.java b/com.oracle.truffle.r.engine/src/com/oracle/truffle/r/engine/REngine.java index eadcc67c1691925fac1754d3f54317dbf876dcd6..f25b9edc617ed3520201d395dbc3574a5ad23c2c 100644 --- a/com.oracle.truffle.r.engine/src/com/oracle/truffle/r/engine/REngine.java +++ b/com.oracle.truffle.r.engine/src/com/oracle/truffle/r/engine/REngine.java @@ -38,23 +38,18 @@ import com.oracle.truffle.api.CompilerDirectives.CompilationFinal; import com.oracle.truffle.api.CompilerDirectives.TruffleBoundary; import com.oracle.truffle.api.RootCallTarget; import com.oracle.truffle.api.Truffle; -import com.oracle.truffle.api.TruffleLanguage; import com.oracle.truffle.api.dsl.UnsupportedSpecializationException; 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.frame.VirtualFrame; import com.oracle.truffle.api.impl.FindContextNode; -import com.oracle.truffle.api.interop.ForeignAccess; import com.oracle.truffle.api.interop.TruffleObject; import com.oracle.truffle.api.nodes.RootNode; import com.oracle.truffle.api.profiles.ConditionProfile; import com.oracle.truffle.api.profiles.ValueProfile; import com.oracle.truffle.api.source.Source; import com.oracle.truffle.api.source.SourceSection; -import com.oracle.truffle.r.engine.interop.RAbstractVectorAccessFactory; -import com.oracle.truffle.r.engine.interop.RFunctionAccessFactory; -import com.oracle.truffle.r.engine.interop.RListAccessFactory; import com.oracle.truffle.r.library.graphics.RGraphics; import com.oracle.truffle.r.nodes.RASTBuilder; import com.oracle.truffle.r.nodes.RASTUtils; @@ -93,7 +88,6 @@ import com.oracle.truffle.r.runtime.data.RDataFactory; import com.oracle.truffle.r.runtime.data.RExpression; import com.oracle.truffle.r.runtime.data.RFunction; import com.oracle.truffle.r.runtime.data.RLanguage; -import com.oracle.truffle.r.runtime.data.RList; import com.oracle.truffle.r.runtime.data.RMissing; import com.oracle.truffle.r.runtime.data.RNull; import com.oracle.truffle.r.runtime.data.RPromise; @@ -620,22 +614,4 @@ final class REngine implements Engine, Engine.Timings { private static Object evaluatePromise(Object value) { return value instanceof RPromise ? PromiseHelperNode.evaluateSlowPath(null, (RPromise) value) : value; } - - @Override - public Class<? extends TruffleLanguage<RContext>> getTruffleLanguage() { - return TruffleRLanguage.class; - } - - @Override - public ForeignAccess getForeignAccess(RTypedValue value) { - if (value instanceof RList) { - return ForeignAccess.create(RList.class, new RListAccessFactory()); - } else if (value instanceof RAbstractVector) { - return ForeignAccess.create(RAbstractVector.class, new RAbstractVectorAccessFactory()); - } else if (value instanceof RFunction) { - return ForeignAccess.create(RFunction.class, new RFunctionAccessFactory()); - } else { - throw RInternalError.shouldNotReachHere("cannot create ForeignAccess for " + value); - } - } } diff --git a/com.oracle.truffle.r.engine/src/com/oracle/truffle/r/engine/TruffleRLanguage.java b/com.oracle.truffle.r.engine/src/com/oracle/truffle/r/engine/TruffleRLanguage.java index 0182f25bda731f5c77a100e0b00c39619d004891..6597b5811b101d74c449a954e550b4cd85596616 100644 --- a/com.oracle.truffle.r.engine/src/com/oracle/truffle/r/engine/TruffleRLanguage.java +++ b/com.oracle.truffle.r.engine/src/com/oracle/truffle/r/engine/TruffleRLanguage.java @@ -22,6 +22,7 @@ */ package com.oracle.truffle.r.engine; +import java.io.Closeable; import java.io.IOException; import java.util.Locale; @@ -33,6 +34,7 @@ import com.oracle.truffle.api.instrumentation.ProvidedTags; import com.oracle.truffle.api.instrumentation.StandardTags; import com.oracle.truffle.api.nodes.Node; import com.oracle.truffle.api.source.Source; +import com.oracle.truffle.r.engine.interop.RForeignAccessFactoryImpl; import com.oracle.truffle.r.nodes.RASTBuilder; import com.oracle.truffle.r.nodes.builtin.RBuiltinPackages; import com.oracle.truffle.r.nodes.instrumentation.RSyntaxTags; @@ -72,7 +74,7 @@ public final class TruffleRLanguage extends TruffleLanguage<RContext> { RVersionInfo.initialize(); TempPathName.initialize(); RPackageSource.initialize(); - RContext.initialize(new RASTBuilder(), new RRuntimeASTAccessImpl(), RBuiltinPackages.getInstance()); + RContext.initialize(new RASTBuilder(), new RRuntimeASTAccessImpl(), RBuiltinPackages.getInstance(), new RForeignAccessFactoryImpl()); } catch (Throwable t) { System.out.println("error during engine initialization:"); t.printStackTrace(); @@ -120,21 +122,23 @@ public final class TruffleRLanguage extends TruffleLanguage<RContext> { @Override protected CallTarget parse(Source source, Node context, String... argumentNames) throws IOException { - try { - return RContext.getEngine().parseToCallTarget(source); - } catch (IncompleteSourceException e) { - throw new com.oracle.truffle.api.vm.IncompleteSourceException(e); - } catch (ParseException e) { - return new CallTarget() { - @Override - public Object call(Object... arguments) { - try { - throw e.throwAsRError(); - } catch (@SuppressWarnings("hiding") RError e) { - return null; + try (Closeable c = RContext.withinContext(findContext(createFindContextNode()))) { + try { + return RContext.getEngine().parseToCallTarget(source); + } catch (IncompleteSourceException e) { + throw new com.oracle.truffle.api.vm.IncompleteSourceException(e); + } catch (ParseException e) { + return new CallTarget() { + @Override + public Object call(Object... arguments) { + try { + throw e.throwAsRError(); + } catch (@SuppressWarnings("hiding") RError e) { + return null; + } } - } - }; + }; + } } } @@ -150,10 +154,14 @@ public final class TruffleRLanguage extends TruffleLanguage<RContext> { } // TODO: why isn't the original method public? - Node actuallyCreateFindContextNode() { + public Node actuallyCreateFindContextNode() { return createFindContextNode(); } + public RContext actuallyFindContext0(Node contextNode) { + return findContext(contextNode); + } + @Override protected Object evalInContext(Source source, Node node, MaterializedFrame frame) throws IOException { return RContext.getEngine().parseAndEval(source, frame, false); diff --git a/com.oracle.truffle.r.engine/src/com/oracle/truffle/r/engine/interop/RForeignAccessFactoryImpl.java b/com.oracle.truffle.r.engine/src/com/oracle/truffle/r/engine/interop/RForeignAccessFactoryImpl.java new file mode 100644 index 0000000000000000000000000000000000000000..7ccbe72fabd3e1d07058684166c9696d07065dd9 --- /dev/null +++ b/com.oracle.truffle.r.engine/src/com/oracle/truffle/r/engine/interop/RForeignAccessFactoryImpl.java @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2016, 2016, 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. + * + * 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.r.engine.interop; + +import com.oracle.truffle.api.TruffleLanguage; +import com.oracle.truffle.api.interop.ForeignAccess; +import com.oracle.truffle.r.engine.TruffleRLanguage; +import com.oracle.truffle.r.runtime.RInternalError; +import com.oracle.truffle.r.runtime.context.RContext; +import com.oracle.truffle.r.runtime.context.RForeignAccessFactory; +import com.oracle.truffle.r.runtime.data.RFunction; +import com.oracle.truffle.r.runtime.data.RList; +import com.oracle.truffle.r.runtime.data.RTypedValue; +import com.oracle.truffle.r.runtime.data.model.RAbstractVector; + +public final class RForeignAccessFactoryImpl implements RForeignAccessFactory { + + @Override + public ForeignAccess getForeignAccess(RTypedValue value) { + if (value instanceof RList) { + return ForeignAccess.create(RList.class, new RListAccessFactory()); + } else if (value instanceof RAbstractVector) { + return ForeignAccess.create(RAbstractVector.class, new RAbstractVectorAccessFactory()); + } else if (value instanceof RFunction) { + return ForeignAccess.create(RFunction.class, new RFunctionAccessFactory()); + } else { + throw RInternalError.shouldNotReachHere("cannot create ForeignAccess for " + value); + } + } + + @Override + public Class<? extends TruffleLanguage<RContext>> getTruffleLanguage() { + return TruffleRLanguage.class; + } +} diff --git a/com.oracle.truffle.r.engine/src/com/oracle/truffle/r/engine/interop/RInteropExecuteNode.java b/com.oracle.truffle.r.engine/src/com/oracle/truffle/r/engine/interop/RInteropExecuteNode.java index 5bf61dfa52b1f88e09af93b8b802bfd6bf3fe778..7873795315bf19d5348df183bb1671fd96480fc8 100644 --- a/com.oracle.truffle.r.engine/src/com/oracle/truffle/r/engine/interop/RInteropExecuteNode.java +++ b/com.oracle.truffle.r.engine/src/com/oracle/truffle/r/engine/interop/RInteropExecuteNode.java @@ -22,24 +22,37 @@ */ package com.oracle.truffle.r.engine.interop; +import java.io.Closeable; +import java.io.IOException; import java.util.List; +import com.oracle.truffle.api.CompilerDirectives; import com.oracle.truffle.api.Truffle; import com.oracle.truffle.api.frame.FrameDescriptor; +import com.oracle.truffle.api.frame.FrameSlot; +import com.oracle.truffle.api.frame.FrameSlotKind; import com.oracle.truffle.api.frame.VirtualFrame; import com.oracle.truffle.api.interop.ForeignAccess; +import com.oracle.truffle.api.nodes.Node; import com.oracle.truffle.api.nodes.RootNode; import com.oracle.truffle.r.engine.TruffleRLanguage; import com.oracle.truffle.r.nodes.function.CallMatcherNode; +import com.oracle.truffle.r.nodes.function.RCallNode; import com.oracle.truffle.r.runtime.ArgumentsSignature; import com.oracle.truffle.r.runtime.RArguments; +import com.oracle.truffle.r.runtime.context.RContext; +import com.oracle.truffle.r.runtime.data.RArgsValuesAndNames; import com.oracle.truffle.r.runtime.data.RFunction; class RInteropExecuteNode extends RootNode { - private static final FrameDescriptor emptyFrameDescriptor = new FrameDescriptor(); + private static final FrameDescriptor emptyFrameDescriptor = new FrameDescriptor("R interop frame"); + private final Object argsIdentifier = new Object(); + private final FrameSlot slot = emptyFrameDescriptor.addFrameSlot(argsIdentifier, FrameSlotKind.Object); + @Child private RCallNode call = RCallNode.createExplicitCall(argsIdentifier); @Child private CallMatcherNode callMatcher = CallMatcherNode.create(false, true); + @Child private Node findContext = TruffleRLanguage.INSTANCE.actuallyCreateFindContextNode(); private final ArgumentsSignature suppliedSignature; @@ -56,6 +69,13 @@ class RInteropExecuteNode extends RootNode { Object[] dummyFrameArgs = RArguments.createUnitialized(); VirtualFrame dummyFrame = Truffle.getRuntime().createVirtualFrame(dummyFrameArgs, emptyFrameDescriptor); - return callMatcher.execute(dummyFrame, suppliedSignature, arguments.toArray(), function, null, null); + RArgsValuesAndNames actualArgs = new RArgsValuesAndNames(arguments.toArray(), suppliedSignature); + dummyFrame.setObject(slot, actualArgs); + try (Closeable c = RContext.withinContext(TruffleRLanguage.INSTANCE.actuallyFindContext0(findContext))) { + return call.execute(dummyFrame, function); + } catch (IOException e) { + CompilerDirectives.transferToInterpreter(); + throw new RuntimeException(e); + } } } diff --git a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/RRootNode.java b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/RRootNode.java index 739831680a32fb8089cc4e4e9f493683aa854445..a8ee35ebad0111baefdabfebe1200074f26f47a3 100644 --- a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/RRootNode.java +++ b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/RRootNode.java @@ -52,7 +52,7 @@ public abstract class RRootNode extends RootNode implements HasSignature { private final FormalArguments formalArguments; protected RRootNode(SourceSection src, FormalArguments formalArguments, FrameDescriptor frameDescriptor) { - super(RContext.getEngine().getTruffleLanguage(), checkSourceSection(src), frameDescriptor); + super(RContext.getRForeignAccessFactory().getTruffleLanguage(), checkSourceSection(src), frameDescriptor); this.formalArguments = formalArguments; } diff --git a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/context/Engine.java b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/context/Engine.java index 20c50d3593de1bcdd699c3f4a24b53a064c937c6..f70ade38916c468075d4431db4c0672ea5bc86af 100644 --- a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/context/Engine.java +++ b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/context/Engine.java @@ -27,9 +27,7 @@ import java.io.IOException; import com.oracle.truffle.api.CallTarget; import com.oracle.truffle.api.CompilerDirectives.TruffleBoundary; import com.oracle.truffle.api.RootCallTarget; -import com.oracle.truffle.api.TruffleLanguage; import com.oracle.truffle.api.frame.MaterializedFrame; -import com.oracle.truffle.api.interop.ForeignAccess; import com.oracle.truffle.api.source.Source; import com.oracle.truffle.api.vm.PolyglotEngine; import com.oracle.truffle.r.runtime.RError; @@ -38,7 +36,6 @@ import com.oracle.truffle.r.runtime.RSerialize; import com.oracle.truffle.r.runtime.data.RExpression; import com.oracle.truffle.r.runtime.data.RFunction; import com.oracle.truffle.r.runtime.data.RLanguage; -import com.oracle.truffle.r.runtime.data.RTypedValue; import com.oracle.truffle.r.runtime.env.REnvironment; import com.oracle.truffle.r.runtime.nodes.RNode; @@ -201,9 +198,4 @@ public interface Engine { String toString(Object value); RFunction parseFunction(String name, Source source, MaterializedFrame enclosingFrame) throws ParseException; - - ForeignAccess getForeignAccess(RTypedValue value); - - Class<? extends TruffleLanguage<RContext>> getTruffleLanguage(); - } 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 050000c91fc663d5ae2a5bebe4b13f68a69febc2..d0a10d3b4a3ad10f25aaf107641db694a9006a23 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 @@ -22,6 +22,7 @@ */ package com.oracle.truffle.r.runtime.context; +import java.io.Closeable; import java.io.IOException; import java.util.HashMap; import java.util.Map; @@ -302,6 +303,7 @@ public final class RContext extends ExecutionContext implements TruffleObject { @CompilationFinal private static RCodeBuilder<RSyntaxNode> astBuilder; @CompilationFinal private static RRuntimeASTAccess runtimeASTAccess; @CompilationFinal private static RBuiltinLookup builtinLookup; + @CompilationFinal private static RForeignAccessFactory foreignAccessFactory; @CompilationFinal private static boolean initialContextInitialized; public static boolean isInitialContextInitialized() { @@ -311,10 +313,11 @@ public final class RContext extends ExecutionContext implements TruffleObject { /** * Initialize VM-wide static values. */ - public static void initialize(RCodeBuilder<RSyntaxNode> rAstBuilder, RRuntimeASTAccess rRuntimeASTAccess, RBuiltinLookup rBuiltinLookup) { + public static void initialize(RCodeBuilder<RSyntaxNode> rAstBuilder, RRuntimeASTAccess rRuntimeASTAccess, RBuiltinLookup rBuiltinLookup, RForeignAccessFactory rForeignAccessFactory) { RContext.astBuilder = rAstBuilder; RContext.runtimeASTAccess = rRuntimeASTAccess; RContext.builtinLookup = rBuiltinLookup; + RContext.foreignAccessFactory = rForeignAccessFactory; } /** @@ -620,6 +623,10 @@ public final class RContext extends ExecutionContext implements TruffleObject { return builtinLookup.lookupBuiltinDescriptor(name); } + public static RForeignAccessFactory getRForeignAccessFactory() { + return foreignAccessFactory; + } + public RCmdOptions getOptions() { return info.getOptions(); } @@ -667,4 +674,15 @@ public final class RContext extends ExecutionContext implements TruffleObject { public ForeignAccess getForeignAccess() { throw new IllegalStateException("cannot access " + RContext.class.getSimpleName() + " via Truffle"); } + + public static Closeable withinContext(RContext context) { + RContext oldContext = RContext.threadLocalContext.get(); + RContext.threadLocalContext.set(context); + return new Closeable() { + @Override + public void close() { + RContext.threadLocalContext.set(oldContext); + } + }; + } } diff --git a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/context/RForeignAccessFactory.java b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/context/RForeignAccessFactory.java new file mode 100644 index 0000000000000000000000000000000000000000..54b789c5cc6a4d57fa58dc25df3cf12699b1374a --- /dev/null +++ b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/context/RForeignAccessFactory.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2016, 2016, 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. + * + * 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.r.runtime.context; + +import com.oracle.truffle.api.TruffleLanguage; +import com.oracle.truffle.api.interop.ForeignAccess; +import com.oracle.truffle.r.runtime.data.RTypedValue; + +public interface RForeignAccessFactory { + + ForeignAccess getForeignAccess(RTypedValue value); + + Class<? extends TruffleLanguage<RContext>> getTruffleLanguage(); +} diff --git a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/data/RFunction.java b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/data/RFunction.java index 1776974d65fbed194610457acfc2a496d3990ce4..db973989b0788abce48a22f4d2fe3e1c96d87652 100644 --- a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/data/RFunction.java +++ b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/data/RFunction.java @@ -119,7 +119,7 @@ public final class RFunction extends RSharingAttributeStorage implements RTypedV @Override public ForeignAccess getForeignAccess() { - return RContext.getEngine().getForeignAccess(this); + return RContext.getRForeignAccessFactory().getForeignAccess(this); } public FastPathFactory getFastPath() { diff --git a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/data/RList.java b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/data/RList.java index dd197d84b085c22e433267f05d54fc2308afd41a..e93178a5db5e3d67f69f1a46f1a55878b1482615 100644 --- a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/data/RList.java +++ b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/data/RList.java @@ -86,6 +86,6 @@ public final class RList extends RListBase implements TruffleObject { @Override public ForeignAccess getForeignAccess() { - return RContext.getEngine().getForeignAccess(this); + return RContext.getRForeignAccessFactory().getForeignAccess(this); } } diff --git a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/data/model/RAbstractVector.java b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/data/model/RAbstractVector.java index 18f116db02c61461015861d4cd831859be250f68..a868f5a1870f21b0536d57e409040b27c8c4f382 100644 --- a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/data/model/RAbstractVector.java +++ b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/data/model/RAbstractVector.java @@ -82,6 +82,6 @@ public interface RAbstractVector extends RAbstractContainer, TruffleObject { @Override default ForeignAccess getForeignAccess() { - return RContext.getEngine().getForeignAccess(this); + return RContext.getRForeignAccessFactory().getForeignAccess(this); } } diff --git a/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/tck/FastRTckTest.java b/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/tck/FastRTckTest.java index 73cd91202969b72b24a7f5a7f0074caeb700dd04..6ed608da4e7391b7000bea7843bb4793918b5d9c 100644 --- a/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/tck/FastRTckTest.java +++ b/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/tck/FastRTckTest.java @@ -28,6 +28,7 @@ import org.junit.Test; import com.oracle.truffle.api.source.Source; import com.oracle.truffle.api.vm.PolyglotEngine; +import com.oracle.truffle.api.vm.PolyglotEngine.Builder; import com.oracle.truffle.r.engine.TruffleRLanguage; import com.oracle.truffle.tck.TruffleTCK; @@ -94,8 +95,8 @@ public class FastRTckTest extends TruffleTCK { // @formatter:on @Override - protected PolyglotEngine prepareVM() throws Exception { - PolyglotEngine vm = PolyglotEngine.newBuilder().build(); + protected PolyglotEngine prepareVM(Builder builder) throws Exception { + PolyglotEngine vm = builder.build(); vm.eval(INITIALIZATION); return vm; } diff --git a/mx.fastr/mx_fastr.py b/mx.fastr/mx_fastr.py index 6248e13d9944ff53b1864fb498b0b1ecd53c4e01..71469e608c03849aab86774559fedfb41c118a05 100644 --- a/mx.fastr/mx_fastr.py +++ b/mx.fastr/mx_fastr.py @@ -430,8 +430,7 @@ def _test_subpackage(name): return '.'.join((_test_package(), name)) def _simple_unit_tests(): -# return ','.join(map(_test_subpackage, ['library.base', 'library.stats', 'library.utils', 'library.fastr', 'builtins', 'functions', 'tck', 'parser', 'S4'])) - return ','.join(map(_test_subpackage, ['library.base', 'library.stats', 'library.utils', 'library.fastr', 'builtins', 'functions', 'parser', 'S4'])) + return ','.join(map(_test_subpackage, ['library.base', 'library.stats', 'library.utils', 'library.fastr', 'builtins', 'functions', 'tck', 'parser', 'S4'])) def _package_unit_tests(): return ','.join(map(_test_subpackage, ['rffi', 'rpackages']))