@@ -127,7 +127,7 @@ public double doPI(PInt value) {
127
127
128
128
@ Specialization (guards = "!isNumber(value)" )
129
129
public double doGeneral (Object value ,
130
- @ Cached ("create()" ) ConvertToDoubleNode convertToFloat ) {
130
+ @ Cached ("create()" ) CastToDoubleNode convertToFloat ) {
131
131
return count (convertToFloat .execute (value ));
132
132
}
133
133
}
@@ -261,7 +261,7 @@ public Object ceil(PInt value,
261
261
262
262
@ Specialization (guards = {"!isNumber(value)" })
263
263
public Object ceil (Object value ,
264
- @ Cached ("create()" ) ConvertToDoubleNode convertToFloat ,
264
+ @ Cached ("create()" ) CastToDoubleNode convertToFloat ,
265
265
@ Cached ("create(__CEIL__)" ) LookupAndCallUnaryNode dispatchCeil ) {
266
266
Object result = dispatchCeil .executeObject (value );
267
267
if (result == PNone .NO_VALUE ) {
@@ -742,7 +742,7 @@ public PTuple frexpPI(PInt value) {
742
742
743
743
@ Specialization (guards = "!isNumber(value)" )
744
744
public PTuple frexpO (Object value ,
745
- @ Cached ("create()" ) ConvertToDoubleNode convertToFloat ) {
745
+ @ Cached ("create()" ) CastToDoubleNode convertToFloat ) {
746
746
return frexpD (convertToFloat .execute (value ));
747
747
}
748
748
}
@@ -769,7 +769,7 @@ public boolean isNan(double value) {
769
769
770
770
@ Specialization (guards = "!isNumber(value)" )
771
771
public boolean isinf (Object value ,
772
- @ Cached ("create()" ) ConvertToDoubleNode convertToFloat ) {
772
+ @ Cached ("create()" ) CastToDoubleNode convertToFloat ) {
773
773
return isNan (convertToFloat .execute (value ));
774
774
}
775
775
}
@@ -958,7 +958,7 @@ public PTuple frexpPI(PInt value) {
958
958
959
959
@ Specialization (guards = "!isNumber(value)" )
960
960
public PTuple frexpO (Object value ,
961
- @ Cached ("create()" ) ConvertToDoubleNode convertToFloatNode ) {
961
+ @ Cached ("create()" ) CastToDoubleNode convertToFloatNode ) {
962
962
return modfD (convertToFloatNode .execute (value ));
963
963
}
964
964
}
@@ -983,7 +983,7 @@ public abstract static class FsumNode extends PythonUnaryBuiltinNode {
983
983
public double doIt (Object iterable ,
984
984
@ Cached ("create()" ) GetIteratorNode getIterator ,
985
985
@ Cached ("create(__NEXT__)" ) LookupAndCallUnaryNode next ,
986
- @ Cached ("create()" ) ConvertToDoubleNode toFloat ,
986
+ @ Cached ("create()" ) CastToDoubleNode toFloat ,
987
987
@ Cached ("createBinaryProfile()" ) ConditionProfile stopProfile ) {
988
988
Object iterator = getIterator .executeWith (iterable );
989
989
double x , y , t , hi , lo = 0 , yr , inf_sum = 0 , special_sum = 0 , sum ;
@@ -1144,11 +1144,11 @@ int gcd(@SuppressWarnings("unused") PInt x, @SuppressWarnings("unused") double y
1144
1144
1145
1145
@ Specialization (guards = "!isNumber(x) || !isNumber(y)" )
1146
1146
Object gcd (Object x , Object y ,
1147
- @ Cached ("create()" ) ConvertToIntNode xConvert ,
1148
- @ Cached ("create()" ) ConvertToIntNode yConvert ,
1147
+ @ Cached ("create()" ) CastToIntNode xCast ,
1148
+ @ Cached ("create()" ) CastToIntNode yCast ,
1149
1149
@ Cached ("create()" ) GcdNode recursiveNode ) {
1150
- Object xValue = xConvert .execute (x );
1151
- Object yValue = yConvert .execute (y );
1150
+ Object xValue = xCast .execute (x );
1151
+ Object yValue = yCast .execute (y );
1152
1152
return recursiveNode .execute (xValue , yValue );
1153
1153
}
1154
1154
@@ -1340,7 +1340,7 @@ public boolean isfinite(double value) {
1340
1340
1341
1341
@ Specialization (guards = "!isNumber(value)" )
1342
1342
public boolean isinf (Object value ,
1343
- @ Cached ("create()" ) ConvertToDoubleNode convertToFloat ) {
1343
+ @ Cached ("create()" ) CastToDoubleNode convertToFloat ) {
1344
1344
return isfinite (convertToFloat .execute (value ));
1345
1345
}
1346
1346
}
@@ -1368,7 +1368,7 @@ public boolean isinf(double value) {
1368
1368
1369
1369
@ Specialization (guards = "!isNumber(value)" )
1370
1370
public boolean isinf (Object value ,
1371
- @ Cached ("create()" ) ConvertToDoubleNode convertToFloat ) {
1371
+ @ Cached ("create()" ) CastToDoubleNode convertToFloat ) {
1372
1372
return isinf (convertToFloat .execute (value ));
1373
1373
}
1374
1374
}
@@ -1379,24 +1379,24 @@ public boolean isinf(Object value,
1379
1379
@ GenerateNodeFactory
1380
1380
public abstract static class LogNode extends PythonBinaryBuiltinNode {
1381
1381
1382
- @ Child private ConvertToDoubleNode valueConvertNode ;
1383
- @ Child private ConvertToDoubleNode baseConvertNode ;
1382
+ @ Child private CastToDoubleNode valueCastNode ;
1383
+ @ Child private CastToDoubleNode baseCastNode ;
1384
1384
@ Child private LogNode recLogNode ;
1385
1385
1386
- private ConvertToDoubleNode getValueConvertNode () {
1387
- if (valueConvertNode == null ) {
1386
+ private CastToDoubleNode getValueCastNode () {
1387
+ if (valueCastNode == null ) {
1388
1388
CompilerDirectives .transferToInterpreterAndInvalidate ();
1389
- valueConvertNode = insert (ConvertToDoubleNode .create ());
1389
+ valueCastNode = insert (CastToDoubleNode .create ());
1390
1390
}
1391
- return valueConvertNode ;
1391
+ return valueCastNode ;
1392
1392
}
1393
1393
1394
- private ConvertToDoubleNode getBaseConvertNode () {
1395
- if (baseConvertNode == null ) {
1394
+ private CastToDoubleNode getBaseCastNode () {
1395
+ if (baseCastNode == null ) {
1396
1396
CompilerDirectives .transferToInterpreterAndInvalidate ();
1397
- baseConvertNode = insert (ConvertToDoubleNode .create ());
1397
+ baseCastNode = insert (CastToDoubleNode .create ());
1398
1398
}
1399
- return baseConvertNode ;
1399
+ return baseCastNode ;
1400
1400
}
1401
1401
1402
1402
private double executeRecursiveLogNode (Object value , Object base ) {
@@ -1540,27 +1540,27 @@ public double logPIPI(PInt value, PInt base,
1540
1540
1541
1541
@ Specialization (guards = "!isNumber(value)" )
1542
1542
public double logO (Object value , PNone novalue ) {
1543
- return executeRecursiveLogNode (getValueConvertNode ().execute (value ), novalue );
1543
+ return executeRecursiveLogNode (getValueCastNode ().execute (value ), novalue );
1544
1544
}
1545
1545
1546
1546
@ Specialization (guards = {"!isNumber(value)" , "!isNoValue(base)" })
1547
1547
public double logOO (Object value , Object base ) {
1548
- return executeRecursiveLogNode (getValueConvertNode ().execute (value ), getBaseConvertNode ().execute (base ));
1548
+ return executeRecursiveLogNode (getValueCastNode ().execute (value ), getBaseCastNode ().execute (base ));
1549
1549
}
1550
1550
1551
1551
@ Specialization (guards = {"!isNumber(base)" })
1552
1552
public double logLO (long value , Object base ) {
1553
- return executeRecursiveLogNode (value , getBaseConvertNode ().execute (base ));
1553
+ return executeRecursiveLogNode (value , getBaseCastNode ().execute (base ));
1554
1554
}
1555
1555
1556
1556
@ Specialization (guards = {"!isNumber(base)" })
1557
1557
public double logDO (double value , Object base ) {
1558
- return executeRecursiveLogNode (value , getBaseConvertNode ().execute (base ));
1558
+ return executeRecursiveLogNode (value , getBaseCastNode ().execute (base ));
1559
1559
}
1560
1560
1561
1561
@ Specialization (guards = {"!isNumber(base)" })
1562
1562
public double logPIO (PInt value , Object base ) {
1563
- return executeRecursiveLogNode (value , getBaseConvertNode ().execute (base ));
1563
+ return executeRecursiveLogNode (value , getBaseCastNode ().execute (base ));
1564
1564
}
1565
1565
1566
1566
private void raiseMathError (ConditionProfile doNotFit , boolean con ) {
@@ -1801,8 +1801,8 @@ public abstract static class PowNode extends PythonBinaryBuiltinNode {
1801
1801
1802
1802
@ Specialization (guards = {"!isNumber(left)||!isNumber(right)" })
1803
1803
double pow (Object left , Object right ,
1804
- @ Cached ("create()" ) ConvertToDoubleNode convertLeftFloat ,
1805
- @ Cached ("create()" ) ConvertToDoubleNode convertRightFloat ) {
1804
+ @ Cached ("create()" ) CastToDoubleNode convertLeftFloat ,
1805
+ @ Cached ("create()" ) CastToDoubleNode convertRightFloat ) {
1806
1806
return pow (convertLeftFloat .execute (left ), convertRightFloat .execute (right ));
1807
1807
}
1808
1808
}
@@ -1875,8 +1875,8 @@ public abstract static class Atan2Node extends PythonBinaryBuiltinNode {
1875
1875
1876
1876
@ Specialization (guards = "!isNumber(left) || !isNumber(right)" )
1877
1877
double atan2 (Object left , Object right ,
1878
- @ Cached ("create()" ) ConvertToDoubleNode convertLeftFloat ,
1879
- @ Cached ("create()" ) ConvertToDoubleNode convertRightFloat ) {
1878
+ @ Cached ("create()" ) CastToDoubleNode convertLeftFloat ,
1879
+ @ Cached ("create()" ) CastToDoubleNode convertRightFloat ) {
1880
1880
return atan2DD (convertLeftFloat .execute (left ), convertRightFloat .execute (right ));
1881
1881
}
1882
1882
}
@@ -1963,9 +1963,9 @@ public double hypotPIL(PInt x, long y) {
1963
1963
1964
1964
@ Specialization (guards = "!isNumber(objectX) || !isNumber(objectY)" )
1965
1965
public double hypotOO (Object objectX , Object objectY ,
1966
- @ Cached ("create()" ) ConvertToDoubleNode xConvertNode ,
1967
- @ Cached ("create()" ) ConvertToDoubleNode yConvertNode ) {
1968
- return hypotDD (xConvertNode .execute (objectX ), yConvertNode .execute (objectY ));
1966
+ @ Cached ("create()" ) CastToDoubleNode xCastNode ,
1967
+ @ Cached ("create()" ) CastToDoubleNode yCastNode ) {
1968
+ return hypotDD (xCastNode .execute (objectX ), yCastNode .execute (objectY ));
1969
1969
}
1970
1970
}
1971
1971
0 commit comments