110
110
import com .oracle .graal .python .builtins .objects .module .PythonModule ;
111
111
import com .oracle .graal .python .builtins .objects .object .PythonObjectLibrary ;
112
112
import com .oracle .graal .python .builtins .objects .socket .PSocket ;
113
- import com .oracle .graal .python .builtins .objects .str .PString ;
114
113
import com .oracle .graal .python .builtins .objects .tuple .PTuple ;
115
114
import com .oracle .graal .python .builtins .objects .type .LazyPythonClass ;
116
115
import com .oracle .graal .python .nodes .SpecialMethodNames ;
@@ -304,11 +303,6 @@ Object execute(VirtualFrame frame, PythonModule thisModule, String path, PList a
304
303
return doExecute (frame , thisModule , path , args );
305
304
}
306
305
307
- @ Specialization
308
- Object execute (VirtualFrame frame , PythonModule thisModule , PString path , PTuple args ) {
309
- return execute (frame , thisModule , path .getValue (), args );
310
- }
311
-
312
306
@ Specialization
313
307
Object execute (VirtualFrame frame , PythonModule thisModule , String path , PTuple args ) {
314
308
// in case of execl the PList happens to be in the tuples first entry
@@ -317,8 +311,15 @@ Object execute(VirtualFrame frame, PythonModule thisModule, String path, PTuple
317
311
}
318
312
319
313
@ Specialization
320
- Object execute (VirtualFrame frame , PythonModule thisModule , PString path , PList args ) {
321
- return doExecute (frame , thisModule , path .getValue (), args );
314
+ Object executePath (VirtualFrame frame , PythonModule thisModule , Object path , PTuple args ,
315
+ @ Cached @ Shared ("castToPath" ) CastToPathNode castToPathNode ) {
316
+ return execute (frame , thisModule , castToPathNode .execute (frame , path ), args );
317
+ }
318
+
319
+ @ Specialization
320
+ Object executePath (VirtualFrame frame , PythonModule thisModule , Object path , PList args ,
321
+ @ Cached @ Shared ("castToPath" ) CastToPathNode castToPathNode ) {
322
+ return doExecute (frame , thisModule , castToPathNode .execute (frame , path ), args );
322
323
}
323
324
324
325
Object doExecute (VirtualFrame frame , PythonModule thisModule , String path , PSequence args ) {
@@ -404,8 +405,9 @@ PNone chdir(VirtualFrame frame, String spath) {
404
405
}
405
406
406
407
@ Specialization
407
- PNone chdirPString (VirtualFrame frame , PString spath ) {
408
- return chdir (frame , spath .getValue ());
408
+ PNone chdirPath (VirtualFrame frame , Object path ,
409
+ @ Cached CastToPathNode castToPathNode ) {
410
+ return chdir (frame , castToPathNode .execute (frame , path ));
409
411
}
410
412
}
411
413
0 commit comments