From 409719fac1961149452dbf37f9c1ed6f54d820cf Mon Sep 17 00:00:00 2001 From: Lukas Stadler <lukas.stadler@oracle.com> Date: Tue, 18 Jul 2017 11:41:18 +0200 Subject: [PATCH] fix various llvm call issues --- .../truffle/r/ffi/impl/llvm/LLVMFunction.java | 12 +++--- .../r/ffi/impl/llvm/TruffleLLVM_PCRE.java | 2 +- .../fficall/src/common/rffi_upcallsindex.h | 41 ++++++++++--------- .../Rinternals_truffle_common.h | 2 +- 4 files changed, 28 insertions(+), 29 deletions(-) diff --git a/com.oracle.truffle.r.ffi.impl/src/com/oracle/truffle/r/ffi/impl/llvm/LLVMFunction.java b/com.oracle.truffle.r.ffi.impl/src/com/oracle/truffle/r/ffi/impl/llvm/LLVMFunction.java index fcf8853952..77a9164585 100644 --- a/com.oracle.truffle.r.ffi.impl/src/com/oracle/truffle/r/ffi/impl/llvm/LLVMFunction.java +++ b/com.oracle.truffle.r.ffi.impl/src/com/oracle/truffle/r/ffi/impl/llvm/LLVMFunction.java @@ -32,7 +32,6 @@ import com.oracle.truffle.api.nodes.Node; * with a complex result or, in the case of Fortran, to handle call by reference conveniently, or to * just have LLVM handle the underlying native call. The wrapper functions names are all of the form * {@code call_xxx_function}, where {@code xxx} is the subsystem. - * */ public enum LLVMFunction { // base @@ -43,14 +42,14 @@ public enum LLVMFunction { readlink(2, "call_base_"), mkdtemp(1, "call_base_"), chmod(2, "call_base_"), - strtol(2, "call_base_"), - uname(0, "call_base_"), + strtol(3, "call_base_"), + uname(1, "call_base_"), glob(2, "call_base_"), // PCRE maketables(0, "call_pcre_"), - compile(3, "call_pcre_"), - getcapturecount(0, "call_pcre_"), - getcapturenames(2, "call_pcre_"), + compile(4, "call_pcre_"), + getcapturecount(2, "call_pcre_"), + getcapturenames(3, "call_pcre_"), study(2, "call_pcre_"), exec(8, "call_pcre_"), // RAppl @@ -87,5 +86,4 @@ public enum LLVMFunction { CompilerAsserts.neverPartOfCompilation(); return Message.createExecute(argCount).createNode(); } - } diff --git a/com.oracle.truffle.r.ffi.impl/src/com/oracle/truffle/r/ffi/impl/llvm/TruffleLLVM_PCRE.java b/com.oracle.truffle.r.ffi.impl/src/com/oracle/truffle/r/ffi/impl/llvm/TruffleLLVM_PCRE.java index cb36908153..62819af68b 100644 --- a/com.oracle.truffle.r.ffi.impl/src/com/oracle/truffle/r/ffi/impl/llvm/TruffleLLVM_PCRE.java +++ b/com.oracle.truffle.r.ffi.impl/src/com/oracle/truffle/r/ffi/impl/llvm/TruffleLLVM_PCRE.java @@ -99,7 +99,7 @@ public class TruffleLLVM_PCRE implements PCRERFFI { } CaptureNamesResult captureNamesCallback = new CaptureNamesResult(captureCount); int result = (int) ForeignAccess.sendExecute(message, symbolHandle.asTruffleObject(), - code, extra, captureNamesCallback); + captureNamesCallback, code, extra); if (result < 0) { CompilerDirectives.transferToInterpreter(); throw RError.error(RError.NO_CALLER, RError.Message.WRONG_PCRE_INFO, result); diff --git a/com.oracle.truffle.r.native/fficall/src/common/rffi_upcallsindex.h b/com.oracle.truffle.r.native/fficall/src/common/rffi_upcallsindex.h index daea8d65ad..5c4785b6e6 100644 --- a/com.oracle.truffle.r.native/fficall/src/common/rffi_upcallsindex.h +++ b/com.oracle.truffle.r.native/fficall/src/common/rffi_upcallsindex.h @@ -118,26 +118,27 @@ #define SETCADR_x 113 #define SETCAR_x 114 #define SETCDR_x 115 -#define SET_RDEBUG_x 116 -#define SET_RSTEP_x 117 -#define SET_S4_OBJECT_x 118 -#define SET_STRING_ELT_x 119 -#define SET_SYMVALUE_x 120 -#define SET_TAG_x 121 -#define SET_TYPEOF_FASTR_x 122 -#define SET_VECTOR_ELT_x 123 -#define STRING_ELT_x 124 -#define SYMVALUE_x 125 -#define TAG_x 126 -#define TYPEOF_x 127 -#define UNSET_S4_OBJECT_x 128 -#define VECTOR_ELT_x 129 -#define getConnectionClassString_x 130 -#define getOpenModeString_x 131 -#define getSummaryDescription_x 132 -#define isSeekable_x 133 -#define unif_rand_x 134 +#define SET_NAMED_FASTR_x 116 +#define SET_RDEBUG_x 117 +#define SET_RSTEP_x 118 +#define SET_S4_OBJECT_x 119 +#define SET_STRING_ELT_x 120 +#define SET_SYMVALUE_x 121 +#define SET_TAG_x 122 +#define SET_TYPEOF_FASTR_x 123 +#define SET_VECTOR_ELT_x 124 +#define STRING_ELT_x 125 +#define SYMVALUE_x 126 +#define TAG_x 127 +#define TYPEOF_x 128 +#define UNSET_S4_OBJECT_x 129 +#define VECTOR_ELT_x 130 +#define getConnectionClassString_x 131 +#define getOpenModeString_x 132 +#define getSummaryDescription_x 133 +#define isSeekable_x 134 +#define unif_rand_x 135 -#define UPCALLS_TABLE_SIZE 135 +#define UPCALLS_TABLE_SIZE 136 #endif // RFFI_UPCALLSINDEX_H diff --git a/com.oracle.truffle.r.native/fficall/src/truffle_common/Rinternals_truffle_common.h b/com.oracle.truffle.r.native/fficall/src/truffle_common/Rinternals_truffle_common.h index 6f13622b65..81f9961f6c 100644 --- a/com.oracle.truffle.r.native/fficall/src/truffle_common/Rinternals_truffle_common.h +++ b/com.oracle.truffle.r.native/fficall/src/truffle_common/Rinternals_truffle_common.h @@ -1080,7 +1080,7 @@ int R_check_class_etc (SEXP x, const char **valid) { return R_check_class_etc_helper(x, valid, nfiGetMethodsNamespace); } -SEXP R_PreserveObject(SEXP x) { +SEXP R_PreserveObject_FASTR(SEXP x) { return newObjectHandle(x); } -- GitLab