Skip to content

Commit d2ed63b

Browse files
committed
Replace PInteropXXX nodes with lib nodes.
PullRequest: graalpython/3320
2 parents fa0e33e + 483b93d commit d2ed63b

File tree

6 files changed

+32
-244
lines changed

6 files changed

+32
-244
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/modules/cext/PythonCextSlotBuiltins.java

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,7 @@
9494
import static com.oracle.graal.python.nodes.HiddenAttr.PROMOTED_START;
9595
import static com.oracle.graal.python.nodes.HiddenAttr.PROMOTED_STEP;
9696
import static com.oracle.graal.python.nodes.HiddenAttr.PROMOTED_STOP;
97-
import static com.oracle.graal.python.nodes.SpecialAttributeNames.T___DOC__;
9897
import static com.oracle.graal.python.nodes.SpecialAttributeNames.T___MODULE__;
99-
import static com.oracle.graal.python.nodes.SpecialAttributeNames.T___NAME__;
10098
import static com.oracle.graal.python.util.PythonUtils.TS_ENCODING;
10199

102100
import com.oracle.graal.python.builtins.PythonBuiltinClassType;
@@ -148,7 +146,7 @@
148146
import com.oracle.graal.python.lib.PyObjectSetAttr;
149147
import com.oracle.graal.python.nodes.HiddenAttr;
150148
import com.oracle.graal.python.nodes.PGuards;
151-
import com.oracle.graal.python.nodes.SpecialAttributeNames;
149+
import com.oracle.graal.python.nodes.attributes.GetAttributeNode.GetFixedAttributeNode;
152150
import com.oracle.graal.python.nodes.attributes.WriteAttributeToObjectNode;
153151
import com.oracle.graal.python.nodes.object.GetClassNode;
154152
import com.oracle.graal.python.nodes.object.GetDictIfExistsNode;
@@ -477,9 +475,9 @@ abstract static class Py_get_PyGetSetDef_doc extends CApiUnaryBuiltinNode {
477475
@Specialization
478476
Object get(PythonObject object,
479477
@Bind("this") Node inliningTarget,
480-
@Cached PythonAbstractObject.PInteropGetAttributeNode getAttrNode,
478+
@Cached(parameters = "T___DOC__") GetFixedAttributeNode getAttrNode,
481479
@Cached AsCharPointerNode asCharPointerNode) {
482-
Object doc = getAttrNode.execute(inliningTarget, object, T___DOC__);
480+
Object doc = getAttrNode.execute(null, object);
483481
if (PGuards.isPNone(doc)) {
484482
return getNULL();
485483
} else {
@@ -501,9 +499,9 @@ abstract static class Py_get_PyGetSetDef_name extends CApiUnaryBuiltinNode {
501499
@Specialization
502500
Object get(PythonObject object,
503501
@Bind("this") Node inliningTarget,
504-
@Cached PythonAbstractObject.PInteropGetAttributeNode getAttrNode,
502+
@Cached(parameters = "T___NAME__") GetFixedAttributeNode getAttrNode,
505503
@Cached AsCharPointerNode asCharPointerNode) {
506-
Object name = getAttrNode.execute(inliningTarget, object, T___NAME__);
504+
Object name = getAttrNode.execute(null, object);
507505
if (PGuards.isPNone(name)) {
508506
return getNULL();
509507
} else {
@@ -619,8 +617,8 @@ abstract static class Py_get_PyModuleObject_md_dict extends CApiUnaryBuiltinNode
619617
@Specialization
620618
static Object get(Object object,
621619
@Bind("this") Node inliningTarget,
622-
@Exclusive @Cached PythonAbstractObject.PInteropGetAttributeNode getDictNode) {
623-
return getDictNode.execute(inliningTarget, object, SpecialAttributeNames.T___DICT__);
620+
@Exclusive @Cached(parameters = "T___DICT__") GetFixedAttributeNode getDictNode) {
621+
return getDictNode.execute(null, object);
624622
}
625623
}
626624

0 commit comments

Comments
 (0)