Skip to content
Snippets Groups Projects
Commit 6b1400d3 authored by stepan's avatar stepan
Browse files

Add missing insert calls when creating child nodes

parent 81cdc2ed
No related branches found
No related tags found
No related merge requests found
...@@ -47,7 +47,7 @@ public class TruffleNFI_UserRng implements UserRngRFFI { ...@@ -47,7 +47,7 @@ public class TruffleNFI_UserRng implements UserRngRFFI {
protected void init(NativeFunction userFunction, NativeFunction readFunction) { protected void init(NativeFunction userFunction, NativeFunction readFunction) {
if (userFunctionNode == null) { if (userFunctionNode == null) {
CompilerDirectives.transferToInterpreterAndInvalidate(); CompilerDirectives.transferToInterpreterAndInvalidate();
userFunctionNode = Message.createExecute(userFunction.getArgumentCount()).createNode(); userFunctionNode = insert(Message.createExecute(userFunction.getArgumentCount()).createNode());
} }
if (userFunctionTarget == null) { if (userFunctionTarget == null) {
CompilerDirectives.transferToInterpreterAndInvalidate(); CompilerDirectives.transferToInterpreterAndInvalidate();
...@@ -56,7 +56,7 @@ public class TruffleNFI_UserRng implements UserRngRFFI { ...@@ -56,7 +56,7 @@ public class TruffleNFI_UserRng implements UserRngRFFI {
if (readFunction != null) { if (readFunction != null) {
if (readPointerNode == null) { if (readPointerNode == null) {
CompilerDirectives.transferToInterpreterAndInvalidate(); CompilerDirectives.transferToInterpreterAndInvalidate();
readPointerNode = Message.createExecute(readFunction.getArgumentCount()).createNode(); readPointerNode = insert(Message.createExecute(readFunction.getArgumentCount()).createNode());
} }
if (readPointerTarget == null) { if (readPointerTarget == null) {
CompilerDirectives.transferToInterpreterAndInvalidate(); CompilerDirectives.transferToInterpreterAndInvalidate();
......
...@@ -183,7 +183,7 @@ public final class AttributesAccessNodes { ...@@ -183,7 +183,7 @@ public final class AttributesAccessNodes {
public Void doRAttributeStorage(RAttributeStorage x, RAttributeStorage y) { public Void doRAttributeStorage(RAttributeStorage x, RAttributeStorage y) {
if (copyRegAttributes == null) { if (copyRegAttributes == null) {
CompilerDirectives.transferToInterpreterAndInvalidate(); CompilerDirectives.transferToInterpreterAndInvalidate();
copyRegAttributes = CopyOfRegAttributesNode.create(); copyRegAttributes = insert(CopyOfRegAttributesNode.create());
} }
copyRegAttributes.execute(x, y); copyRegAttributes.execute(x, y);
return null; return null;
......
...@@ -84,8 +84,11 @@ public final class MathFunctionsNodes { ...@@ -84,8 +84,11 @@ public final class MathFunctionsNodes {
cumPtr = 0L; cumPtr = 0L;
if (cumRead == null) { if (cumRead == null) {
CompilerDirectives.transferToInterpreterAndInvalidate(); CompilerDirectives.transferToInterpreterAndInvalidate();
cumRead = Message.READ.createNode(); cumRead = insert(Message.READ.createNode());
cumWrite = Message.WRITE.createNode(); }
if (cumWrite == null) {
CompilerDirectives.transferToInterpreterAndInvalidate();
cumWrite = insert(Message.WRITE.createNode());
} }
try { try {
cumArr[0] = ((Number) ForeignAccess.sendRead(cumRead, cumTO, 0)).doubleValue(); cumArr[0] = ((Number) ForeignAccess.sendRead(cumRead, cumTO, 0)).doubleValue();
...@@ -109,7 +112,7 @@ public final class MathFunctionsNodes { ...@@ -109,7 +112,7 @@ public final class MathFunctionsNodes {
ccumPtr = 0L; ccumPtr = 0L;
if (ccumWrite == null) { if (ccumWrite == null) {
CompilerDirectives.transferToInterpreterAndInvalidate(); CompilerDirectives.transferToInterpreterAndInvalidate();
ccumWrite = Message.WRITE.createNode(); ccumWrite = insert(Message.WRITE.createNode());
} }
} }
...@@ -251,8 +254,11 @@ public final class MathFunctionsNodes { ...@@ -251,8 +254,11 @@ public final class MathFunctionsNodes {
sgnPtr = 0L; sgnPtr = 0L;
if (sgnRead == null) { if (sgnRead == null) {
CompilerDirectives.transferToInterpreterAndInvalidate(); CompilerDirectives.transferToInterpreterAndInvalidate();
sgnRead = Message.READ.createNode(); sgnRead = insert(Message.READ.createNode());
sgnWrite = Message.WRITE.createNode(); }
if (sgnWrite == null) {
CompilerDirectives.transferToInterpreterAndInvalidate();
sgnWrite = insert(Message.WRITE.createNode());
} }
try { try {
sgnArr[0] = ((Number) ForeignAccess.sendRead(sgnRead, sgnTO, 0)).intValue(); sgnArr[0] = ((Number) ForeignAccess.sendRead(sgnRead, sgnTO, 0)).intValue();
...@@ -318,8 +324,11 @@ public final class MathFunctionsNodes { ...@@ -318,8 +324,11 @@ public final class MathFunctionsNodes {
ansPtr = 0L; ansPtr = 0L;
if (ansRead == null) { if (ansRead == null) {
CompilerDirectives.transferToInterpreterAndInvalidate(); CompilerDirectives.transferToInterpreterAndInvalidate();
ansRead = Message.READ.createNode(); ansRead = insert(Message.READ.createNode());
ansWrite = Message.WRITE.createNode(); }
if (ansWrite == null) {
CompilerDirectives.transferToInterpreterAndInvalidate();
ansWrite = insert(Message.WRITE.createNode());
} }
try { try {
ansIn = ((Number) ForeignAccess.sendRead(ansRead, ansTO, 0)).doubleValue(); ansIn = ((Number) ForeignAccess.sendRead(ansRead, ansTO, 0)).doubleValue();
...@@ -345,9 +354,13 @@ public final class MathFunctionsNodes { ...@@ -345,9 +354,13 @@ public final class MathFunctionsNodes {
nzPtr = 0L; nzPtr = 0L;
if (nzRead == null) { if (nzRead == null) {
CompilerDirectives.transferToInterpreterAndInvalidate(); CompilerDirectives.transferToInterpreterAndInvalidate();
nzRead = Message.READ.createNode(); nzRead = insert(Message.READ.createNode());
nzWrite = Message.WRITE.createNode();
} }
if (nzWrite == null) {
CompilerDirectives.transferToInterpreterAndInvalidate();
nzWrite = insert(Message.WRITE.createNode());
}
try { try {
nzIn = ((Number) ForeignAccess.sendRead(nzRead, nzTO, 0)).intValue(); nzIn = ((Number) ForeignAccess.sendRead(nzRead, nzTO, 0)).intValue();
} catch (UnsupportedMessageException | UnknownIdentifierException e) { } catch (UnsupportedMessageException | UnknownIdentifierException e) {
...@@ -372,8 +385,12 @@ public final class MathFunctionsNodes { ...@@ -372,8 +385,12 @@ public final class MathFunctionsNodes {
ierrPtr = 0L; ierrPtr = 0L;
if (ierrRead == null) { if (ierrRead == null) {
CompilerDirectives.transferToInterpreterAndInvalidate(); CompilerDirectives.transferToInterpreterAndInvalidate();
ierrRead = Message.READ.createNode(); ierrRead = insert(Message.READ.createNode());
ierrWrite = Message.WRITE.createNode();
}
if (ierrWrite == null) {
CompilerDirectives.transferToInterpreterAndInvalidate();
ierrWrite = insert(Message.WRITE.createNode());
} }
try { try {
ierrIn = ((Number) ForeignAccess.sendRead(ierrRead, ierrTO, 0)).intValue(); ierrIn = ((Number) ForeignAccess.sendRead(ierrRead, ierrTO, 0)).intValue();
...@@ -702,7 +719,7 @@ public final class MathFunctionsNodes { ...@@ -702,7 +719,7 @@ public final class MathFunctionsNodes {
} else { } else {
if (bForeignArray2R == null) { if (bForeignArray2R == null) {
CompilerDirectives.transferToInterpreterAndInvalidate(); CompilerDirectives.transferToInterpreterAndInvalidate();
bForeignArray2R = ForeignArray2R.create(); bForeignArray2R = insert(ForeignArray2R.create());
} }
bVec = (RAbstractDoubleVector) bForeignArray2R.convert(bTO); bVec = (RAbstractDoubleVector) bForeignArray2R.convert(bTO);
} }
......
...@@ -239,7 +239,7 @@ public final class RandFunctionsNodes { ...@@ -239,7 +239,7 @@ public final class RandFunctionsNodes {
} else { } else {
if (probForeignArray2R == null) { if (probForeignArray2R == null) {
CompilerDirectives.transferToInterpreterAndInvalidate(); CompilerDirectives.transferToInterpreterAndInvalidate();
probForeignArray2R = ForeignArray2R.create(); probForeignArray2R = insert(ForeignArray2R.create());
} }
probVector = (RAbstractDoubleVector) probForeignArray2R.convert(probTO); probVector = (RAbstractDoubleVector) probForeignArray2R.convert(probTO);
} }
...@@ -261,9 +261,9 @@ public final class RandFunctionsNodes { ...@@ -261,9 +261,9 @@ public final class RandFunctionsNodes {
} else { } else {
if (rNForeignArray2R == null) { if (rNForeignArray2R == null) {
CompilerDirectives.transferToInterpreterAndInvalidate(); CompilerDirectives.transferToInterpreterAndInvalidate();
rNForeignArray2R = ForeignArray2R.create(); rNForeignArray2R = insert(ForeignArray2R.create());
} }
rNVector = (RAbstractIntVector) probForeignArray2R.convert(probTO); rNVector = (RAbstractIntVector) rNForeignArray2R.convert(probTO);
} }
doRMultinomNode.execute(n, probVector, k, rNVector); doRMultinomNode.execute(n, probVector, k, rNVector);
......
...@@ -105,7 +105,7 @@ public final class RForeignStringWrapper extends RForeignWrapper implements RAbs ...@@ -105,7 +105,7 @@ public final class RForeignStringWrapper extends RForeignWrapper implements RAbs
if (isNullProfile.profile(value instanceof TruffleObject)) { if (isNullProfile.profile(value instanceof TruffleObject)) {
if (isNull == null) { if (isNull == null) {
CompilerDirectives.transferToInterpreterAndInvalidate(); CompilerDirectives.transferToInterpreterAndInvalidate();
isNull = Message.IS_NULL.createNode(); isNull = insert(Message.IS_NULL.createNode());
} }
if (ForeignAccess.sendIsNull(isNull, (TruffleObject) value)) { if (ForeignAccess.sendIsNull(isNull, (TruffleObject) value)) {
return RRuntime.STRING_NA; return RRuntime.STRING_NA;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment