112
112
import com .oracle .graal .python .builtins .objects .PNotImplemented ;
113
113
import com .oracle .graal .python .builtins .objects .buffer .PythonBufferAccessLibrary ;
114
114
import com .oracle .graal .python .builtins .objects .buffer .PythonBufferAcquireLibrary ;
115
+ import com .oracle .graal .python .builtins .objects .bytes .BytesCommonBuiltins ;
115
116
import com .oracle .graal .python .builtins .objects .bytes .BytesNodes ;
116
117
import com .oracle .graal .python .builtins .objects .bytes .PByteArray ;
117
118
import com .oracle .graal .python .builtins .objects .bytes .PBytes ;
207
208
import com .oracle .graal .python .nodes .builtins .TupleNodes ;
208
209
import com .oracle .graal .python .nodes .call .CallNode ;
209
210
import com .oracle .graal .python .nodes .call .special .CallUnaryMethodNode ;
210
- import com .oracle .graal .python .nodes .call .special .LookupAndCallTernaryNode ;
211
211
import com .oracle .graal .python .nodes .call .special .LookupAndCallUnaryNode ;
212
212
import com .oracle .graal .python .nodes .call .special .LookupSpecialMethodSlotNode ;
213
213
import com .oracle .graal .python .nodes .classes .IsSubtypeNode ;
@@ -1823,7 +1823,7 @@ static Object doBuffer(VirtualFrame frame, Object cls, Object obj, Object encodi
1823
1823
@ Exclusive @ Cached InlinedConditionProfile isPStringProfile ,
1824
1824
@ Exclusive @ CachedLibrary ("obj" ) PythonBufferAcquireLibrary acquireLib ,
1825
1825
@ Exclusive @ CachedLibrary (limit = "1" ) PythonBufferAccessLibrary bufferLib ,
1826
- @ Exclusive @ Cached ( "create(T_DECODE)" ) LookupAndCallTernaryNode callDecodeNode ,
1826
+ @ Exclusive @ Cached BytesCommonBuiltins . DecodeNode decodeNode ,
1827
1827
@ Shared @ Cached TypeNodes .GetInstanceShape getInstanceShape ,
1828
1828
@ Exclusive @ Cached PRaiseNode raiseNode ) {
1829
1829
Object buffer ;
@@ -1837,7 +1837,7 @@ static Object doBuffer(VirtualFrame frame, Object cls, Object obj, Object encodi
1837
1837
// TODO don't copy, CPython creates a memoryview
1838
1838
PBytes bytesObj = PFactory .createBytes (PythonLanguage .get (inliningTarget ), bufferLib .getCopiedByteArray (buffer ));
1839
1839
Object en = encoding == PNone .NO_VALUE ? T_UTF8 : encoding ;
1840
- Object result = assertNoJavaString (callDecodeNode .execute (frame , bytesObj , en , errors ));
1840
+ Object result = assertNoJavaString (decodeNode .execute (frame , bytesObj , en , errors ));
1841
1841
if (isStringProfile .profile (inliningTarget , result instanceof TruffleString )) {
1842
1842
return asPString (cls , (TruffleString ) result , inliningTarget , isPrimitiveProfile , getInstanceShape );
1843
1843
} else if (isPStringProfile .profile (inliningTarget , result instanceof PString )) {
@@ -1882,7 +1882,7 @@ static Object doNativeSubclassEncodeErr(VirtualFrame frame, Object cls, Object o
1882
1882
@ Exclusive @ Cached InlinedConditionProfile isPStringProfile ,
1883
1883
@ Exclusive @ CachedLibrary ("obj" ) PythonBufferAcquireLibrary acquireLib ,
1884
1884
@ Exclusive @ CachedLibrary (limit = "1" ) PythonBufferAccessLibrary bufferLib ,
1885
- @ Exclusive @ Cached ( "create(T_DECODE)" ) LookupAndCallTernaryNode callDecodeNode ,
1885
+ @ Exclusive @ Cached BytesCommonBuiltins . DecodeNode decodeNode ,
1886
1886
@ Shared @ Cached (neverDefault = true ) CExtNodes .StringSubtypeNew subtypeNew ,
1887
1887
@ Shared @ Cached TypeNodes .GetInstanceShape getInstanceShape ,
1888
1888
@ Exclusive @ Cached PRaiseNode raiseNode ) {
@@ -1895,7 +1895,7 @@ static Object doNativeSubclassEncodeErr(VirtualFrame frame, Object cls, Object o
1895
1895
try {
1896
1896
PBytes bytesObj = PFactory .createBytes (PythonLanguage .get (inliningTarget ), bufferLib .getCopiedByteArray (buffer ));
1897
1897
Object en = encoding == PNone .NO_VALUE ? T_UTF8 : encoding ;
1898
- Object result = assertNoJavaString (callDecodeNode .execute (frame , bytesObj , en , errors ));
1898
+ Object result = assertNoJavaString (decodeNode .execute (frame , bytesObj , en , errors ));
1899
1899
if (isStringProfile .profile (inliningTarget , result instanceof TruffleString )) {
1900
1900
return subtypeNew .call (cls , asPString (cls , (TruffleString ) result , inliningTarget , isPrimitiveProfile , getInstanceShape ));
1901
1901
} else if (isPStringProfile .profile (inliningTarget , result instanceof PString )) {
0 commit comments