From: <fwi...@us...> - 2009-09-23 20:45:46
|
Revision: 6806 http://jython.svn.sourceforge.net/jython/?rev=6806&view=rev Author: fwierzbicki Date: 2009-09-23 20:45:33 +0000 (Wed, 23 Sep 2009) Log Message: ----------- Fixed up call_function and classpath in indy shell script. Modified Paths: -------------- trunk/sandbox/wierzbicki/indy_jython/IndyDump.java trunk/sandbox/wierzbicki/indy_jython/indy Modified: trunk/sandbox/wierzbicki/indy_jython/IndyDump.java =================================================================== --- trunk/sandbox/wierzbicki/indy_jython/IndyDump.java 2009-09-23 17:34:06 UTC (rev 6805) +++ trunk/sandbox/wierzbicki/indy_jython/IndyDump.java 2009-09-23 20:45:33 UTC (rev 6806) @@ -150,7 +150,7 @@ mv.visitLdcInsn(Type.getType("Lorg/python/core/ThreadState;")); mv.visitInsn(AASTORE); mv.visitMethodInsn(INVOKESTATIC, "java/dyn/MethodType", "make", "(Ljava/lang/Class;Ljava/lang/Class;[Ljava/lang/Class;)Ljava/dyn/MethodType;"); -mv.visitMethodInsn(INVOKEVIRTUAL, "java/dyn/MethodHandles$Lookup", "findStatic", "(Ljava/lang/Class;Ljava/lang/String;Ljava/dyn/MethodType;)Ljava/dyn/MethodHandle;"); +mv.visitMethodInsn(INVOKEVIRTUAL, "java/dyn/MethodHandles$Lookup", "findVirtual", "(Ljava/lang/Class;Ljava/lang/String;Ljava/dyn/MethodType;)Ljava/dyn/MethodHandle;"); mv.visitInsn(ACONST_NULL); mv.visitInsn(ACONST_NULL); @@ -188,7 +188,7 @@ mv.visitLdcInsn(Type.getType("Lorg/python/core/ThreadState;")); mv.visitInsn(AASTORE); mv.visitMethodInsn(INVOKESTATIC, "java/dyn/MethodType", "make", "(Ljava/lang/Class;Ljava/lang/Class;[Ljava/lang/Class;)Ljava/dyn/MethodType;"); -mv.visitMethodInsn(INVOKEVIRTUAL, "java/dyn/MethodHandles$Lookup", "findStatic", "(Ljava/lang/Class;Ljava/lang/String;Ljava/dyn/MethodType;)Ljava/dyn/MethodHandle;"); +mv.visitMethodInsn(INVOKEVIRTUAL, "java/dyn/MethodHandles$Lookup", "findVirtual", "(Ljava/lang/Class;Ljava/lang/String;Ljava/dyn/MethodType;)Ljava/dyn/MethodHandle;"); mv.visitInsn(ACONST_NULL); mv.visitInsn(ACONST_NULL); @@ -197,7 +197,7 @@ mv.visitMethodInsn(INVOKESTATIC, "org/python/core/Py", "newCode", "(I[Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;IZZLorg/python/core/IndyFunctionTable;Ljava/dyn/MethodHandle;[Ljava/lang/String;[Ljava/lang/String;II)Lorg/python/core/PyCode;"); mv.visitFieldInsn(PUTSTATIC, "Hello", "greet$1", "Lorg/python/core/PyCode;"); mv.visitInsn(RETURN); -mv.visitMaxs(13, 3); +mv.visitMaxs(17, 3); mv.visitEnd(); } { @@ -236,13 +236,12 @@ mv = cw.visitMethod(ACC_PUBLIC, "call_function", "(Ljava/dyn/MethodHandle;Lorg/python/core/PyFrame;Lorg/python/core/ThreadState;)Lorg/python/core/PyObject;", null, null); mv.visitCode(); mv.visitFrame(Opcodes.F_NEW, 0, new Object[] {}, 0, new Object[] {}); +mv.visitVarInsn(ALOAD, 1); mv.visitVarInsn(ALOAD, 0); mv.visitVarInsn(ALOAD, 2); mv.visitVarInsn(ALOAD, 3); +mv.visitMethodInsn(INVOKEVIRTUAL, "java/dyn/MethodHandle", "invoke", "(LHello;Lorg/python/core/PyFrame;Lorg/python/core/ThreadState;)Lorg/python/core/PyObject;"); -//MethodHandle -mv.visitVarInsn(ALOAD, 1); - /* Label l0 = new Label(); Label l1 = new Label(); Modified: trunk/sandbox/wierzbicki/indy_jython/indy =================================================================== --- trunk/sandbox/wierzbicki/indy_jython/indy 2009-09-23 17:34:06 UTC (rev 6805) +++ trunk/sandbox/wierzbicki/indy_jython/indy 2009-09-23 20:45:33 UTC (rev 6806) @@ -5,4 +5,4 @@ $JAVA_HOME/bin/javac -classpath $JARS:. IndyDump.java $JAVA_HOME/bin/java -classpath $JARS:. IndyDump -$JAVA_HOME/bin/java -classpath $JARS:. Hello +$JAVA_HOME/bin/java -Xbootclasspath/a:.:$JARS -XX:+UnlockExperimentalVMOptions -XX:+EnableMethodHandles -XX:+EnableInvokeDynamic Hello This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |