changeset 50:3ac10f0fff3e

update code dump in comments
author jrose
date Sat, 20 Nov 2010 01:12:48 -0800
parents d99854a91f8d
children e6beb9f45c82
files netbeans/indy-demo/src/GetNameDemo.java
diffstat 1 files changed, 85 insertions(+), 50 deletions(-) [+]
line wrap: on
line diff
--- a/netbeans/indy-demo/src/GetNameDemo.java	Sat Nov 20 01:03:38 2010 -0800
+++ b/netbeans/indy-demo/src/GetNameDemo.java	Sat Nov 20 01:12:48 2010 -0800
@@ -123,64 +123,99 @@
 
 /* resulting code
 --------
-        MH=$PROJECTS/MethodHandle/dist/MethodHandle.jar
+        MH=$DAVINCI/patches/netbeans/meth/dist/meth.jar
 --------
         LT=$DAVINCI/sources/langtools
 --------
-        cd $PROJECTS/InvokeDynamicDemo
+        cd $DAVINCI/patches/netbeans/indy-demo/
 --------
-        $LT/dist/bin/javac -target 7 -d build/classes -classpath $MH src/GetNameDemo.java
+        $JAVA7_HOME/bin/javac -target 7 -d build/classes -classpath $MH src/GetNameDemo.java
+--------
+        $JAVA7_HOME/bin/javac -d build/classes src/indify/Indify.java
+--------
+        $JAVA7_HOME/bin/java -cp build/classes indify.Indify --overwrite build/classes/GetNameDemo.class
 --------
         $LT/dist/bin/javap -c -classpath build/classes GetNameDemo
-...
+Compiled from "GetNameDemo.java"
 class GetNameDemo extends java.lang.Object {
-public static void main(java.lang.String...);
-  Code:
-   0:   aload_0
-   1:   arraylength
-   2:   ifne    15
-   5:   iconst_1
-   6:   anewarray       #2; //class java/lang/String
-   9:   dup
-   10:  iconst_0
-   11:  ldc     #3; //String fred.txt
-   13:  aastore
-   14:  astore_0
-   15:  new     #4; //class java/io/File
-   18:  dup
-   19:  aload_0
-   20:  iconst_0
-   21:  aaload
-   22:  invokespecial   #5; //Method java/io/File."<init>":(Ljava/lang/String;)V
-   25:  astore_1
-   26:  aload_1
-   27:  invokevirtual   #6; //Method java/io/File.getName:()Ljava/lang/String;
-   30:  astore_2
-   31:  getstatic       #7; //Field java/lang/System.out:Ljava/io/PrintStream;
-   34:  aload_2
-   35:  invokevirtual   #8; //Method java/io/PrintStream.println:(Ljava/lang/String;)V
-   38:  aload_1
-   39:  invokedynamic   #9,  0; //NameAndType getName:(Ljava/io/File;)Ljava/lang/String;
-   44:  astore_3
-   45:  getstatic       #7; //Field java/lang/System.out:Ljava/io/PrintStream;
-   48:  aload_3
-   49:  invokevirtual   #8; //Method java/io/PrintStream.println:(Ljava/lang/String;)V
-   52:  aload_2
-   53:  invokedynamic   #10,  0; //NameAndType toString:(Ljava/lang/CharSequence;)Ljava/lang/String;
-   58:  astore  4
-   60:  getstatic       #7; //Field java/lang/System.out:Ljava/io/PrintStream;
-   63:  aload   4
-   65:  invokevirtual   #8; //Method java/io/PrintStream.println:(Ljava/lang/String;)V
-   68:  aload_2
-   69:  invokevirtual   #11; //Method java/lang/String.length:()I
-   72:  invokedynamic   #12,  0; //NameAndType "static:java\|lang\|Integer:toHexString":(I)Ljava/lang/String;
-   77:  astore  5
-   79:  getstatic       #7; //Field java/lang/System.out:Ljava/io/PrintStream;
-   82:  aload   4
-   84:  invokevirtual   #8; //Method java/io/PrintStream.println:(Ljava/lang/String;)V
-   87:  return
+  GetNameDemo();
+    Code:
+       0: aload_0       
+       1: invokespecial #1                  // Method java/lang/Object."<init>":()V
+       4: return        
 
+  public static void main(java.lang.String...) throws java.lang.Throwable;
+    Code:
+       0: aload_0       
+       1: arraylength   
+       2: ifne          15
+       5: iconst_1      
+       6: anewarray     #2                  // class java/lang/String
+       9: dup           
+      10: iconst_0      
+      11: ldc           #3                  // String fred.txt
+      13: aastore       
+      14: astore_0      
+      15: new           #4                  // class java/io/File
+      18: dup           
+      19: aload_0       
+      20: iconst_0      
+      21: aaload        
+      22: invokespecial #5                  // Method java/io/File."<init>":(Ljava/lang/String;)V
+      25: astore_1      
+      26: iconst_0      
+      27: istore_2      
+      28: iload_2       
+      29: iconst_3      
+      30: if_icmpge     130
+      33: getstatic     #6                  // Field java/lang/System.out:Ljava/io/PrintStream;
+      36: new           #7                  // class java/lang/StringBuilder
+      39: dup           
+      40: invokespecial #8                  // Method java/lang/StringBuilder."<init>":()V
+      43: ldc           #9                  // String --- loop #
+      45: invokevirtual #10                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
+      48: iload_2       
+      49: invokevirtual #11                 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
+      52: invokevirtual #12                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
+      55: invokevirtual #13                 // Method java/io/PrintStream.println:(Ljava/lang/String;)V
+      58: aload_1       
+      59: invokevirtual #14                 // Method java/io/File.getName:()Ljava/lang/String;
+      62: astore_3      
+      63: getstatic     #6                  // Field java/lang/System.out:Ljava/io/PrintStream;
+      66: aload_3       
+      67: invokevirtual #13                 // Method java/io/PrintStream.println:(Ljava/lang/String;)V
+      70: aload_1       
+      71: invokedynamic #260,  0            // InvokeDynamic getName:(Ljava/io/File;)Ljava/lang/String; {bootstrap=invokeStatic GetNameDemo.bootstrapDynamic:(Ljava/dyn/MethodHandles$Lookup;Ljava/lang/String;Ljava/dyn/MethodType;)Ljava/dyn/CallSite;}
+      76: nop           
+      77: astore        4
+      79: getstatic     #6                  // Field java/lang/System.out:Ljava/io/PrintStream;
+      82: aload         4
+      84: invokevirtual #13                 // Method java/io/PrintStream.println:(Ljava/lang/String;)V
+      87: aload_3       
+      88: invokedynamic #264,  0            // InvokeDynamic toString:(Ljava/lang/CharSequence;)Ljava/lang/String; {bootstrap=invokeStatic GetNameDemo.bootstrapDynamic:(Ljava/dyn/MethodHandles$Lookup;Ljava/lang/String;Ljava/dyn/MethodType;)Ljava/dyn/CallSite;}
+      93: nop           
+      94: astore        5
+      96: getstatic     #6                  // Field java/lang/System.out:Ljava/io/PrintStream;
+      99: aload         5
+     101: invokevirtual #13                 // Method java/io/PrintStream.println:(Ljava/lang/String;)V
+     104: aload_3       
+     105: invokevirtual #20                 // Method java/lang/String.length:()I
+     108: invokedynamic #268,  0            // InvokeDynamic "static:\\=java\\|lang\\|Integer:toHexString":(I)Ljava/lang/String; {bootstrap=invokeStatic GetNameDemo.bootstrapDynamic:(Ljava/dyn/MethodHandles$Lookup;Ljava/lang/String;Ljava/dyn/MethodType;)Ljava/dyn/CallSite;}
+     113: nop           
+     114: astore        6
+     116: getstatic     #6                  // Field java/lang/System.out:Ljava/io/PrintStream;
+     119: aload         6
+     121: invokevirtual #13                 // Method java/io/PrintStream.println:(Ljava/lang/String;)V
+     124: iinc          2, 1
+     127: goto          28
+     130: return        
+
+  static {};
+    Code:
+       0: iconst_3      
+       1: anewarray     #74                 // class java/dyn/MethodHandle
+       4: putstatic     #22                 // Field INDY_CACHES:[Ljava/dyn/MethodHandle;
+       7: return        
 }
-
 --------
  */