131
131
import com .oracle .truffle .api .dsl .Cached .Shared ;
132
132
import com .oracle .truffle .api .dsl .CachedContext ;
133
133
import com .oracle .truffle .api .dsl .GenerateUncached ;
134
+ import com .oracle .truffle .api .dsl .ImportStatic ;
134
135
import com .oracle .truffle .api .dsl .ReportPolymorphism ;
135
136
import com .oracle .truffle .api .dsl .Specialization ;
136
137
import com .oracle .truffle .api .interop .ArityException ;
147
148
import com .oracle .truffle .api .nodes .Node ;
148
149
import com .oracle .truffle .api .profiles .BranchProfile ;
149
150
import com .oracle .truffle .api .profiles .ConditionProfile ;
150
- import com .oracle .truffle .api .source .SourceSection ;
151
151
152
152
@ ExportLibrary (InteropLibrary .class )
153
153
@ ExportLibrary (PythonObjectLibrary .class )
@@ -1777,11 +1777,8 @@ public Class<? extends TruffleLanguage<?>> getLanguage() {
1777
1777
}
1778
1778
1779
1779
@ ExportMessage
1780
+ @ ImportStatic (PythonOptions .class )
1780
1781
public static class ToDisplayString {
1781
- public static final boolean useRepr (PythonContext context ) {
1782
- return PythonOptions .getFlag (context , PythonOptions .UseReprForPrintString );
1783
- }
1784
-
1785
1782
@ Specialization (guards = {"allowSideEffects" , "builtins != null" }) // may be null during
1786
1783
// initialization
1787
1784
public static String builtin (PythonAbstractObject self , boolean allowSideEffects ,
@@ -1790,7 +1787,7 @@ public static String builtin(PythonAbstractObject self, boolean allowSideEffects
1790
1787
@ Cached ReadAttributeFromObjectNode readStr ,
1791
1788
@ Cached CallNode callNode ,
1792
1789
@ Cached CastToJavaStringNode castStr ,
1793
- @ Cached (value = "useRepr (context)" , allowUncached = true ) boolean useRepr ) {
1790
+ @ Cached (value = "getFlag (context, UseReprForPrintString )" , allowUncached = true ) boolean useRepr ) {
1794
1791
Object toStrAttr ;
1795
1792
if (useRepr ) {
1796
1793
toStrAttr = readStr .execute (builtins , BuiltinNames .REPR );
0 commit comments