changeset 413:72d2a3526502

meth-lazy: added reinvokerTarget method to BMH species
author twisti
date Tue, 17 Jul 2012 16:02:05 -0700
parents f07d59dc449e
children c73fecb5e075
files meth-lazy-7023639.bmh.patch
diffstat 1 files changed, 18 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/meth-lazy-7023639.bmh.patch	Tue Jul 17 05:25:50 2012 -0700
+++ b/meth-lazy-7023639.bmh.patch	Tue Jul 17 16:02:05 2012 -0700
@@ -718,21 +718,31 @@
  
              // emit bound argument fields
              for (int i = 0; i < types.length(); ++i) {
-@@ -644,10 +633,10 @@
+@@ -644,10 +633,20 @@
              mv.visitMaxs(0, 0);
              mv.visitEnd();
  
 -            // emit implementation of types()
 -            mv = cw.visitMethod(ACC_PUBLIC + ACC_FINAL, "types", TYPES_SIG, null, null);
++            // emit implementation of reinvokerTarget()
++            mv = cw.visitMethod(ACC_PUBLIC + ACC_FINAL, "reinvokerTarget", "()" + MH_SIG, null, null);
+             mv.visitCode();
+-            mv.visitLdcInsn(types);
++            mv.visitVarInsn(ALOAD, 0);
++            mv.visitFieldInsn(GETFIELD, className, "argL0", JLO_SIG);
++            mv.visitTypeInsn(CHECKCAST, MH);
++            mv.visitInsn(ARETURN);
++            mv.visitMaxs(0, 0);
++            mv.visitEnd();
++
 +            // emit implementation of myData()
 +            mv = cw.visitMethod(ACC_PUBLIC + ACC_FINAL, "myData", MYDATA_SIG, null, null);
-             mv.visitCode();
--            mv.visitLdcInsn(types);
++            mv.visitCode();
 +            mv.visitFieldInsn(GETSTATIC, className, "DATA", DATA_SIG);
              mv.visitInsn(ARETURN);
              mv.visitMaxs(0, 0);
              mv.visitEnd();
-@@ -655,11 +644,13 @@
+@@ -655,11 +654,13 @@
              // emit clone()
              mv = cw.visitMethod(ACC_PUBLIC + ACC_FINAL, "clone", makeSignature("", false), null, E_THROWABLE);
              mv.visitCode();
@@ -749,7 +759,7 @@
              // load mt, lf
              mv.visitVarInsn(ALOAD, 1);
              mv.visitVarInsn(ALOAD, 2);
-@@ -674,14 +665,18 @@
+@@ -674,14 +675,18 @@
              // for each type, emit cloneExtendT()
              for (Class<?> c : TYPES) {
                  char t = Wrapper.basicTypeChar(c);
@@ -773,7 +783,7 @@
                  // load mt, lf
                  mv.visitVarInsn(ALOAD, 1);
                  mv.visitVarInsn(ALOAD, 2);
-@@ -690,19 +685,31 @@
+@@ -690,19 +695,31 @@
                  // put narg on stack
                  mv.visitVarInsn(typeLoadOp(t), 3);
                  // finally, invoke the constructor and return
@@ -807,7 +817,7 @@
              UNSAFE.ensureClassInitialized(bmhClass);
  
              return bmhClass;
-@@ -745,24 +752,31 @@
+@@ -745,24 +762,31 @@
              }
          }
  
@@ -846,7 +856,7 @@
              }
          }
  
-@@ -832,13 +846,12 @@
+@@ -832,13 +856,12 @@
              return cmh;
          }