From: <fwi...@us...> - 2009-10-23 21:55:36
|
Revision: 6891 http://jython.svn.sourceforge.net/jython/?rev=6891&view=rev Author: fwierzbicki Date: 2009-10-23 21:55:28 +0000 (Fri, 23 Oct 2009) Log Message: ----------- change a few calls to Codegen style, some cleanup. Modified Paths: -------------- branches/indy/src/org/python/compiler/Module.java Modified: branches/indy/src/org/python/compiler/Module.java =================================================================== --- branches/indy/src/org/python/compiler/Module.java 2009-10-23 19:10:19 UTC (rev 6890) +++ branches/indy/src/org/python/compiler/Module.java 2009-10-23 21:55:28 UTC (rev 6891) @@ -1,6 +1,7 @@ // Copyright (c) Corporation for National Research Initiatives package org.python.compiler; +import java.dyn.MethodHandle; import java.io.IOException; import java.io.OutputStream; import java.util.ArrayList; @@ -414,8 +415,11 @@ c.iconst(moreflags); - c.invokestatic("org/python/core/Py", "newCode", "(I" + $strArr + $str + $str + "IZZ" + - $pyFuncTbl + "Ljava/dyn/MethodHandle;" + $strArr + $strArr + "II)" + $pyCode); + c.invokestatic(p(Py.class), "newCode", sig(PyCode.class, Integer.TYPE, + String[].class, String.class, String.class, Integer.TYPE, Boolean.TYPE, + Boolean.TYPE, IndyFunctionTable.class, MethodHandle.class, String[].class, + String[].class, Integer.TYPE, Integer.TYPE)); + c.putstatic(module.classfile.name, name, ci(PyCode.class)); } } @@ -633,24 +637,15 @@ public void addFunctions() throws IOException { Code code = classfile.addMethod( "call_function", - "(Ljava/dyn/MethodHandle;" + $pyFrame + $threadState + ")" + $pyObj, + sig(PyObject.class, MethodHandle.class, PyFrame.class, ThreadState.class), ACC_PUBLIC); code.aload(1); // handle code.aload(0); // this code.aload(2); // frame code.aload(3); // thread state - /* - Label def = new Label(); - Label[] labels = new Label[codes.size()]; - int i; - for (i = 0; i < labels.length; i++) { - labels[i] = new Label(); - } - - */ - code.invokevirtual("java/dyn/MethodHandle", "invoke", "(Ljava/lang/Object;" + $pyFrame + - $threadState + ")" + $pyObj); + code.invokevirtual(p(MethodHandle.class), "invoke", + sig(PyObject.class, Object.class, PyFrame.class, ThreadState.class)); code.areturn(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |