From: Samuele P. <ped...@us...> - 2000-12-15 03:19:03
|
Update of /cvsroot/jython/jython/org/python/compiler In directory slayer.i.sourceforge.net:/tmp/cvs-serv8926/org/python/compiler Modified Files: ProxyMaker.java Log Message: Modified: multi classloader support (I) * Proxies retrieve classes for return-type conversions from their classloaders. * BytecodeLoaders are setup with a set of referents and look for classes first through the sys.path loader and then through the loaders of the referents. makeup * Added specific SyspathJavaLoader loader class. * - python.options.extendedClassLoader Index: ProxyMaker.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/compiler/ProxyMaker.java,v retrieving revision 2.10 retrieving revision 2.11 diff -C2 -r2.10 -r2.11 *** ProxyMaker.java 2000/10/19 18:10:28 2.10 --- ProxyMaker.java 2000/12/15 03:19:00 2.11 *************** *** 381,389 **** "([Ljava/lang/Object;)Lorg/python/core/PyObject;"); code.invokevirtual(jcall); ! code.ldc(ret.getName()); int tojava = code.pool.Methodref( "org/python/core/Py", "tojava", ! "(Lorg/python/core/PyObject;Ljava/lang/String;)Ljava/lang/Object;"); code.invokestatic(tojava); // I guess I need this checkcast to keep the verifier happy --- 381,411 ---- "([Ljava/lang/Object;)Lorg/python/core/PyObject;"); code.invokevirtual(jcall); ! /* catching exceptions is not vm mandatory ! Label forname_start =code.getLabel(); ! Label forname_end = code.getLabel(); ! Label forname_exch_start = code.getLabel(); ! Label forname_exch_end = code.getLabel(); ! forname_start.setPosition(); ! */ ! int forname = code.pool.Methodref( ! "java/lang/Class","forName", ! "(Ljava/lang/String;)Ljava/lang/Class;"); code.ldc(ret.getName()); + code.invokestatic(forname); + /* + forname_end.setPosition(); + code.goto_(forname_exch_end); + forname_exch_start.setPosition(); + code.stack = 1; + code.pop(); // never reached, but this code keeps the verifier happy + code.aconst_null(); + code.dup(); + forname_exch_end.setPosition(); + + code.addExceptionHandler(forname_start,forname_end,forname_exch_start,code.pool.Class("java/lang/ClassNotFoundException")); + */ int tojava = code.pool.Methodref( "org/python/core/Py", "tojava", ! "(Lorg/python/core/PyObject;Ljava/lang/Class;)Ljava/lang/Object;"); code.invokestatic(tojava); // I guess I need this checkcast to keep the verifier happy |