Skip to content

Commit 8f555c1

Browse files
committed
Merge commit '9c790b6edb27bd0b41181ba30532308542d6ebd6' into release/graal-vm/1.0
2 parents 88c63c7 + 9c790b6 commit 8f555c1

File tree

190 files changed

+10419
-1869
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

190 files changed

+10419
-1869
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
CHANGELOG.md merge=union

CHANGELOG.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,29 @@
1+
# 1.0 RC 14
2+
3+
* all FastR specific options (NOT those GNU-R compatible like `--save`) are experimental except for `--R.PrintErrorStacktracesToFile`,
4+
which is an option that enables logging of FastR internal errors for bug reporting purposes. Experimental options can be unlocked
5+
using `--experimental-options` or with `ContextBuilder#allowExperimentalOptions`.
6+
* the MRAN mirror used by FastR by default instead of CRAN was bumped to 2019-02-13
7+
* options for the JVM or native image are now passed using `--vm.` prefix in both cases instead of `--jvm.` or `--native.`
8+
(e.g., `--jvm.Dproperty=false` becomes `--vm.Dproperty=false`)
9+
10+
New features:
11+
12+
* whenever possible, errors are propagated to the FastR embedder
13+
14+
Added missing R builtins and C API
15+
16+
* `Rf_StringBlank`
17+
18+
Bug fixes:
19+
20+
* `C_numeric_deriv` gives wrong results of gradient #54
21+
* `tcrossprod` with a single vector #56
22+
* `length<-` would remove attributes from the target even if it was a shared value
23+
* `length(x) <- N` should not strip attributes if `length(x) == N`, which is not in line with GNU-R documentation,
24+
but relied upon in the `methods` package #55
25+
* `as.Date` with invalid date string #56
26+
127
# 1.0 RC 13
228

329
New features:

ci.hocon

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ include "ci_common/common.hocon"
88
# The standard set of gate builds. N.B. the style/builtin checks are only run on Linux as they are not OS-dependent.
99

1010
# in case you do not want to enforce a specific overlay commit, comment:
11-
overlay = "f2f27ae819a1f8ce3398aaf43c79aec358acd0a2"
11+
overlay = "9fd1ed7dac318a520ffe30b28bde900553950658"
1212
builds = [
1313
${gateTestLinux} {capabilities : [linux, amd64, fast], targets : [gate], name: "gate-test-linux-amd64"}
1414
${gateTestNoDSLCacheLinux} {capabilities : [linux, amd64, fast], targets : [gate], name: "gate-test-linux-amd64-no-dsl-cache"}

ci_common/common.hocon

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -27,20 +27,29 @@ java9Downloads : {
2727
logfiles : [
2828
"fastr_errors*.log"
2929
"results.json"
30-
"libdownloads/R-*/gnur_configure.log"
31-
"libdownloads/R-*/config.log"
32-
"libdownloads/R-*/gnur_make.log"
33-
"libdownloads/R-*/Makeconf"
34-
"com.oracle.truffle.r.native/gnur/tests/log/all.diff"
35-
"com.oracle.truffle.r.test.native/embedded/*.output"
36-
"com.oracle.truffle.r.test.native/embedded/src/*.output"
30+
"**/R-*/gnur_configure.log"
31+
"**/R-*/config.log"
32+
"**/R-*/gnur_make.log"
33+
"**/gnur_configure.log"
34+
"**/config.log"
35+
"**/gnur_make.log"
36+
"**/Makeconf"
37+
"fastr/libdownloads/R-*/gnur_configure.log"
38+
"fastr/libdownloads/R-*/config.log"
39+
"fastr/libdownloads/R-*/gnur_make.log"
40+
"../fastr/libdownloads/R-*/gnur_configure.log"
41+
"../fastr/libdownloads/R-*/config.log"
42+
"../fastr/libdownloads/R-*/gnur_make.log"
43+
"**/com.oracle.truffle.r.native/gnur/tests/log/all.diff"
44+
"**/com.oracle.truffle.r.test.native/embedded/*.output"
45+
"**/com.oracle.truffle.r.test.native/embedded/src/*.output"
3746
# Uncomment to debug pkgtest issues, produces lot of logs!
38-
"test.fastr/**/*.Rout"
39-
"test.fastr/**/*.fail"
40-
"test.fastr/**/*-tests/*.Rout"
41-
"test.gnur/**/*.Rout"
42-
"test.gnur/**/*-tests/*.Rout"
43-
"test.gnur/**/*.fail"
47+
"**/test.fastr/**/*.Rout"
48+
"**/test.fastr/**/*.fail"
49+
"**/test.fastr/**/*-tests/*.Rout"
50+
"**/test.gnur/**/*.Rout"
51+
"**/test.gnur/**/*-tests/*.Rout"
52+
"**/test.gnur/**/*.fail"
4453
# Uncomment to debug the event loop hanging issue. It must be accompanied by enabling
4554
# the logging by setting the TRACE_EVENT_LOOP env var to true.
4655
# "traceEventLoop.log"
@@ -104,6 +113,7 @@ common : ${java8Downloads} {
104113
PKG_TEST_ENV_miniUI : "LC_ALL=C"
105114
PKG_TEST_ENV_compare : "LC_ALL=C"
106115
FASTR_OPTION_PrintErrorStacktracesToFile: "true"
116+
GRAALVM_CHECK_EXPERIMENTAL_OPTIONS : "true"
107117
}
108118
}
109119

com.oracle.truffle.r.engine/src/com/oracle/truffle/r/engine/REngine.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -274,13 +274,13 @@ public Object parseAndEval(Source source, MaterializedFrame frame, boolean print
274274
}
275275

276276
private List<RSyntaxNode> parseSource(Source source) throws ParseException {
277-
RParserFactory.Parser<RSyntaxNode> parser = RParserFactory.getParser();
277+
RParserFactory.Parser parser = RParserFactory.getParser();
278278
return parser.script(source, new RASTBuilder(true), context.getLanguage());
279279
}
280280

281281
@Override
282282
public ParsedExpression parse(Source source, boolean keepSource) throws ParseException {
283-
RParserFactory.Parser<RSyntaxNode> parser = RParserFactory.getParser();
283+
RParserFactory.Parser parser = RParserFactory.getParser();
284284
RASTBuilder builder = new RASTBuilder(true);
285285
List<RSyntaxNode> script = parser.script(source, builder, context.getLanguage());
286286
Object[] data = new Object[script.size()];
@@ -388,7 +388,7 @@ private EngineRootNode createRScriptRoot(Source fullSource, MaterializedFrame fr
388388
lineIndex++;
389389
List<RSyntaxNode> currentStmts = null;
390390
try {
391-
RParserFactory.Parser<RSyntaxNode> parser = RParserFactory.getParser();
391+
RParserFactory.Parser parser = RParserFactory.getParser();
392392
currentStmts = parser.statements(src, fullSource, startLine, new RASTBuilder(true), context.getLanguage());
393393
} catch (IncompleteSourceException e) {
394394
lastParseException = e;

com.oracle.truffle.r.engine/src/com/oracle/truffle/r/engine/RRuntimeASTAccessImpl.java

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -140,11 +140,8 @@ public Engine createEngine(RContext context) {
140140

141141
@Override
142142
public RPairList getSyntaxCaller(RCaller rl) {
143-
RCaller call = rl;
144-
while (call.isPromise()) {
145-
call = call.getParent();
146-
}
147-
if (call.isValidCaller()) {
143+
RCaller call = RCaller.unwrapPromiseCaller(rl);
144+
if (call != null && call.isValidCaller()) {
148145
RSyntaxElement syntaxNode = call.getSyntaxNode();
149146
return RDataFactory.createLanguage(getOrCreateLanguageClosure(((RSyntaxNode) syntaxNode).asRNode()));
150147
} else {
@@ -239,19 +236,9 @@ public Object findCaller(RBaseNode call) {
239236

240237
private Object findCallerFromFrame(Frame frame) {
241238
if (frame != null && RArguments.isRFrame(frame)) {
242-
RCaller caller = RArguments.getCall(frame);
243-
while (caller.isPromise()) {
244-
if (!caller.hasSysParent()) {
245-
// frame created to evaluate promise via CallTarget (i.e. the PIC cache was
246-
// filled and the promise could not be evaluated while in the context of the
247-
// frame that cased its evaluation)
248-
caller = caller.getPromiseCaller();
249-
} else {
250-
// NOTE: maybe we should just use the caller as is otherwise...
251-
caller = caller.getParent();
252-
}
253-
}
254-
if (caller.isValidCaller()) {
239+
// This finds the next non-artificial frame on the R call stack
240+
RCaller caller = RCaller.unwrapPrevious(RArguments.getCall(frame));
241+
if (RCaller.isValidCaller(caller)) {
255242
// This is where we need to ensure that we have an RLanguage object with a rep that
256243
// is an RSyntaxNode.
257244
return getSyntaxCaller(caller);

com.oracle.truffle.r.engine/src/com/oracle/truffle/r/engine/interop/RForeignAccessFactoryImpl.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424

2525
import com.oracle.truffle.api.CompilerAsserts;
2626
import com.oracle.truffle.api.interop.ForeignAccess;
27-
import com.oracle.truffle.api.interop.MessageResolution;
2827
import com.oracle.truffle.r.ffi.impl.interop.FFI_RForeignAccessFactoryImpl;
2928
import com.oracle.truffle.r.runtime.RInternalError;
3029
import com.oracle.truffle.r.runtime.conn.RConnection;
@@ -57,8 +56,8 @@
5756
import com.oracle.truffle.r.runtime.env.frame.ActiveBinding;
5857

5958
/**
60-
* For most types we use the {@link MessageResolution} facility to automatically generate the
61-
* factory for creating the {@link ForeignAccess} instance. The exceptions are the (many) subclasses
59+
* For most types we use the {@code MessageResolution} facility to automatically generate the
60+
* factory for creating the {@code ForeignAccess} instance. The exceptions are the (many) subclasses
6261
* of {@link RAbstractVector} as these have the same handling but the generator cannot handle
6362
* abstract classes.
6463
*

com.oracle.truffle.r.engine/src/com/oracle/truffle/r/engine/shell/REmbedded.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ private static void runRmainloop() {
135135
RContext ctx = RContext.getInstance();
136136
ctx.completeEmbeddedInitialization();
137137
ctx.getRFFI().initializeEmbedded(ctx);
138-
int status = REPL.readEvalPrint(context, consoleHandler, false, System.err);
138+
int status = REPL.readEvalPrint(context, consoleHandler, false);
139139
context.leave();
140140
context.close();
141141
Utils.systemExit(status);

com.oracle.truffle.r.ffi.impl/src/com/oracle/truffle/r/ffi/impl/common/JavaUpCallsRFFIImpl.java

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,8 @@ private static Object findVarInFrameHelper(Object envArg, Object symbolArg, bool
283283
RSymbol name = (RSymbol) symbolArg;
284284
REnvironment env = (REnvironment) envArg;
285285
while (env != REnvironment.emptyEnv()) {
286-
Object value = env.get(name.getName());
286+
String nameKey = name.getName();
287+
Object value = env.get(nameKey);
287288
if (value != null) {
288289
if (value instanceof RPromise && ((RPromise) value).isOptimized()) {
289290
// From the point of view of RFFI, optimized promises (i.e. promises with null
@@ -297,6 +298,14 @@ private static Object findVarInFrameHelper(Object envArg, Object symbolArg, bool
297298
if (value == RMissing.instance || value == REmpty.instance) {
298299
return RSymbol.MISSING;
299300
}
301+
Object v = RRuntime.asAbstractVector(value);
302+
if (v instanceof RAbstractVector) {
303+
v = ((RAbstractVector) v).materialize();
304+
}
305+
if (v != value) {
306+
env.putOverrideLock(nameKey, v);
307+
value = v;
308+
}
300309
return value;
301310
}
302311
if (!inherits) {
@@ -1238,7 +1247,7 @@ public Object R_getGlobalFunctionContext() {
12381247
if (!currentCaller.isPromise() && currentCaller.isValidCaller() && currentCaller != RContext.getInstance().stateInstrumentation.getBrowserState().getInBrowserCaller()) {
12391248
break;
12401249
}
1241-
currentCaller = currentCaller.getParent();
1250+
currentCaller = currentCaller.getPrevious();
12421251
}
12431252
return currentCaller == null || currentCaller == RCaller.topLevel ? RNull.instance : currentCaller;
12441253
}
@@ -1249,7 +1258,7 @@ public Object R_getParentFunctionContext(Object c) {
12491258
Utils.warn("Potential memory leak (parent function context object)");
12501259
RCaller currentCaller = guaranteeInstanceOf(c, RCaller.class);
12511260
while (true) {
1252-
currentCaller = currentCaller.getParent();
1261+
currentCaller = currentCaller.getPrevious();
12531262
if (currentCaller == null ||
12541263
(!currentCaller.isPromise() && currentCaller.isValidCaller() && currentCaller != RContext.getInstance().stateInstrumentation.getBrowserState().getInBrowserCaller())) {
12551264
break;
@@ -1333,7 +1342,7 @@ public Object R_getContextSrcRef(Object c) {
13331342
SourceSection ss = f.getRootNode().getSourceSection();
13341343
String path = RSource.getPath(ss.getSource());
13351344
// TODO: is it OK to pass "" if path is null?
1336-
return RSrcref.createLloc(ss, path == null ? "" : path);
1345+
return RSrcref.createLloc(RContext.getInstance(), ss, path == null ? "" : path);
13371346
}
13381347
}
13391348

com.oracle.truffle.r.ffi.impl/src/com/oracle/truffle/r/ffi/impl/interop/package-info.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -21,7 +21,7 @@
2121
* questions.
2222
*/
2323
/**
24-
* A collection of types and {@link com.oracle.truffle.api.interop.MessageResolution} classes that
24+
* A collection of types and {@code com.oracle.truffle.api.interop.MessageResolution} classes that
2525
* support the implementations.
2626
*/
2727
package com.oracle.truffle.r.ffi.impl.interop;

0 commit comments

Comments
 (0)