@@ -84,8 +84,11 @@ protected Object evaluate(double x, Object cum, Object ccum, int lowerTail, int
8484 cumPtr = 0L ;
8585 if (cumRead == null ) {
8686 CompilerDirectives .transferToInterpreterAndInvalidate ();
87- cumRead = Message .READ .createNode ();
88- cumWrite = Message .WRITE .createNode ();
87+ cumRead = insert (Message .READ .createNode ());
88+ }
89+ if (cumWrite == null ) {
90+ CompilerDirectives .transferToInterpreterAndInvalidate ();
91+ cumWrite = insert (Message .WRITE .createNode ());
8992 }
9093 try {
9194 cumArr [0 ] = ((Number ) ForeignAccess .sendRead (cumRead , cumTO , 0 )).doubleValue ();
@@ -109,7 +112,7 @@ protected Object evaluate(double x, Object cum, Object ccum, int lowerTail, int
109112 ccumPtr = 0L ;
110113 if (ccumWrite == null ) {
111114 CompilerDirectives .transferToInterpreterAndInvalidate ();
112- ccumWrite = Message .WRITE .createNode ();
115+ ccumWrite = insert ( Message .WRITE .createNode () );
113116 }
114117 }
115118
@@ -251,8 +254,11 @@ protected Object evaluate(double a, Object sgn) {
251254 sgnPtr = 0L ;
252255 if (sgnRead == null ) {
253256 CompilerDirectives .transferToInterpreterAndInvalidate ();
254- sgnRead = Message .READ .createNode ();
255- sgnWrite = Message .WRITE .createNode ();
257+ sgnRead = insert (Message .READ .createNode ());
258+ }
259+ if (sgnWrite == null ) {
260+ CompilerDirectives .transferToInterpreterAndInvalidate ();
261+ sgnWrite = insert (Message .WRITE .createNode ());
256262 }
257263 try {
258264 sgnArr [0 ] = ((Number ) ForeignAccess .sendRead (sgnRead , sgnTO , 0 )).intValue ();
@@ -318,8 +324,11 @@ protected Object evaluate(double x, int n, int kode, @SuppressWarnings("unused")
318324 ansPtr = 0L ;
319325 if (ansRead == null ) {
320326 CompilerDirectives .transferToInterpreterAndInvalidate ();
321- ansRead = Message .READ .createNode ();
322- ansWrite = Message .WRITE .createNode ();
327+ ansRead = insert (Message .READ .createNode ());
328+ }
329+ if (ansWrite == null ) {
330+ CompilerDirectives .transferToInterpreterAndInvalidate ();
331+ ansWrite = insert (Message .WRITE .createNode ());
323332 }
324333 try {
325334 ansIn = ((Number ) ForeignAccess .sendRead (ansRead , ansTO , 0 )).doubleValue ();
@@ -345,9 +354,13 @@ protected Object evaluate(double x, int n, int kode, @SuppressWarnings("unused")
345354 nzPtr = 0L ;
346355 if (nzRead == null ) {
347356 CompilerDirectives .transferToInterpreterAndInvalidate ();
348- nzRead = Message .READ .createNode ();
349- nzWrite = Message .WRITE .createNode ();
357+ nzRead = insert (Message .READ .createNode ());
350358 }
359+ if (nzWrite == null ) {
360+ CompilerDirectives .transferToInterpreterAndInvalidate ();
361+ nzWrite = insert (Message .WRITE .createNode ());
362+ }
363+
351364 try {
352365 nzIn = ((Number ) ForeignAccess .sendRead (nzRead , nzTO , 0 )).intValue ();
353366 } catch (UnsupportedMessageException | UnknownIdentifierException e ) {
@@ -372,8 +385,12 @@ protected Object evaluate(double x, int n, int kode, @SuppressWarnings("unused")
372385 ierrPtr = 0L ;
373386 if (ierrRead == null ) {
374387 CompilerDirectives .transferToInterpreterAndInvalidate ();
375- ierrRead = Message .READ .createNode ();
376- ierrWrite = Message .WRITE .createNode ();
388+ ierrRead = insert (Message .READ .createNode ());
389+
390+ }
391+ if (ierrWrite == null ) {
392+ CompilerDirectives .transferToInterpreterAndInvalidate ();
393+ ierrWrite = insert (Message .WRITE .createNode ());
377394 }
378395 try {
379396 ierrIn = ((Number ) ForeignAccess .sendRead (ierrRead , ierrTO , 0 )).intValue ();
@@ -702,7 +719,7 @@ protected double besselEx(BesselExCaller caller, Object b,
702719 } else {
703720 if (bForeignArray2R == null ) {
704721 CompilerDirectives .transferToInterpreterAndInvalidate ();
705- bForeignArray2R = ForeignArray2R .create ();
722+ bForeignArray2R = insert ( ForeignArray2R .create () );
706723 }
707724 bVec = (RAbstractDoubleVector ) bForeignArray2R .convert (bTO );
708725 }
0 commit comments