|
52 | 52 | import static com.oracle.graal.python.builtins.modules.CodecsModuleBuiltins.BACKSLASHREPLACE;
|
53 | 53 | import static com.oracle.graal.python.builtins.modules.CodecsModuleBuiltins.STRICT;
|
54 | 54 | import static com.oracle.graal.python.builtins.modules.io.IONodes.WRITE;
|
55 |
| -import static com.oracle.graal.python.builtins.objects.traceback.TracebackNodes.castToString; |
56 |
| -import static com.oracle.graal.python.builtins.objects.traceback.TracebackNodes.classNameNoDot; |
57 |
| -import static com.oracle.graal.python.builtins.objects.traceback.TracebackNodes.fileFlush; |
58 |
| -import static com.oracle.graal.python.builtins.objects.traceback.TracebackNodes.fileWriteString; |
59 |
| -import static com.oracle.graal.python.builtins.objects.traceback.TracebackNodes.getExceptionTraceback; |
60 |
| -import static com.oracle.graal.python.builtins.objects.traceback.TracebackNodes.getObjectClass; |
61 |
| -import static com.oracle.graal.python.builtins.objects.traceback.TracebackNodes.getTypeName; |
62 |
| -import static com.oracle.graal.python.builtins.objects.traceback.TracebackNodes.longAsInt; |
63 |
| -import static com.oracle.graal.python.builtins.objects.traceback.TracebackNodes.objectHasAttr; |
64 |
| -import static com.oracle.graal.python.builtins.objects.traceback.TracebackNodes.objectLookupAttr; |
65 |
| -import static com.oracle.graal.python.builtins.objects.traceback.TracebackNodes.objectLookupAttrAsString; |
66 |
| -import static com.oracle.graal.python.builtins.objects.traceback.TracebackNodes.objectRepr; |
67 |
| -import static com.oracle.graal.python.builtins.objects.traceback.TracebackNodes.objectStr; |
68 |
| -import static com.oracle.graal.python.builtins.objects.traceback.TracebackNodes.tryCastToString; |
| 55 | +import static com.oracle.graal.python.lib.PyTraceBackPrintNode.castToString; |
| 56 | +import static com.oracle.graal.python.lib.PyTraceBackPrintNode.classNameNoDot; |
| 57 | +import static com.oracle.graal.python.lib.PyTraceBackPrintNode.fileFlush; |
| 58 | +import static com.oracle.graal.python.lib.PyTraceBackPrintNode.fileWriteString; |
| 59 | +import static com.oracle.graal.python.lib.PyTraceBackPrintNode.getExceptionTraceback; |
| 60 | +import static com.oracle.graal.python.lib.PyTraceBackPrintNode.getObjectClass; |
| 61 | +import static com.oracle.graal.python.lib.PyTraceBackPrintNode.getTypeName; |
| 62 | +import static com.oracle.graal.python.lib.PyTraceBackPrintNode.longAsInt; |
| 63 | +import static com.oracle.graal.python.lib.PyTraceBackPrintNode.objectHasAttr; |
| 64 | +import static com.oracle.graal.python.lib.PyTraceBackPrintNode.objectLookupAttr; |
| 65 | +import static com.oracle.graal.python.lib.PyTraceBackPrintNode.objectLookupAttrAsString; |
| 66 | +import static com.oracle.graal.python.lib.PyTraceBackPrintNode.objectRepr; |
| 67 | +import static com.oracle.graal.python.lib.PyTraceBackPrintNode.objectStr; |
| 68 | +import static com.oracle.graal.python.lib.PyTraceBackPrintNode.tryCastToString; |
69 | 69 | import static com.oracle.graal.python.nodes.BuiltinNames.BREAKPOINTHOOK;
|
70 | 70 | import static com.oracle.graal.python.nodes.BuiltinNames.BUILTINS;
|
71 | 71 | import static com.oracle.graal.python.nodes.BuiltinNames.DISPLAYHOOK;
|
|
106 | 106 | import java.util.Map;
|
107 | 107 | import java.util.Set;
|
108 | 108 |
|
| 109 | +import com.oracle.graal.python.lib.PyTraceBackPrintNode; |
109 | 110 | import org.graalvm.nativeimage.ImageInfo;
|
110 | 111 |
|
111 | 112 | import com.oracle.graal.python.PythonLanguage;
|
|
141 | 142 | import com.oracle.graal.python.builtins.objects.traceback.GetTracebackNode;
|
142 | 143 | import com.oracle.graal.python.builtins.objects.traceback.LazyTraceback;
|
143 | 144 | import com.oracle.graal.python.builtins.objects.traceback.PTraceback;
|
144 |
| -import com.oracle.graal.python.builtins.objects.traceback.TracebackNodes; |
145 | 145 | import com.oracle.graal.python.builtins.objects.tuple.PTuple;
|
146 | 146 | import com.oracle.graal.python.builtins.objects.tuple.StructSequence;
|
147 | 147 | import com.oracle.graal.python.builtins.objects.tuple.TupleBuiltins;
|
@@ -894,32 +894,32 @@ static Object gettrace() {
|
894 | 894 | "* object: Object causing the exception, can be None.")
|
895 | 895 | @GenerateNodeFactory
|
896 | 896 | abstract static class UnraisableHookNode extends PythonBuiltinNode {
|
897 |
| - @Child private TracebackNodes.PrintTracebackNode printTracebackNode; |
| 897 | + @Child private PyTraceBackPrintNode pyTraceBackPrintNode; |
898 | 898 |
|
899 | 899 | private void printTraceBack(VirtualFrame frame, PythonModule sys, Object out, Object tb) {
|
900 |
| - if (printTracebackNode == null) { |
| 900 | + if (pyTraceBackPrintNode == null) { |
901 | 901 | CompilerDirectives.transferToInterpreterAndInvalidate();
|
902 |
| - printTracebackNode = insert(TracebackNodes.PrintTracebackNode.create()); |
| 902 | + pyTraceBackPrintNode = insert(PyTraceBackPrintNode.create()); |
903 | 903 | }
|
904 |
| - printTracebackNode.execute(frame, sys, out, tb); |
| 904 | + pyTraceBackPrintNode.execute(frame, sys, out, tb); |
905 | 905 | }
|
906 | 906 |
|
907 | 907 | private void writeUnraisableExc(MaterializedFrame frame, PythonModule sys, Object out,
|
908 | 908 | Object excType, Object excValue, Object excTb, Object errMsg, Object obj) {
|
909 | 909 | if (obj != PNone.NONE) {
|
910 | 910 | if (errMsg != PNone.NONE) {
|
911 |
| - TracebackNodes.fileWriteObject(frame, out, errMsg, true); |
| 911 | + PyTraceBackPrintNode.fileWriteObject(frame, out, errMsg, true); |
912 | 912 | fileWriteString(frame, out, ": ");
|
913 | 913 | } else {
|
914 | 914 | fileWriteString(frame, out, "Exception ignored in: ");
|
915 | 915 | }
|
916 | 916 |
|
917 |
| - if (!TracebackNodes.fileWriteObject(frame, out, obj, false)) { |
| 917 | + if (!PyTraceBackPrintNode.fileWriteObject(frame, out, obj, false)) { |
918 | 918 | fileWriteString(frame, out, "<object repr() failed>");
|
919 | 919 | }
|
920 | 920 | fileWriteString(frame, out, NEW_LINE);
|
921 | 921 | } else if (errMsg != PNone.NONE) {
|
922 |
| - TracebackNodes.fileWriteObject(frame, out, errMsg, true); |
| 922 | + PyTraceBackPrintNode.fileWriteObject(frame, out, errMsg, true); |
923 | 923 | fileWriteString(frame, out, ":\n");
|
924 | 924 | }
|
925 | 925 |
|
@@ -958,7 +958,7 @@ private void writeUnraisableExc(MaterializedFrame frame, PythonModule sys, Objec
|
958 | 958 | if (excValue != PNone.NONE) {
|
959 | 959 | // only print colon if the str() of the object is not the empty string
|
960 | 960 | fileWriteString(frame, out, ": ");
|
961 |
| - if (!TracebackNodes.fileWriteObject(frame, out, excValue, true)) { |
| 961 | + if (!PyTraceBackPrintNode.fileWriteObject(frame, out, excValue, true)) { |
962 | 962 | fileWriteString(frame, out, "<exception str() failed>");
|
963 | 963 | }
|
964 | 964 | }
|
@@ -1002,14 +1002,14 @@ abstract static class ExceptHookNode extends PythonBuiltinNode {
|
1002 | 1002 | static final String ATTR_OFFSET = "offset";
|
1003 | 1003 | static final String ATTR_TEXT = "text";
|
1004 | 1004 |
|
1005 |
| - @Child private TracebackNodes.PrintTracebackNode printTracebackNode; |
| 1005 | + @Child private PyTraceBackPrintNode pyTraceBackPrintNode; |
1006 | 1006 |
|
1007 | 1007 | private void printTraceBack(VirtualFrame frame, PythonModule sys, Object out, Object tb) {
|
1008 |
| - if (printTracebackNode == null) { |
| 1008 | + if (pyTraceBackPrintNode == null) { |
1009 | 1009 | CompilerDirectives.transferToInterpreterAndInvalidate();
|
1010 |
| - printTracebackNode = insert(TracebackNodes.PrintTracebackNode.create()); |
| 1010 | + pyTraceBackPrintNode = insert(PyTraceBackPrintNode.create()); |
1011 | 1011 | }
|
1012 |
| - printTracebackNode.execute(frame, sys, out, tb); |
| 1012 | + pyTraceBackPrintNode.execute(frame, sys, out, tb); |
1013 | 1013 | }
|
1014 | 1014 |
|
1015 | 1015 | @CompilerDirectives.ValueType
|
|
0 commit comments