Skip to content

Commit c2b12f2

Browse files
committed
[GR-9891] Upgrade MRAN mirror for the release.
PullRequest: fastr/1534
2 parents 5874d3f + ec5c4b6 commit c2b12f2

File tree

4 files changed

+40
-17
lines changed

4 files changed

+40
-17
lines changed

ci_common/common.hocon

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# java 7 is needed by Truffle (for now)
22
java7 : {name : oraclejdk, version : "7", platformspecific: true}
33
# java 8 must be a jvmci enabled variant
4-
java8 : {name : labsjdk, version : "8u161-jvmci-0.41", platformspecific: true}
5-
java9 : {name : labsjdk, version : "9-ea+168", platformspecific: true}
4+
java8 : {name : labsjdk, version : "8u171-jvmci-0.43", platformspecific: true}
5+
java9 : {name : oraclejdk, version : "9.0.4+11", platformspecific: true}
66

77
java8Downloads : {
88
downloads : {
@@ -137,6 +137,9 @@ requireGCC: {
137137
}
138138

139139
gateTestJava9Linux : ${java9Downloads} ${gateTestCommon} {
140+
setup: [
141+
[export, "FASTR_TEST_trace_tests=true"]
142+
]
140143
downloads : {
141144
JAVA_HOME : ${java9Downloads.downloads.JAVA_HOME}
142145
EXTRA_JAVA_HOMES : ${java9Downloads.downloads.EXTRA_JAVA_HOMES}

com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/methods/MethodsListDispatch.java

Lines changed: 30 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import static com.oracle.truffle.r.nodes.builtin.CastBuilder.Predef.instanceOf;
2323
import static com.oracle.truffle.r.nodes.builtin.CastBuilder.Predef.lengthGt;
2424
import static com.oracle.truffle.r.nodes.builtin.CastBuilder.Predef.lengthGte;
25+
import static com.oracle.truffle.r.nodes.builtin.CastBuilder.Predef.returnIf;
2526
import static com.oracle.truffle.r.nodes.builtin.CastBuilder.Predef.singleElement;
2627
import static com.oracle.truffle.r.nodes.builtin.CastBuilder.Predef.stringValue;
2728
import static com.oracle.truffle.r.nodes.builtin.CastBuilder.Predef.toBoolean;
@@ -42,6 +43,7 @@
4243
import com.oracle.truffle.r.nodes.attributes.GetFixedAttributeNode;
4344
import com.oracle.truffle.r.nodes.builtin.NodeWithArgumentCasts.Casts;
4445
import com.oracle.truffle.r.nodes.builtin.RExternalBuiltinNode;
46+
import com.oracle.truffle.r.nodes.builtin.casts.fluent.PreinitialPhaseBuilder;
4547
import com.oracle.truffle.r.nodes.function.ClassHierarchyScalarNode;
4648
import com.oracle.truffle.r.nodes.function.ClassHierarchyScalarNodeGen;
4749
import com.oracle.truffle.r.nodes.function.PromiseHelperNode;
@@ -67,6 +69,7 @@
6769
import com.oracle.truffle.r.runtime.data.RNull;
6870
import com.oracle.truffle.r.runtime.data.RPromise;
6971
import com.oracle.truffle.r.runtime.data.RS4Object;
72+
import com.oracle.truffle.r.runtime.data.RSymbol;
7073
import com.oracle.truffle.r.runtime.data.RTypedValue;
7174
import com.oracle.truffle.r.runtime.data.model.RAbstractStringVector;
7275
import com.oracle.truffle.r.runtime.env.REnvironment;
@@ -82,18 +85,30 @@
8285
public class MethodsListDispatch {
8386

8487
private static void checkSingleString(Casts casts, int argNum, String argName, String msg, boolean nonEmpty, Function<Object, String> clsHierFn,
85-
Function<Object, Integer> vecLenFn) {
88+
Function<Object, Integer> vecLenFn, boolean allowSymbol) {
89+
90+
PreinitialPhaseBuilder builder = casts.arg(argNum, argName).defaultError(Message.SINGLE_STRING_WRONG_TYPE, msg, clsHierFn);
91+
if (allowSymbol) {
92+
builder.returnIf(instanceOf(RSymbol.class));
93+
}
94+
checkSingleString(builder, msg, nonEmpty, vecLenFn);
95+
}
96+
97+
private static void checkSingleString(PreinitialPhaseBuilder builder, String msg, boolean nonEmpty, Function<Object, Integer> vecLenFn) {
8698
//@formatter:off
87-
casts.arg(argNum, argName).
88-
defaultError(RError.Message.SINGLE_STRING_WRONG_TYPE, msg, clsHierFn).
89-
mustBe(stringValue()).
90-
asStringVector().
91-
mustBe(singleElement(), RError.Message.SINGLE_STRING_TOO_LONG, msg, vecLenFn).
92-
findFirst().
93-
mustBe(nonEmpty ? lengthGt(0) : lengthGte(0), RError.Message.NON_EMPTY_STRING, msg);
99+
builder.mustBe(stringValue()).
100+
asStringVector().
101+
mustBe(singleElement(), RError.Message.SINGLE_STRING_TOO_LONG, msg, vecLenFn).
102+
findFirst().
103+
mustBe(nonEmpty ? lengthGt(0) : lengthGte(0), RError.Message.NON_EMPTY_STRING, msg);
94104
//@formatter:on
95105
}
96106

107+
private static void checkSingleString(Casts casts, int argNum, String argName, String msg, boolean nonEmpty, Function<Object, String> clsHierFn,
108+
Function<Object, Integer> vecLenFn) {
109+
checkSingleString(casts, argNum, argName, msg, nonEmpty, clsHierFn, vecLenFn, false);
110+
}
111+
97112
public abstract static class R_initMethodDispatch extends RExternalBuiltinNode.Arg1 {
98113

99114
static {
@@ -353,7 +368,7 @@ public abstract static class R_getGeneric extends RExternalBuiltinNode.Arg4 {
353368
Function<Object, String> clsHierFn = ClassHierarchyScalarNode::get;
354369
Function<Object, Integer> vecLenFn = arg -> ((RAbstractStringVector) arg).getLength();
355370

356-
checkSingleString(casts, 0, "f", "The argument \"f\" to getGeneric", true, clsHierFn, vecLenFn);
371+
checkSingleString(casts, 0, "f", "The argument \"f\" to getGeneric", true, clsHierFn, vecLenFn, true);
357372

358373
casts.arg(1, "mustFind").asLogicalVector().findFirst(RRuntime.LOGICAL_FALSE).map(toBoolean());
359374

@@ -362,6 +377,11 @@ public abstract static class R_getGeneric extends RExternalBuiltinNode.Arg4 {
362377
checkSingleString(casts, 3, "package", "The argument \"package\" to getGeneric", false, clsHierFn, vecLenFn);
363378
}
364379

380+
@Specialization
381+
protected Object getGeneric(RSymbol name, boolean mustFind, REnvironment env, String pckg) {
382+
return getGeneric(name.getName(), mustFind, env, pckg);
383+
}
384+
365385
@Specialization
366386
protected Object getGeneric(String name, boolean mustFind, REnvironment env, String pckg) {
367387
Object value = getGenericInternal.executeObject(name, env, pckg);
@@ -399,7 +419,7 @@ protected Object getGeneric(String name, REnvironment env, String pckg) {
399419
}
400420
FrameDescriptor currentFrameDesc = currentFrame.getFrameDescriptor();
401421
Object o = slotRead(currentFrame, currentFrameDesc, name);
402-
if (o != null) {
422+
if (o instanceof RAttributable) {
403423
RAttributable vl = (RAttributable) o;
404424
boolean ok = false;
405425
if (vl instanceof RFunction && getGenericAttrNode.execute(vl) != null) {
@@ -420,10 +440,6 @@ protected Object getGeneric(String name, REnvironment env, String pckg) {
420440
}
421441
rho = rho.getParent();
422442
}
423-
424-
// TODO: in GNU R there is additional code here that deals with the case of "name"
425-
// being a symbol but at this point this case is not handled (even possible?) in
426-
// FastR
427443
return generic == null ? RNull.instance : generic;
428444
}
429445

com.oracle.truffle.r.native/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export FASTR_R_HOME=$(abspath $(TOPDIR)/..)
2828
export FASTR_LIB_DIR=$(FASTR_R_HOME)/lib
2929
export FASTR_NATIVE_DIR = $(TOPDIR)
3030
export R_VERSION = 3.4.0
31-
export DEFAULT_CRAN_MIRROR = "https://mran.microsoft.com/snapshot/2018-03-20"
31+
export DEFAULT_CRAN_MIRROR = "https://mran.microsoft.com/snapshot/2018-05-23"
3232
export GNUR_HOME = $(TOPDIR)/gnur/patch-build
3333

3434
ifeq ($(FASTR_RFFI),llvm)

com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/TestBase.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ public static class RunListener extends org.junit.runner.notification.RunListene
181181
private static File diffsOutputFile;
182182

183183
private static final String PROP_BASE = "fastr.test.";
184+
private static final String ENV_PROP_BASE = "FASTR_TEST_";
184185

185186
private enum Props {
186187
GEN_EXPECTED("gen.expected"),
@@ -199,6 +200,9 @@ private enum Props {
199200
private static String getProperty(String baseName) {
200201
String propName = PROP_BASE + baseName;
201202
String val = System.getProperty(propName);
203+
if (val == null || val.trim().isEmpty()) {
204+
val = System.getenv(ENV_PROP_BASE + baseName.replace('.', '_'));
205+
}
202206
return val;
203207
}
204208

0 commit comments

Comments
 (0)