Skip to content

Commit 4eea65f

Browse files
committed
Renaming util nodes.
1 parent 310036a commit 4eea65f

File tree

4 files changed

+30
-30
lines changed

4 files changed

+30
-30
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/modules/BuiltinFunctions.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@
121121
import com.oracle.graal.python.nodes.object.GetClassNode;
122122
import com.oracle.graal.python.nodes.subscript.GetItemNode;
123123
import com.oracle.graal.python.nodes.truffle.PythonArithmeticTypes;
124-
import com.oracle.graal.python.nodes.util.GetIntNode;
124+
import com.oracle.graal.python.nodes.util.ConvertToIntNode;
125125
import com.oracle.graal.python.runtime.PythonContext;
126126
import com.oracle.graal.python.runtime.PythonCore;
127127
import com.oracle.graal.python.runtime.PythonOptions;
@@ -237,7 +237,7 @@ public String doPI(PInt x) {
237237

238238
@Specialization
239239
public String doO(Object x,
240-
@Cached("create()") GetIntNode toIntNode,
240+
@Cached("create()") ConvertToIntNode toIntNode,
241241
@Cached("create()") BinNode recursiveNode) {
242242
Object value = toIntNode.execute(x);
243243
return recursiveNode.executeObject(value);

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/modules/MathModuleBuiltins.java

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ public double doPI(PInt value) {
127127

128128
@Specialization(guards = "!isNumber(value)")
129129
public double doGeneral(Object value,
130-
@Cached("create()") GetDoubleNode convertToFloat) {
130+
@Cached("create()") ConvertToDoubleNode convertToFloat) {
131131
return count(convertToFloat.execute(value));
132132
}
133133
}
@@ -261,7 +261,7 @@ public Object ceil(PInt value,
261261

262262
@Specialization(guards = {"!isNumber(value)"})
263263
public Object ceil(Object value,
264-
@Cached("create()") GetDoubleNode convertToFloat,
264+
@Cached("create()") ConvertToDoubleNode convertToFloat,
265265
@Cached("create(__CEIL__)") LookupAndCallUnaryNode dispatchCeil) {
266266
Object result = dispatchCeil.executeObject(value);
267267
if (result == PNone.NO_VALUE) {
@@ -742,7 +742,7 @@ public PTuple frexpPI(PInt value) {
742742

743743
@Specialization(guards = "!isNumber(value)")
744744
public PTuple frexpO(Object value,
745-
@Cached("create()") GetDoubleNode convertToFloat) {
745+
@Cached("create()") ConvertToDoubleNode convertToFloat) {
746746
return frexpD(convertToFloat.execute(value));
747747
}
748748
}
@@ -769,7 +769,7 @@ public boolean isNan(double value) {
769769

770770
@Specialization(guards = "!isNumber(value)")
771771
public boolean isinf(Object value,
772-
@Cached("create()") GetDoubleNode convertToFloat) {
772+
@Cached("create()") ConvertToDoubleNode convertToFloat) {
773773
return isNan(convertToFloat.execute(value));
774774
}
775775
}
@@ -958,7 +958,7 @@ public PTuple frexpPI(PInt value) {
958958

959959
@Specialization(guards = "!isNumber(value)")
960960
public PTuple frexpO(Object value,
961-
@Cached("create()") GetDoubleNode convertToFloatNode) {
961+
@Cached("create()") ConvertToDoubleNode convertToFloatNode) {
962962
return modfD(convertToFloatNode.execute(value));
963963
}
964964
}
@@ -983,7 +983,7 @@ public abstract static class FsumNode extends PythonUnaryBuiltinNode {
983983
public double doIt(Object iterable,
984984
@Cached("create()") GetIteratorNode getIterator,
985985
@Cached("create(__NEXT__)") LookupAndCallUnaryNode next,
986-
@Cached("create()") GetDoubleNode toFloat,
986+
@Cached("create()") ConvertToDoubleNode toFloat,
987987
@Cached("createBinaryProfile()") ConditionProfile stopProfile) {
988988
Object iterator = getIterator.executeWith(iterable);
989989
double x, y, t, hi, lo = 0, yr, inf_sum = 0, special_sum = 0, sum;
@@ -1144,8 +1144,8 @@ int gcd(@SuppressWarnings("unused") PInt x, @SuppressWarnings("unused") double y
11441144

11451145
@Specialization(guards = "!isNumber(x) || !isNumber(y)")
11461146
Object gcd(Object x, Object y,
1147-
@Cached("create()") GetIntNode xConvert,
1148-
@Cached("create()") GetIntNode yConvert,
1147+
@Cached("create()") ConvertToIntNode xConvert,
1148+
@Cached("create()") ConvertToIntNode yConvert,
11491149
@Cached("create()") GcdNode recursiveNode) {
11501150
Object xValue = xConvert.execute(x);
11511151
Object yValue = yConvert.execute(y);
@@ -1340,7 +1340,7 @@ public boolean isfinite(double value) {
13401340

13411341
@Specialization(guards = "!isNumber(value)")
13421342
public boolean isinf(Object value,
1343-
@Cached("create()") GetDoubleNode convertToFloat) {
1343+
@Cached("create()") ConvertToDoubleNode convertToFloat) {
13441344
return isfinite(convertToFloat.execute(value));
13451345
}
13461346
}
@@ -1368,7 +1368,7 @@ public boolean isinf(double value) {
13681368

13691369
@Specialization(guards = "!isNumber(value)")
13701370
public boolean isinf(Object value,
1371-
@Cached("create()") GetDoubleNode convertToFloat) {
1371+
@Cached("create()") ConvertToDoubleNode convertToFloat) {
13721372
return isinf(convertToFloat.execute(value));
13731373
}
13741374
}
@@ -1379,22 +1379,22 @@ public boolean isinf(Object value,
13791379
@GenerateNodeFactory
13801380
public abstract static class LogNode extends PythonBinaryBuiltinNode {
13811381

1382-
@Child private GetDoubleNode valueConvertNode;
1383-
@Child private GetDoubleNode baseConvertNode;
1382+
@Child private ConvertToDoubleNode valueConvertNode;
1383+
@Child private ConvertToDoubleNode baseConvertNode;
13841384
@Child private LogNode recLogNode;
13851385

1386-
private GetDoubleNode getValueConvertNode() {
1386+
private ConvertToDoubleNode getValueConvertNode() {
13871387
if (valueConvertNode == null) {
13881388
CompilerDirectives.transferToInterpreterAndInvalidate();
1389-
valueConvertNode = insert(GetDoubleNode.create());
1389+
valueConvertNode = insert(ConvertToDoubleNode.create());
13901390
}
13911391
return valueConvertNode;
13921392
}
13931393

1394-
private GetDoubleNode getBaseConvertNode() {
1394+
private ConvertToDoubleNode getBaseConvertNode() {
13951395
if (baseConvertNode == null) {
13961396
CompilerDirectives.transferToInterpreterAndInvalidate();
1397-
baseConvertNode = insert(GetDoubleNode.create());
1397+
baseConvertNode = insert(ConvertToDoubleNode.create());
13981398
}
13991399
return baseConvertNode;
14001400
}
@@ -1801,8 +1801,8 @@ public abstract static class PowNode extends PythonBinaryBuiltinNode {
18011801

18021802
@Specialization(guards = {"!isNumber(left)||!isNumber(right)"})
18031803
double pow(Object left, Object right,
1804-
@Cached("create()") GetDoubleNode convertLeftFloat,
1805-
@Cached("create()") GetDoubleNode convertRightFloat) {
1804+
@Cached("create()") ConvertToDoubleNode convertLeftFloat,
1805+
@Cached("create()") ConvertToDoubleNode convertRightFloat) {
18061806
return pow(convertLeftFloat.execute(left), convertRightFloat.execute(right));
18071807
}
18081808
}
@@ -1875,8 +1875,8 @@ public abstract static class Atan2Node extends PythonBinaryBuiltinNode {
18751875

18761876
@Specialization(guards = "!isNumber(left) || !isNumber(right)")
18771877
double atan2(Object left, Object right,
1878-
@Cached("create()") GetDoubleNode convertLeftFloat,
1879-
@Cached("create()") GetDoubleNode convertRightFloat) {
1878+
@Cached("create()") ConvertToDoubleNode convertLeftFloat,
1879+
@Cached("create()") ConvertToDoubleNode convertRightFloat) {
18801880
return atan2DD(convertLeftFloat.execute(left), convertRightFloat.execute(right));
18811881
}
18821882
}
@@ -1963,8 +1963,8 @@ public double hypotPIL(PInt x, long y) {
19631963

19641964
@Specialization(guards = "!isNumber(objectX) || !isNumber(objectY)")
19651965
public double hypotOO(Object objectX, Object objectY,
1966-
@Cached("create()") GetDoubleNode xConvertNode,
1967-
@Cached("create()") GetDoubleNode yConvertNode) {
1966+
@Cached("create()") ConvertToDoubleNode xConvertNode,
1967+
@Cached("create()") ConvertToDoubleNode yConvertNode) {
19681968
return hypotDD(xConvertNode.execute(objectX), yConvertNode.execute(objectY));
19691969
}
19701970
}

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/nodes/util/GetDoubleNode.java renamed to graalpython/com.oracle.graal.python/src/com/oracle/graal/python/nodes/util/ConvertToDoubleNode.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,14 @@
5555

5656
@TypeSystemReference(PythonArithmeticTypes.class)
5757
@ImportStatic(MathGuards.class)
58-
public abstract class GetDoubleNode extends PBaseNode {
58+
public abstract class ConvertToDoubleNode extends PBaseNode {
5959

6060
@Node.Child private LookupAndCallUnaryNode callFloatNode;
6161

6262
abstract public double execute(Object x);
6363

64-
public static GetDoubleNode create() {
65-
return GetDoubleNodeGen.create();
64+
public static ConvertToDoubleNode create() {
65+
return ConvertToDoubleNodeGen.create();
6666
}
6767

6868
@Specialization

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/nodes/util/GetIntNode.java renamed to graalpython/com.oracle.graal.python/src/com/oracle/graal/python/nodes/util/ConvertToIntNode.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,14 @@
5555

5656
@TypeSystemReference(PythonArithmeticTypes.class)
5757
@ImportStatic(MathGuards.class)
58-
public abstract class GetIntNode extends PBaseNode {
58+
public abstract class ConvertToIntNode extends PBaseNode {
5959

6060
@Node.Child private LookupAndCallUnaryNode callIndexNode;
6161

6262
public abstract Object execute(Object x);
6363

64-
public static GetIntNode create() {
65-
return GetIntNodeGen.create();
64+
public static ConvertToIntNode create() {
65+
return ConvertToIntNodeGen.create();
6666
}
6767

6868
@Specialization

0 commit comments

Comments
 (0)