133
133
import com .oracle .graal .python .nodes .truffle .PythonArithmeticTypes ;
134
134
import com .oracle .graal .python .nodes .util .CastToIndexNode ;
135
135
import com .oracle .graal .python .nodes .util .CastToIntegerFromIntNode ;
136
+ import com .oracle .graal .python .nodes .util .CastToJavaLongNode ;
136
137
import com .oracle .graal .python .nodes .util .CastToStringNode ;
137
138
import com .oracle .graal .python .nodes .util .ChannelNodes .ReadFromChannelNode ;
138
139
import com .oracle .graal .python .runtime .PosixResources ;
150
151
import com .oracle .truffle .api .TruffleFile ;
151
152
import com .oracle .truffle .api .TruffleLanguage .Env ;
152
153
import com .oracle .truffle .api .dsl .Cached ;
154
+ import com .oracle .truffle .api .dsl .Cached .Shared ;
153
155
import com .oracle .truffle .api .dsl .Fallback ;
154
156
import com .oracle .truffle .api .dsl .GenerateNodeFactory ;
155
157
import com .oracle .truffle .api .dsl .NodeFactory ;
@@ -1244,9 +1246,9 @@ public abstract static class ReadNode extends PythonFileNode {
1244
1246
@ CompilationFinal private BranchProfile tooLargeProfile = BranchProfile .create ();
1245
1247
1246
1248
@ Specialization
1247
- Object read (@ SuppressWarnings ("unused" ) VirtualFrame frame , int fd , long requestedSize ,
1248
- @ Cached ("createClassProfile()" ) ValueProfile channelClassProfile ,
1249
- @ Cached ( "create()" ) ReadFromChannelNode readNode ) {
1249
+ Object readLong (@ SuppressWarnings ("unused" ) VirtualFrame frame , int fd , long requestedSize ,
1250
+ @ Shared ( "profile" ) @ Cached ("createClassProfile()" ) ValueProfile channelClassProfile ,
1251
+ @ Shared ( "readNode" ) @ Cached ReadFromChannelNode readNode ) {
1250
1252
int size ;
1251
1253
try {
1252
1254
size = Math .toIntExact (requestedSize );
@@ -1258,6 +1260,14 @@ Object read(@SuppressWarnings("unused") VirtualFrame frame, int fd, long request
1258
1260
ByteSequenceStorage array = readNode .execute (channel , size );
1259
1261
return factory ().createBytes (array );
1260
1262
}
1263
+
1264
+ @ Specialization
1265
+ Object read (@ SuppressWarnings ("unused" ) VirtualFrame frame , int fd , Object requestedSize ,
1266
+ @ Shared ("profile" ) @ Cached ("createClassProfile()" ) ValueProfile channelClassProfile ,
1267
+ @ Shared ("readNode" ) @ Cached ReadFromChannelNode readNode ,
1268
+ @ Cached CastToJavaLongNode castToLongNode ) {
1269
+ return readLong (frame , fd , castToLongNode .execute (requestedSize ), channelClassProfile , readNode );
1270
+ }
1261
1271
}
1262
1272
1263
1273
@ Builtin (name = "isatty" , minNumOfPositionalArgs = 1 )
0 commit comments