67
67
import com .oracle .graal .python .nodes .function .PythonBuiltinNode ;
68
68
import com .oracle .graal .python .runtime .exception .PythonErrorType ;
69
69
import com .oracle .graal .python .runtime .sequence .PSequence ;
70
- import com .oracle .graal .python .runtime .sequence .storage .IntSequenceStorage ;
71
70
import com .oracle .truffle .api .CompilerDirectives .TruffleBoundary ;
72
71
import com .oracle .truffle .api .CompilerDirectives .ValueType ;
73
72
import com .oracle .truffle .api .dsl .Cached ;
@@ -226,12 +225,13 @@ private ChannelFD[] seq2set(VirtualFrame frame, Object sequence, PythonObjectLib
226
225
PSequence pSequence = constructListNode .execute (sequence );
227
226
228
227
for (int i = 0 ; i < len ; i ++) {
229
- int fd = itemLib .asFileDescriptorWithState (callGetItemNode .executeObject (frame , pSequence , i ), threadState );
228
+ Object pythonObject = callGetItemNode .executeObject (frame , pSequence , i );
229
+ int fd = itemLib .asFileDescriptorWithState (pythonObject , threadState );
230
230
Channel fileChannel = getContext ().getResources ().getFileChannel (fd );
231
231
if (!(fileChannel instanceof SelectableChannel )) {
232
232
throw NonSelectableChannel .INSTANCE ;
233
233
}
234
- result [i ] = new ChannelFD (fd , (SelectableChannel ) fileChannel );
234
+ result [i ] = new ChannelFD (pythonObject , (SelectableChannel ) fileChannel );
235
235
}
236
236
return result ;
237
237
}
@@ -243,13 +243,13 @@ private PList toList(ChannelFD[] arr) {
243
243
cnt ++;
244
244
}
245
245
}
246
- int [] fds = new int [cnt ];
246
+ Object [] fds = new Object [cnt ];
247
247
for (ChannelFD channelFD : arr ) {
248
248
if (channelFD != null ) {
249
- fds [fds .length - (cnt --)] = channelFD .fd ;
249
+ fds [fds .length - (cnt --)] = channelFD .pythonObject ;
250
250
}
251
251
}
252
- return factory ().createList (new IntSequenceStorage ( fds ) );
252
+ return factory ().createList (fds );
253
253
}
254
254
255
255
static LookupAndCallBinaryNode createGetItem () {
@@ -258,11 +258,11 @@ static LookupAndCallBinaryNode createGetItem() {
258
258
259
259
@ ValueType
260
260
private static final class ChannelFD {
261
- private final int fd ;
261
+ private final Object pythonObject ;
262
262
private final SelectableChannel channel ;
263
263
264
- private ChannelFD (int fd , SelectableChannel channel ) {
265
- this .fd = fd ;
264
+ private ChannelFD (Object pythonObject , SelectableChannel channel ) {
265
+ this .pythonObject = pythonObject ;
266
266
this .channel = channel ;
267
267
}
268
268
}
0 commit comments