5151import com .oracle .graal .python .builtins .objects .cext .CExtNodes ;
5252import com .oracle .graal .python .builtins .objects .cext .CExtNodes .ConvertArgsToSulongNode ;
5353import com .oracle .graal .python .builtins .objects .cext .CExtNodes .SubRefCntNode ;
54+ import com .oracle .graal .python .builtins .objects .cext .CExtNodes .ToBorrowedRefNode ;
5455import com .oracle .graal .python .builtins .objects .cext .CExtNodes .ToJavaStealingNode ;
55- import com .oracle .graal .python .builtins .objects .cext .CExtNodes . ToNewRefNode ;
56+ import com .oracle .graal .python .builtins .objects .cext .CExtNodesFactory . ToBorrowedRefNodeGen ;
5657import com .oracle .graal .python .builtins .objects .cext .CExtNodesFactory .ToJavaStealingNodeGen ;
57- import com .oracle .graal .python .builtins .objects .cext .CExtNodesFactory .ToNewRefNodeGen ;
5858import com .oracle .graal .python .builtins .objects .cext .DynamicObjectNativeWrapper ;
5959import com .oracle .graal .python .builtins .objects .cext .PythonNativeWrapper ;
6060import com .oracle .graal .python .builtins .objects .cext .common .CExtCommonNodes .ConvertPIntToPrimitiveNode ;
@@ -1010,18 +1010,18 @@ abstract static class CreateArgsTupleNode extends Node {
10101010 @ ExplodeLoop (kind = LoopExplosionKind .FULL_UNROLL )
10111011 static PTuple doCachedLen (PythonObjectFactory factory , Object [] args ,
10121012 @ Cached ("args.length" ) int cachedLen ,
1013- @ Cached ("createToNewRefNodes (args.length)" ) ToNewRefNode [] toNewRefNodes ,
1013+ @ Cached ("createToBorrowedRefNodes (args.length)" ) ToBorrowedRefNode [] toBorrowedRefNodes ,
10141014 @ Cached ("createMaterializeNodes(args.length)" ) MaterializePrimitiveNode [] materializePrimitiveNodes ) {
10151015
10161016 for (int i = 0 ; i < cachedLen ; i ++) {
1017- args [i ] = prepareReference (args [i ], factory , materializePrimitiveNodes [i ], toNewRefNodes [i ]);
1017+ args [i ] = prepareReference (args [i ], factory , materializePrimitiveNodes [i ], toBorrowedRefNodes [i ]);
10181018 }
10191019 return factory .createTuple (args );
10201020 }
10211021
10221022 @ Specialization (replaces = "doCachedLen" )
10231023 static PTuple doGeneric (PythonObjectFactory factory , Object [] args ,
1024- @ Cached ToNewRefNode toNewRefNode ,
1024+ @ Cached ToBorrowedRefNode toNewRefNode ,
10251025 @ Cached MaterializePrimitiveNode materializePrimitiveNode ) {
10261026
10271027 for (int i = 0 ; i < args .length ; i ++) {
@@ -1030,7 +1030,7 @@ static PTuple doGeneric(PythonObjectFactory factory, Object[] args,
10301030 return factory .createTuple (args );
10311031 }
10321032
1033- private static Object prepareReference (Object arg , PythonObjectFactory factory , MaterializePrimitiveNode materializePrimitiveNode , ToNewRefNode toNewRefNode ) {
1033+ private static Object prepareReference (Object arg , PythonObjectFactory factory , MaterializePrimitiveNode materializePrimitiveNode , ToBorrowedRefNode toNewRefNode ) {
10341034 Object result = materializePrimitiveNode .execute (factory , arg );
10351035
10361036 // Tuples are actually stealing the reference of their items. That's why we need to
@@ -1042,10 +1042,10 @@ private static Object prepareReference(Object arg, PythonObjectFactory factory,
10421042 return result ;
10431043 }
10441044
1045- static ToNewRefNode [] createToNewRefNodes (int length ) {
1046- ToNewRefNode [] newRefNodes = new ToNewRefNode [length ];
1045+ static ToBorrowedRefNode [] createToBorrowedRefNodes (int length ) {
1046+ ToBorrowedRefNode [] newRefNodes = new ToBorrowedRefNode [length ];
10471047 for (int i = 0 ; i < length ; i ++) {
1048- newRefNodes [i ] = ToNewRefNodeGen .create ();
1048+ newRefNodes [i ] = ToBorrowedRefNodeGen .create ();
10491049 }
10501050 return newRefNodes ;
10511051 }
0 commit comments