Skip to content

Commit 2ee1272

Browse files
committed
Merge commit '6950af0ba3fcd246f6ac8a3ca97e1c3b51cab010' into release/graal-vm/1.0
2 parents 1e21572 + 6950af0 commit 2ee1272

File tree

25 files changed

+260
-98
lines changed

25 files changed

+260
-98
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# 1.0 RC 16
2+
3+
Bug fixes:
4+
5+
* `match` worked incorrectly with descending sequences (e.g., `3:1`)
6+
17
# 1.0 RC 15
28

39
* `ActiveBinding` objects do not support the `UNBOX` message anymore

com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/fastrGrid/device/awt/Graphics2DDevice.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2017, 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
@@ -44,6 +44,7 @@
4444
import com.oracle.truffle.r.library.fastrGrid.device.DrawingContext.GridLineJoin;
4545
import com.oracle.truffle.r.library.fastrGrid.device.GridColor;
4646
import com.oracle.truffle.r.library.fastrGrid.device.GridDevice;
47+
import com.oracle.truffle.r.runtime.FastRConfig;
4748
import com.oracle.truffle.r.runtime.RInternalError;
4849

4950
/**
@@ -59,7 +60,7 @@ public class Graphics2DDevice implements GridDevice {
5960
// may wish to apply his/her own transformations to the graphics object and we should not
6061
// interfere with these. In cases we do use transformation, we make sure to set back the
6162
// original one after we're done.
62-
static final double AWT_POINTS_IN_INCH = GraphicsEnvironment.isHeadless() ? 72. : Toolkit.getDefaultToolkit().getScreenResolution();
63+
static final double AWT_POINTS_IN_INCH = FastRConfig.UseRemoteGridAwtDevice || GraphicsEnvironment.isHeadless() ? 72. : Toolkit.getDefaultToolkit().getScreenResolution();
6364

6465
private static final BasicStroke blankStroke = new BasicStroke(0f);
6566

com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/fastrGrid/grDevices/InitWindowedDevice.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,9 @@ protected Object call(RArgsValuesAndNames args) {
7575
// check if we got custom Graphics2D object as 3rd parameter
7676
boolean isFastRDevice = args.getArgument(0).equals(".FASTR.AWT");
7777
if (isFastRDevice && args.getLength() > 3) {
78+
if (FastRConfig.UseRemoteGridAwtDevice) {
79+
throw error(Message.GENERIC, "Using custom Graphics2D object is not supported on the remote grid device.");
80+
}
7881
Object arg3 = args.getArgument(3);
7982
boolean isForeignTruffleObj = RRuntime.isForeignObject(arg3);
8083
TruffleLanguage.Env env = RContext.getInstance().getEnv();

com.oracle.truffle.r.native/run/install_r_native_image

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ if [[ $uninstall -eq 1 ]]; then
6363
fi
6464

6565
if [[ $silent -eq 0 ]]; then
66-
echo "This script is going to build a native image of the R runtime and update the R launchers to use that image as the default, i.e., when '--jvm' option is not used."
66+
echo "This script is going to build a native image of the R runtime and update the R launchers to use that image as the default, i.e., when '--jvm' option is not used. You can uninstall the native image by running this script with the 'uninstall' argument. Run this script with '--help' for more details."
6767
echo "The build takes several minutes and needs a minimum of 6GB of RAM and 150MB of free disk space. The computer may lag during the build."
6868
read -p "Are you sure you want to build and install the native image of the R runtime? (Yy/Nn) " -n 1 -r
6969
echo
@@ -78,6 +78,6 @@ cd "$fastr_home/bin"
7878
cp "exec/R" "exec_R.backup"
7979
cp "Rscript" "Rscript.backup"
8080
sed -e '/^## REMOVE FOR NATIVE IMAGE: BEGIN/,/^## REMOVE FOR NATIVE IMAGE: END/d;' "exec_R.backup" | \
81-
sed -e 's|^exec "$JAVA_HOME/bin/java" .*|exec "$R_HOME/bin/RMain" R "${FASTR_INTERNAL_ARGS[@]}" "$@"|' > "exec/R"
81+
sed -e 's|^exec "$JAVA_HOME/bin/java" .*|exec "$R_HOME/bin/RMain" R ${FASTR_INTERNAL_ARGS[@]} "$@"|' > "exec/R"
8282
sed -e '/^## REMOVE FOR NATIVE IMAGE: BEGIN/,/^## REMOVE FOR NATIVE IMAGE: END/d;' "Rscript.backup" | \
83-
sed -e 's|^exec "$JAVA_HOME/bin/java" .*|exec "$R_HOME/bin/RMain" Rscript "${FASTR_INTERNAL_ARGS[@]}" "$@"|' > "Rscript"
83+
sed -e 's|^exec "$JAVA_HOME/bin/java" .*|exec "$R_HOME/bin/RMain" Rscript ${FASTR_INTERNAL_ARGS[@]} "$@"|' > "Rscript"

com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Getwd.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2014, 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
@@ -30,6 +30,7 @@
3030
import com.oracle.truffle.r.nodes.builtin.RBuiltinNode;
3131
import com.oracle.truffle.r.runtime.builtins.RBuiltin;
3232
import com.oracle.truffle.r.runtime.data.RDataFactory;
33+
import com.oracle.truffle.r.runtime.data.RNull;
3334
import com.oracle.truffle.r.runtime.ffi.BaseRFFI;
3435
import com.oracle.truffle.r.runtime.ffi.RFFIFactory;
3536

@@ -42,6 +43,9 @@ public abstract class Getwd extends RBuiltinNode.Arg0 {
4243
@TruffleBoundary
4344
protected Object getwd() {
4445
String result = getwdNode.execute();
45-
return RDataFactory.createStringVector(result);
46+
if (result != null) {
47+
return RDataFactory.createStringVector(result);
48+
}
49+
return RNull.instance;
4650
}
4751
}

com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Setwd.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2014, 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
@@ -35,6 +35,7 @@
3535
import com.oracle.truffle.r.runtime.RError;
3636
import com.oracle.truffle.r.runtime.Utils;
3737
import com.oracle.truffle.r.runtime.builtins.RBuiltin;
38+
import com.oracle.truffle.r.runtime.data.RNull;
3839
import com.oracle.truffle.r.runtime.ffi.BaseRFFI;
3940
import com.oracle.truffle.r.runtime.ffi.RFFIFactory;
4041

@@ -60,7 +61,7 @@ protected Object setwd(String path) {
6061
} else {
6162
String nwdAbs = getwdNode.execute();
6263
Utils.updateCurwd(nwdAbs);
63-
return owd;
64+
return owd != null ? owd : RNull.instance;
6465
}
6566
}
6667
}

com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/fastpaths/IsElementFastPath.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2015, 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
@@ -85,7 +85,7 @@ protected Byte iselementOne(RAbstractDoubleVector el, RAbstractDoubleVector set,
8585
return RRuntime.LOGICAL_FALSE;
8686
}
8787

88-
@Specialization(guards = "el.getLength() == 1")
88+
@Specialization(guards = {"el.getLength() == 1", "set.getStride() >= 0"})
8989
protected Byte isElementOneSequence(RAbstractDoubleVector el, RIntSequence set,
9090
@Cached("createBinaryProfile()") ConditionProfile profile) {
9191
double element = el.getDataAt(0);

com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/attributes/SpecialAttributesFunctions.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1401,6 +1401,7 @@ protected Object getVectorTsp(RAbstractContainer x,
14011401
public abstract static class SetCommentAttributeNode extends SetSpecialAttributeNode {
14021402

14031403
private final ConditionProfile nullCommentProfile = ConditionProfile.createBinaryProfile();
1404+
private final NACheck naCheck = NACheck.create();
14041405

14051406
@Child private CastToVectorNode castVector;
14061407

@@ -1427,7 +1428,6 @@ public void setComment(RAttributable x, Object value) {
14271428
comment = castVector.doCast(value);
14281429
} else if (value instanceof RAbstractStringVector) {
14291430
RAbstractStringVector str = (RAbstractStringVector) value;
1430-
NACheck naCheck = NACheck.create();
14311431
naCheck.enable(str);
14321432
for (int j = str.getLength() - 1; j >= 0; j--) {
14331433
if (!naCheck.check(str.getDataAt(j))) {

com.oracle.truffle.r.parser/src/com/oracle/truffle/r/parser/ParserGeneration.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,5 +105,6 @@ public class ParserGeneration {
105105
"allow 'function(...=NULL)', which has no effect, but also causes not error in GNU-R",
106106
"report tokens and other metadata to the code builder",
107107
"convert to ANTLR4",
108+
"use character classes instead of character sets in lexer"
108109
};
109110
}

com.oracle.truffle.r.parser/src/com/oracle/truffle/r/parser/R.g

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -954,7 +954,7 @@ fragment OP_NAME
954954
| ('*'|'/'|'+'|'-'|'>'|'<'|'='|'|'|'&'|':'|'^'|'.'|'~'|','|'?')
955955
;
956956

957-
fragment ID_NAME : ('a'..'z'|'A'..'Z'|'α'..'ω'|'Α'..'Ω'|'_') ('a'..'z'|'A'..'Z'|'0'..'9'|'α'..'ω'|'Α'..'Ω'|'_'|'.')* ;
957+
fragment ID_NAME : [\p{Alpha}_] [\p{Alnum}_.]* ;
958958

959959
fragment ESC_SEQ
960960
: '\\' ('b'|'t'|'n'|'f'|'r'|'"'|'\''|'`'|'\\'|' '|'a'|'v')

com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/data/RDoubleSequence.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2013, 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
@@ -69,7 +69,8 @@ public Object getStrideObject() {
6969
return getStride();
7070
}
7171

72-
public double getEnd() {
72+
// NOTE: it does not hold that getStart() <= getEnd()!
73+
private double getEnd() {
7374
return start + (getLength() - 1) * stride;
7475
}
7576

com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/data/RIntSequence.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2013, 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
@@ -88,7 +88,9 @@ public int getStride() {
8888
}
8989

9090
public int getIndexFor(int element) {
91-
if (element < getStart() || element > getEnd()) {
91+
int first = Math.min(getStart(), getEnd());
92+
int last = Math.max(getStart(), getEnd());
93+
if (element < first || element > last) {
9294
return -1;
9395
}
9496
if ((element - getStart()) % getStride() == 0) {
@@ -117,6 +119,7 @@ public String toString() {
117119
return "[" + start + " - " + getEnd() + "]";
118120
}
119121

122+
// NOTE: it does not hold that getStart() <= getEnd()!
120123
public int getEnd() {
121124
return start + (getLength() - 1) * stride;
122125
}

com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/data/RStringSequence.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2017, 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
@@ -127,7 +127,9 @@ public int getIndexFor(String element) {
127127
String c = element.substring(prefix.length(), element.length() - suffix.length());
128128
try {
129129
int current = Integer.parseInt(c);
130-
if (current < getStart() || current > getEnd()) {
130+
int first = Math.min(getStart(), getEnd());
131+
int last = Math.max(getStart(), getEnd());
132+
if (current < first || current > last) {
131133
return -1;
132134
}
133135
if ((current - getStart()) % getStride() == 0) {

com.oracle.truffle.r.test.native/Makefile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2014, 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
@@ -33,7 +33,6 @@ OSNAME := $(shell uname)
3333

3434
all:
3535
mkdir -p $(REPO_DIR)
36-
cp packages/PACKAGES $(REPO_DIR)
3736
$(MAKE) -C urand
3837
$(MAKE) -C packages
3938
ifneq ($(OSNAME), SunOS)

com.oracle.truffle.r.test.native/packages/Makefile

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2014, 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-
.PHONY: all clean make_subdirs clean_subdirs clean_recommended
24+
.PHONY: all clean repo clean_repo clean_recommended
2525

2626
SUBDIRS = testrffi vanilla tests4 gnurtests
2727
NATIVE_RECOMMENDED_PROJECT = $(subst test.native,native.recommended,$(TOPDIR))
@@ -40,24 +40,28 @@ GNUR_RECOMMENDED := $(wildcard $(GNUR_HOME_BINARY)/src/library/Recommended/*.tgz
4040
# WARNING: If you add/delete anything in this project you must update mx_fastr_dists.py
4141
# to reflect the changes, e.g., adding a new SUBDIR
4242

43-
all: make_subdirs copy_recommended
43+
all: repo copy_recommended
4444

45-
make_subdirs:
45+
# runs make in all the packages directories
46+
# creates the PACKAGES, PACAKGES.gz, etc. files in the pkgs repository
47+
repo:
4648
for dir in $(SUBDIRS); do \
4749
$(MAKE) PACKAGE=$$dir -C $$dir || exit 1; \
4850
done
51+
(cd $(REPO_DIR); $(GNUR_HOME_BINARY)/bin/R --vanilla --slave -e "tools::write_PACKAGES('.', type='source')")
4952

5053
copy_recommended:
5154
mkdir -p recommended
5255
cp $(GNUR_RECOMMENDED) recommended
5356
touch copy_recommended
5457

55-
clean: clean_subdirs clean_recommended
58+
clean: clean_repo clean_recommended
5659

57-
clean_subdirs:
60+
clean_repo:
5861
for dir in $(SUBDIRS); do \
5962
$(MAKE) PACKAGE=$$dir -C $$dir clean || exit 1; \
6063
done
64+
rm -f $(REPO_DIR)/PACKAGES*
6165

6266
clean_recommended:
6367
rm -rf recommended copy_recommended

com.oracle.truffle.r.test.native/packages/PACKAGES

Lines changed: 0 additions & 23 deletions
This file was deleted.

com.oracle.truffle.r.test.packages/importantPackages

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ caTools,1.17.1,https://cloud.r-project.org/src/contrib/caTools_1.17.1.tar.gz,tru
1616
cellranger,1.1.0,https://cloud.r-project.org/src/contrib/cellranger_1.1.0.tar.gz,true
1717
checkmate,1.8.5,https://cloud.r-project.org/src/contrib/checkmate_1.8.5.tar.gz,true
1818
class,7.3-14,https://cloud.r-project.org/src/contrib/class_7.3-14.tar.gz,true
19-
cluster,2.0.6,https://cloud.r-project.org/src/contrib/cluster_2.0.6.tar.gz,true
2019
coda,0.19-1,https://cloud.r-project.org/src/contrib/coda_0.19-1.tar.gz,true
2120
codetools,0.2-15,https://cloud.r-project.org/src/contrib/codetools_0.2-15.tar.gz,true
2221
coin,1.2-2,https://cloud.r-project.org/src/contrib/coin_1.2-2.tar.gz,true

com.oracle.truffle.r.test.packages/importantPackagesTop500

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ classInt,0.2-3,https://mran.microsoft.com/snapshot/2018-06-20/src/contrib/classI
4949
cli,1.0.0,https://mran.microsoft.com/snapshot/2018-06-20/src/contrib/cli_1.0.0.tar.gz,false
5050
clipr,0.4.0,https://mran.microsoft.com/snapshot/2018-06-20/src/contrib/clipr_0.4.0.tar.gz,false
5151
clisymbols,1.2.0,https://mran.microsoft.com/snapshot/2018-06-20/src/contrib/clisymbols_1.2.0.tar.gz,false
52-
cluster,2.0.7-1,https://mran.microsoft.com/snapshot/2018-06-20/src/contrib/cluster_2.0.7-1.tar.gz,true
5352
coda,0.19-1,https://mran.microsoft.com/snapshot/2018-06-20/src/contrib/coda_0.19-1.tar.gz,true
5453
codetools,0.2-15,https://mran.microsoft.com/snapshot/2018-06-20/src/contrib/codetools_0.2-15.tar.gz,true
5554
coin,1.2-2,https://mran.microsoft.com/snapshot/2018-06-20/src/contrib/coin_1.2-2.tar.gz,true

0 commit comments

Comments
 (0)