changeset 411:cec00d423fbc

meth: improve debugging display of DMHs in backtraces
author jrose
date Mon, 16 Jul 2012 01:10:54 -0700
parents 32510db69498
children f07d59dc449e
files meth-lazy-7023639.bmh.patch
diffstat 1 files changed, 8 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/meth-lazy-7023639.bmh.patch	Sun Jul 15 04:32:24 2012 -0700
+++ b/meth-lazy-7023639.bmh.patch	Mon Jul 16 01:10:54 2012 -0700
@@ -921,7 +921,7 @@
          final int DMH_THIS    = 0;
          final int ARG_BASE    = 1;
          final int ARG_LIMIT   = ARG_BASE + mtype.parameterCount();
-@@ -179,7 +205,7 @@
+@@ -179,16 +205,38 @@
          final int LINKER_CALL = nameCursor++;
          Name[] names = arguments(nameCursor - ARG_LIMIT, mtype.invokerType());
          assert(names.length == nameCursor);
@@ -930,7 +930,10 @@
              names[GET_MEMBER] = new Name(NF_internalMemberNameEnsureInit, names[DMH_THIS]);
          else
              names[GET_MEMBER] = new Name(NF_internalMemberName, names[DMH_THIS]);
-@@ -189,6 +215,27 @@
+         Object[] outArgs = Arrays.copyOfRange(names, ARG_BASE, GET_MEMBER+1, Object[].class);
+         assert(outArgs[outArgs.length-1] == names[GET_MEMBER]);  // look, shifted args!
+         names[LINKER_CALL] = new Name(linker, outArgs);
++        lambdaName += "_" + LambdaForm.basicTypeSignature(mtype);
          return new LambdaForm(lambdaName, ARG_LIMIT, names);
      }
  
@@ -958,7 +961,7 @@
      /*non-public*/ static
      boolean shouldBeInitialized(MemberName member) {
          switch (member.getReferenceKind()) {
-@@ -221,13 +268,6 @@
+@@ -221,13 +269,6 @@
          return MethodHandleImpl.UNSAFE.shouldBeInitialized(cls);
      }
  
@@ -972,7 +975,7 @@
      private static class EnsureInitialized extends ClassValue<WeakReference<Thread>> {
          @Override
          protected WeakReference<Thread> computeValue(Class<?> type) {
-@@ -241,29 +281,16 @@
+@@ -241,29 +282,16 @@
          static final EnsureInitialized INSTANCE = new EnsureInitialized();
      }
  
@@ -1011,7 +1014,7 @@
          Class<?> defc = member.getDeclaringClass();
          WeakReference<Thread> ref = EnsureInitialized.INSTANCE.get(defc);
          if (ref == null) {
-@@ -286,52 +313,261 @@
+@@ -286,52 +314,261 @@
          return true;
      }