From 410e9aaa403c997f4303515654d9429cf95426b6 Mon Sep 17 00:00:00 2001 From: stepan <stepan.sindelar@oracle.com> Date: Mon, 9 Apr 2018 10:19:11 +0200 Subject: [PATCH] allowAllAccess in unit tests polyglot context --- .../truffle/r/engine/shell/REmbedded.java | 2 +- .../fficall/src/truffle_llvm/Makefile | 17 ----------------- .../llvm_tools/llvm-helper | 6 ------ .../r/test/engine/interop/AbstractMRTest.java | 2 +- .../truffle/r/test/generate/FastRSession.java | 4 ++-- 5 files changed, 4 insertions(+), 27 deletions(-) diff --git a/com.oracle.truffle.r.engine/src/com/oracle/truffle/r/engine/shell/REmbedded.java b/com.oracle.truffle.r.engine/src/com/oracle/truffle/r/engine/shell/REmbedded.java index 1ef67f1de6..87a9afdd9a 100644 --- a/com.oracle.truffle.r.engine/src/com/oracle/truffle/r/engine/shell/REmbedded.java +++ b/com.oracle.truffle.r.engine/src/com/oracle/truffle/r/engine/shell/REmbedded.java @@ -81,7 +81,7 @@ public class REmbedded { boolean useEmbedded = consoleHandler == embeddedConsoleHandler; OutputStream stdOut = useEmbedded ? embeddedConsoleHandler.createStdOutputStream(System.out) : System.out; OutputStream stdErr = useEmbedded ? embeddedConsoleHandler.createErrOutputStream(System.err) : System.err; - context = Context.newBuilder().allowHostAccess(true).arguments("R", options.getArguments()).in(input).out(stdOut).err(stdErr).build(); + context = Context.newBuilder().allowAllAccess(true).arguments("R", options.getArguments()).in(input).out(stdOut).err(stdErr).build(); consoleHandler.setContext(context); context.eval(INIT); diff --git a/com.oracle.truffle.r.native/fficall/src/truffle_llvm/Makefile b/com.oracle.truffle.r.native/fficall/src/truffle_llvm/Makefile index 32cb771f23..41a01d74ab 100644 --- a/com.oracle.truffle.r.native/fficall/src/truffle_llvm/Makefile +++ b/com.oracle.truffle.r.native/fficall/src/truffle_llvm/Makefile @@ -59,35 +59,18 @@ FFLAGS := # uncomment to see exactly where headers are being read from #CFLAGS := $(CFLAGS) -H -#all: Makefile $(C_OBJECTS) $(GNUR_C_OBJECTS) $(GNUR_F_OBJECTS) all: Makefile $(C_OBJECTS) $(C_OBJECTS): | $(OBJ) -#$(GNUR_C_OBJECTS): | $(OBJ) - -#$(GNUR_F_OBJECTS): | $(OBJ) - $(OBJ): mkdir -p $(OBJ) -#$(OBJ)/%.bc: $(GNUR_APPL_SRC)/%.c -# $(CC) $(CFLAGS) $(INCLUDES) $(GNUR_HEADER_DEFS) $(SUPPRESS_WARNINGS) -c $< -o $@ - -#$(OBJ)/%.bc: $(GNUR_MAIN_SRC)/%.c -# $(CC) $(CFLAGS) $(INCLUDES) $(GNUR_HEADER_DEFS) $(SUPPRESS_WARNINGS) -c $< -o $@ - $(OBJ)/%.bc: %.c $(FASTR_NATIVE_DIR)/include/Rinternals.h rffiutils.h $(TRUFFLE_COMMON_H_SOURCES) ../common/rffi_upcallsindex.h $(CC) $(CFLAGS) $(INCLUDES) $(GNUR_HEADER_DEFS) $(SUPPRESS_WARNINGS) -c $< -o $@ -#$(OBJ)/%.bc: ../common/%.c $(FASTR_NATIVE_DIR)/include/Rinternals.h -# $(CC) $(CFLAGS) $(INCLUDES) $(GNUR_HEADER_DEFS) $(SUPPRESS_WARNINGS) -c $< -o $@ - $(OBJ)/%.bc: ../truffle_common/%.c $(CC) $(CFLAGS) $(INCLUDES) $(SUPPRESS_WARNINGS) -c $< -o $@ -#$(OBJ)/%.bc: $(GNUR_APPL_SRC)/%.f -# $(F77) $(FFLAGS) $(FPICFLAGS) -c $< -o $@ - clean: rm -rf $(OBJ) diff --git a/com.oracle.truffle.r.native/llvm_tools/llvm-helper b/com.oracle.truffle.r.native/llvm_tools/llvm-helper index 47c078e978..2215a90378 100644 --- a/com.oracle.truffle.r.native/llvm_tools/llvm-helper +++ b/com.oracle.truffle.r.native/llvm_tools/llvm-helper @@ -147,12 +147,6 @@ function mem2reg_opt() { fi } -#function fake_obj() { -# f=`basename $llvm_ir_file` -# d=`dirname $llvm_ir_file` -# runit touch ${d}/${f%%.*}.o -#} - # Input: all the arguments to the original command line function create_bc_lib() { bcfiles="" diff --git a/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/engine/interop/AbstractMRTest.java b/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/engine/interop/AbstractMRTest.java index 8f884c1764..8f7b396e2d 100644 --- a/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/engine/interop/AbstractMRTest.java +++ b/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/engine/interop/AbstractMRTest.java @@ -52,7 +52,7 @@ public abstract class AbstractMRTest { @BeforeClass public static void before() { - context = Context.newBuilder("R", "llvm").build(); + context = Context.newBuilder("R", "llvm").allowAllAccess(true).build(); context.eval("R", "1"); // initialize context context.enter(); } diff --git a/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/generate/FastRSession.java b/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/generate/FastRSession.java index d6e9c827b8..9e521c524e 100644 --- a/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/generate/FastRSession.java +++ b/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/generate/FastRSession.java @@ -134,7 +134,7 @@ public final class FastRSession implements RSession { ChildContextInfo ctx = ChildContextInfo.create(params, env, contextKind, contextKind == ContextKind.SHARE_NOTHING ? null : mainRContext, input, output, output); RContext.childInfo = ctx; - return Context.newBuilder("R", "llvm").engine(mainEngine).build(); + return Context.newBuilder("R", "llvm").allowAllAccess(true).engine(mainEngine).build(); } private FastRSession() { @@ -154,7 +154,7 @@ public final class FastRSession implements RSession { ChildContextInfo info = ChildContextInfo.create(params, null, ContextKind.SHARE_NOTHING, null, input, output, output); RContext.childInfo = info; mainEngine = Engine.newBuilder().in(input).out(output).err(output).build(); - mainContext = Context.newBuilder("R", "llvm").engine(mainEngine).build(); + mainContext = Context.newBuilder("R", "llvm").allowAllAccess(true).engine(mainEngine).build(); mainRContext = mainContext.eval(GET_CONTEXT).asHostObject(); } finally { try { -- GitLab