51
51
import com .oracle .graal .python .builtins .objects .cext .CExtNodes ;
52
52
import com .oracle .graal .python .builtins .objects .cext .CExtNodes .ConvertArgsToSulongNode ;
53
53
import com .oracle .graal .python .builtins .objects .cext .CExtNodes .SubRefCntNode ;
54
+ import com .oracle .graal .python .builtins .objects .cext .CExtNodes .ToBorrowedRefNode ;
54
55
import 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 ;
56
57
import com .oracle .graal .python .builtins .objects .cext .CExtNodesFactory .ToJavaStealingNodeGen ;
57
- import com .oracle .graal .python .builtins .objects .cext .CExtNodesFactory .ToNewRefNodeGen ;
58
58
import com .oracle .graal .python .builtins .objects .cext .DynamicObjectNativeWrapper ;
59
59
import com .oracle .graal .python .builtins .objects .cext .PythonNativeWrapper ;
60
60
import com .oracle .graal .python .builtins .objects .cext .common .CExtCommonNodes .ConvertPIntToPrimitiveNode ;
@@ -1010,18 +1010,18 @@ abstract static class CreateArgsTupleNode extends Node {
1010
1010
@ ExplodeLoop (kind = LoopExplosionKind .FULL_UNROLL )
1011
1011
static PTuple doCachedLen (PythonObjectFactory factory , Object [] args ,
1012
1012
@ Cached ("args.length" ) int cachedLen ,
1013
- @ Cached ("createToNewRefNodes (args.length)" ) ToNewRefNode [] toNewRefNodes ,
1013
+ @ Cached ("createToBorrowedRefNodes (args.length)" ) ToBorrowedRefNode [] toBorrowedRefNodes ,
1014
1014
@ Cached ("createMaterializeNodes(args.length)" ) MaterializePrimitiveNode [] materializePrimitiveNodes ) {
1015
1015
1016
1016
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 ]);
1018
1018
}
1019
1019
return factory .createTuple (args );
1020
1020
}
1021
1021
1022
1022
@ Specialization (replaces = "doCachedLen" )
1023
1023
static PTuple doGeneric (PythonObjectFactory factory , Object [] args ,
1024
- @ Cached ToNewRefNode toNewRefNode ,
1024
+ @ Cached ToBorrowedRefNode toNewRefNode ,
1025
1025
@ Cached MaterializePrimitiveNode materializePrimitiveNode ) {
1026
1026
1027
1027
for (int i = 0 ; i < args .length ; i ++) {
@@ -1030,7 +1030,7 @@ static PTuple doGeneric(PythonObjectFactory factory, Object[] args,
1030
1030
return factory .createTuple (args );
1031
1031
}
1032
1032
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 ) {
1034
1034
Object result = materializePrimitiveNode .execute (factory , arg );
1035
1035
1036
1036
// 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,
1042
1042
return result ;
1043
1043
}
1044
1044
1045
- static ToNewRefNode [] createToNewRefNodes (int length ) {
1046
- ToNewRefNode [] newRefNodes = new ToNewRefNode [length ];
1045
+ static ToBorrowedRefNode [] createToBorrowedRefNodes (int length ) {
1046
+ ToBorrowedRefNode [] newRefNodes = new ToBorrowedRefNode [length ];
1047
1047
for (int i = 0 ; i < length ; i ++) {
1048
- newRefNodes [i ] = ToNewRefNodeGen .create ();
1048
+ newRefNodes [i ] = ToBorrowedRefNodeGen .create ();
1049
1049
}
1050
1050
return newRefNodes ;
1051
1051
}
0 commit comments