Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Sinking Your Teeth Into Bytecode (Droidcon UK 2...

Sinking Your Teeth Into Bytecode (Droidcon UK 2017)

NOTE: SpeakerDeck is rendering light grays in this presentation improperly. Until they correct it, see https://photos.app.goo.gl/EKB9O10FcgOK0vmF2 for correct rendering.

Bytecode is the first compilation output towards running code on the JVM or Android. During this Keynote talk, Jake will share with you how to read bytecode, understand what it's doing, and make informed decisions as a result. You will compare and contrast examples in Java and Kotlin from the bytecode level to see how they work and their respective costs.

Video: https://skillsmatter.com/skillscasts/10012-a-talk-by-jake-wharton

Jake Wharton

October 27, 2017
Tweet

More Decks by Jake Wharton

Other Decks in Programming

Transcript

  1. "What does type erasure actually look like?" "Is a lambda

    or a method reference more efficient?" "How do lambdas work on old versions of Android?"
  2. "What does type erasure actually look like?" "Is a lambda

    or a method reference more efficient?" "How do lambdas work on old versions of Android?" "Which loop is faster?"
  3. "What does type erasure actually look like?" "Is a lambda

    or a method reference more efficient?" "How do lambdas work on old versions of Android?" "Which loop is faster?" "Is there overhead to Kotlin?"
  4. "What does type erasure actually look like?" "Can I cheat

    at this game?" "Is a lambda or a method reference more efficient?" "How do lambdas work on old versions of Android?" "Which loop is faster?" "Is there overhead to Kotlin?"
  5. "What does type erasure actually look like?" "Can I cheat

    at this game?" "Is a lambda or a method reference more efficient?" "How do lambdas work on old versions of Android?" "F*%K YOU PROGUARD" "Which loop is faster?" "Is there overhead to Kotlin?"
  6. "What does type erasure actually look like?" "How do checked

    vs. unchecked exceptions work?" "Can I cheat at this game?" "Is a lambda or a method reference more efficient?" "How do lambdas work on old versions of Android?" "F*%K YOU PROGUARD" "Which loop is faster?" "Is there overhead to Kotlin?"
  7. "What does type erasure actually look like?" "How do checked

    vs. unchecked exceptions work?" "Can I cheat at this game?" "Is a lambda or a method reference more efficient?" "How do lambdas work on old versions of Android?" "F*%K YOU PROGUARD" "Which loop is faster?" "How does synchronized work?" "Is there overhead to Kotlin?"
  8. "What does type erasure actually look like?" "How do checked

    vs. unchecked exceptions work?" "Can I cheat at this game?" "Is a lambda or a method reference more efficient?" "How do lambdas work on old versions of Android?" "F*%K YOU PROGUARD" "Which loop is faster?" "How does synchronized work?" "Is there overhead to Kotlin?"
  9. $ cat Print.java public class Print { public static void

    main(String[] args) { for (int i = 0; i < 10; i++) { System.out.println("Hello"); } } }
  10. $ cat Print.java public class Print { public static void

    main(String[] args) { for (int i = 0; i < 10; i++) { System.out.println("Hello"); } } } $ javac Print.java
  11. $ cat Print.java public class Print { public static void

    main(String[] args) { for (int i = 0; i < 10; i++) { System.out.println("Hello"); }X }Y }Z $ javac Print.java $ java Print
  12. public class Print { public static void main(String[] args) {

    for (int i = 0; i < 10; i++) { System.out.println("Hello"); }X }Y }Z $ javac Print.java $ java Print Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello
  13. $ javap Print Compiled from "Print.java" public class Print {

    public Print(); public static void main(java.lang.String[]); }
  14. $ javap -c Print Compiled from "Print.java" public class Print

    { public Print(); Code: 0: aload_0 1: invokespecial #1 // Method java/lang/Object."<init>":()V 4: return public static void main(java.lang.String[]); Code: 0: iconst_0 1: istore_1 2: iload_1 3: bipush 10 5: if_icmpge 22 8: getstatic #2 // Field java/lang/System.out:Ljava/io/PrintStream; 11: ldc #3 // String Hello 13: invokevirtual #4 // Method java/io/PrintStream.println:(Ljava/lang/String;)V 16: iinc 1, 1 19: goto 2 22: return }
  15. $ javap -v Print Classfile /Users/jw/Desktop/bytecodes/Print.class Last modified Oct 18,

    2017; size 462 bytes MD5 checksum cf33844b3ed95ff736b59ba4b8417a0c Compiled from "Print.java" public class Print minor version: 0 major version: 52 flags: ACC_PUBLIC, ACC_SUPER Constant pool: #1 = Methodref #6.#16 // java/lang/Object."<init>":()V #2 = Fieldref #17.#18 // java/lang/System.out:Ljava/io/PrintStream; #3 = String #19 // Hello #4 = Methodref #20.#21 // java/io/PrintStream.println:(Ljava/lang/String;)V #5 = Class #22 // Print #6 = Class #23 // java/lang/Object #7 = Utf8 <init> #8 = Utf8 ()V #9 = Utf8 Code #10 = Utf8 LineNumberTable #11 = Utf8 main #12 = Utf8 ([Ljava/lang/String;)V #13 = Utf8 StackMapTable #14 = Utf8 SourceFile #15 = Utf8 Print.java #16 = NameAndType #7:#8 // "<init>":()V #17 = Class #24 // java/lang/System #18 = NameAndType #25:#26 // out:Ljava/io/PrintStream; #19 = Utf8 Hello #20 = Class #27 // java/io/PrintStream #21 = NameAndType #28:#29 // println:(Ljava/lang/String;)V #22 = Utf8 Print #23 = Utf8 java/lang/Object #24 = Utf8 java/lang/System #25 = Utf8 out #26 = Utf8 Ljava/io/PrintStream; #27 = Utf8 java/io/PrintStream #28 = Utf8 println #29 = Utf8 (Ljava/lang/String;)V { public Print(); descriptor: ()V flags: ACC_PUBLIC Code: stack=1, locals=1, args_size=1 0: aload_0 1: invokespecial #1 // Method java/lang/Object."<init>":()V 4: return LineNumberTable: line 1: 0 frame_type = 252 /* append */ offset_delta = 2 locals = [ int ] frame_type = 250 /* chop */ offset_delta = 19 } SourceFile: "Print.java" public static void main(java.lang.String[]); descriptor: ([Ljava/lang/String;)V flags: ACC_PUBLIC, ACC_STATIC Code: stack=2, locals=2, args_size=1 0: iconst_0 1: istore_1 2: iload_1 3: bipush 10 5: if_icmpge 22 8: getstatic #2 // Field java/lang/System.out:Ljava/io/PrintStream; 11: ldc #3 // String Hello 13: invokevirtual #4 // Method java/io/PrintStream.println:(Ljava/lang/String;)V 16: iinc 1, 1 19: goto 2 22: return LineNumberTable: line 3: 0 line 4: 8 line 3: 16 line 6: 22 StackMapTable: number_of_entries = 2 <snipped>
  16. public static void main(java.lang.String[]); descriptor: ([Ljava/lang/String;)V flags: ACC_PUBLIC, ACC_STATIC Code:

    stack=2, locals=2, args_size=1 0: iconst_0 1: istore_1 2: iload_1 3: bipush 10 5: if_icmpge 22 8: getstatic #2 // Field java/lang/System.out:Ljava/io/PrintStream; 11: ldc #3 // String Hello 13: invokevirtual #4 // Method java/io/PrintStream.println:(Ljava/lang/String;)V 16: iinc 1, 1 19: goto 2 22: return LineNumberTable: line 3: 0 line 4: 8 line 3: 16 line 6: 22 StackMapTable: number_of_entries = 2 <snipped>
  17. public static void main(java.lang.String[]); descriptor: ([Ljava/lang/String;)V flags: ACC_PUBLIC, ACC_STATIC Code:

    stack=2, locals=2, args_size=1 0: iconst_0 1: istore_1 2: iload_1 3: bipush 10 5: if_icmpge 22 8: getstatic #2 // Field java/lang/System.out:Ljava/io/PrintStream; 11: ldc #3 // String Hello 13: invokevirtual #4 // Method java/io/PrintStream.println:(Ljava/lang/String;)V 16: iinc 1, 1 19: goto 2 22: return LineNumberTable: line 3: 0 line 4: 8 line 3: 16 line 6: 22 StackMapTable: number_of_entries = 2 <snipped>
  18. stack=2, locals=2 public static void main(java.lang.String[]); 0: iconst_0 1: istore_1

    2: iload_1 3: bipush 10 5: if_icmpge 22 8: getstatic #2 // Field java/lang/System.out:Ljava/io/PrintStream; 11: ldc #3 // String Hello 13: invokevirtual #4 // Method java/io/PrintStream.println:(Ljava/lang/String;)V 16: iinc 1, 1 19: goto 2 22: return
  19. public static void main(java.lang.String[]); 0: iconst_0 1: istore_1 2: iload_1

    3: bipush 10 5: if_icmpge 22 8: getstatic #2 // Field java/lang/System.out:Ljava/io/PrintStream; 11: ldc #3 // String Hello 13: invokevirtual #4 // Method java/io/PrintStream.println:(Ljava/lang/String;)V 16: iinc 1, 1 19: goto 2 22: return 0 1 locals stack
  20. public static void main(java.lang.String[]); 0: iconst_0 1: istore_1 2: iload_1

    3: bipush 10 5: if_icmpge 22 8: getstatic #2 // Field java/lang/System.out:Ljava/io/PrintStream; 11: ldc #3 // String Hello 13: invokevirtual #4 // Method java/io/PrintStream.println:(Ljava/lang/String;)V 16: iinc 1, 1 19: goto 2 22: return 0 1 locals stack
  21. public static void main(java.lang.String[]); 0: iconst_0 1: istore_1 2: iload_1

    3: bipush 10 5: if_icmpge 22 8: getstatic #2 // Field java/lang/System.out:Ljava/io/PrintStream; 11: ldc #3 // String Hello 13: invokevirtual #4 // Method java/io/PrintStream.println:(Ljava/lang/String;)V 16: iinc 1, 1 19: goto 2 22: return 0 1 locals stack String[]
  22. public static void main(java.lang.String[]); 0: iconst_0 1: istore_1 2: iload_1

    3: bipush 10 5: if_icmpge 22 8: getstatic #2 // Field java/lang/System.out:Ljava/io/PrintStream; 11: ldc #3 // String Hello 13: invokevirtual #4 // Method java/io/PrintStream.println:(Ljava/lang/String;)V 16: iinc 1, 1 19: goto 2 22: return 0 1 locals stack String[]
  23. public static void main(java.lang.String[]); 0: iconst_0 1: istore_1 2: iload_1

    3: bipush 10 5: if_icmpge 22 8: getstatic #2 // Field java/lang/System.out:Ljava/io/PrintStream; 11: ldc #3 // String Hello 13: invokevirtual #4 // Method java/io/PrintStream.println:(Ljava/lang/String;)V 16: iinc 1, 1 19: goto 2 22: return 0 1 locals stack String[] iconst_0
  24. public static void main(java.lang.String[]); 0: iconst_0 1: istore_1 2: iload_1

    3: bipush 10 5: if_icmpge 22 8: getstatic #2 // Field java/lang/System.out:Ljava/io/PrintStream; 11: ldc #3 // String Hello 13: invokevirtual #4 // Method java/io/PrintStream.println:(Ljava/lang/String;)V 16: iinc 1, 1 19: goto 2 22: return 0 1 locals stack String[] iconst_0
  25. public static void main(java.lang.String[]); 0: iconst_0 1: istore_1 2: iload_1

    3: bipush 10 5: if_icmpge 22 8: getstatic #2 // Field java/lang/System.out:Ljava/io/PrintStream; 11: ldc #3 // String Hello 13: invokevirtual #4 // Method java/io/PrintStream.println:(Ljava/lang/String;)V 16: iinc 1, 1 19: goto 2 22: return 0 1 locals stack String[] iconst_0 int constant 0
  26. public static void main(java.lang.String[]); 0: iconst_0 1: istore_1 2: iload_1

    3: bipush 10 5: if_icmpge 22 8: getstatic #2 // Field java/lang/System.out:Ljava/io/PrintStream; 11: ldc #3 // String Hello 13: invokevirtual #4 // Method java/io/PrintStream.println:(Ljava/lang/String;)V 16: iinc 1, 1 19: goto 2 22: return 0 1 locals stack String[] iconst_0 0
  27. public static void main(java.lang.String[]); 0: iconst_0 1: istore_1 2: iload_1

    3: bipush 10 5: if_icmpge 22 8: getstatic #2 // Field java/lang/System.out:Ljava/io/PrintStream; 11: ldc #3 // String Hello 13: invokevirtual #4 // Method java/io/PrintStream.println:(Ljava/lang/String;)V 16: iinc 1, 1 19: goto 2 22: return 0 1 locals stack String[] 0 iconst_0
  28. public static void main(java.lang.String[]); 0: iconst_0 1: istore_1 2: iload_1

    3: bipush 10 5: if_icmpge 22 8: getstatic #2 // Field java/lang/System.out:Ljava/io/PrintStream; 11: ldc #3 // String Hello 13: invokevirtual #4 // Method java/io/PrintStream.println:(Ljava/lang/String;)V 16: iinc 1, 1 19: goto 2 22: return 0 1 locals stack String[] 0 iconst_0
  29. public static void main(java.lang.String[]); 0: iconst_0 1: istore_1 2: iload_1

    3: bipush 10 5: if_icmpge 22 8: getstatic #2 // Field java/lang/System.out:Ljava/io/PrintStream; 11: ldc #3 // String Hello 13: invokevirtual #4 // Method java/io/PrintStream.println:(Ljava/lang/String;)V 16: iinc 1, 1 19: goto 2 22: return 0 1 locals stack String[] 0
  30. public static void main(java.lang.String[]); 0: iconst_0 1: istore_1 2: iload_1

    3: bipush 10 5: if_icmpge 22 8: getstatic #2 // Field java/lang/System.out:Ljava/io/PrintStream; 11: ldc #3 // String Hello 13: invokevirtual #4 // Method java/io/PrintStream.println:(Ljava/lang/String;)V 16: iinc 1, 1 19: goto 2 22: return 0 1 locals stack String[] 0 istore_1
  31. public static void main(java.lang.String[]); 0: iconst_0 1: istore_1 2: iload_1

    3: bipush 10 5: if_icmpge 22 8: getstatic #2 // Field java/lang/System.out:Ljava/io/PrintStream; 11: ldc #3 // String Hello 13: invokevirtual #4 // Method java/io/PrintStream.println:(Ljava/lang/String;)V 16: iinc 1, 1 19: goto 2 22: return 0 1 locals stack String[] 0 istore_1
  32. public static void main(java.lang.String[]); 0: iconst_0 1: istore_1 2: iload_1

    3: bipush 10 5: if_icmpge 22 8: getstatic #2 // Field java/lang/System.out:Ljava/io/PrintStream; 11: ldc #3 // String Hello 13: invokevirtual #4 // Method java/io/PrintStream.println:(Ljava/lang/String;)V 16: iinc 1, 1 19: goto 2 22: return 0 1 locals stack String[] 0 istore_1 int store into local slot 1
  33. public static void main(java.lang.String[]); 0: iconst_0 1: istore_1 2: iload_1

    3: bipush 10 5: if_icmpge 22 8: getstatic #2 // Field java/lang/System.out:Ljava/io/PrintStream; 11: ldc #3 // String Hello 13: invokevirtual #4 // Method java/io/PrintStream.println:(Ljava/lang/String;)V 16: iinc 1, 1 19: goto 2 22: return 0 1 locals stack String[] 0 istore_1
  34. public static void main(java.lang.String[]); 0: iconst_0 1: istore_1 2: iload_1

    3: bipush 10 5: if_icmpge 22 8: getstatic #2 // Field java/lang/System.out:Ljava/io/PrintStream; 11: ldc #3 // String Hello 13: invokevirtual #4 // Method java/io/PrintStream.println:(Ljava/lang/String;)V 16: iinc 1, 1 19: goto 2 22: return 0 1 locals stack String[] 0 istore_1
  35. public static void main(java.lang.String[]); 0: iconst_0 1: istore_1 2: iload_1

    3: bipush 10 5: if_icmpge 22 8: getstatic #2 // Field java/lang/System.out:Ljava/io/PrintStream; 11: ldc #3 // String Hello 13: invokevirtual #4 // Method java/io/PrintStream.println:(Ljava/lang/String;)V 16: iinc 1, 1 19: goto 2 22: return 0 1 locals stack String[] 0 istore_1
  36. public static void main(java.lang.String[]); 0: iconst_0 1: istore_1 2: iload_1

    3: bipush 10 5: if_icmpge 22 8: getstatic #2 // Field java/lang/System.out:Ljava/io/PrintStream; 11: ldc #3 // String Hello 13: invokevirtual #4 // Method java/io/PrintStream.println:(Ljava/lang/String;)V 16: iinc 1, 1 19: goto 2 22: return 0 1 locals stack String[] 0
  37. public static void main(java.lang.String[]); 0: iconst_0 1: istore_1 2: iload_1

    3: bipush 10 5: if_icmpge 22 8: getstatic #2 // Field java/lang/System.out:Ljava/io/PrintStream; 11: ldc #3 // String Hello 13: invokevirtual #4 // Method java/io/PrintStream.println:(Ljava/lang/String;)V 16: iinc 1, 1 19: goto 2 22: return 0 1 locals stack String[] 0 iload_1
  38. public static void main(java.lang.String[]); 0: iconst_0 1: istore_1 2: iload_1

    3: bipush 10 5: if_icmpge 22 8: getstatic #2 // Field java/lang/System.out:Ljava/io/PrintStream; 11: ldc #3 // String Hello 13: invokevirtual #4 // Method java/io/PrintStream.println:(Ljava/lang/String;)V 16: iinc 1, 1 19: goto 2 22: return 0 1 locals stack String[] 0 iload_1
  39. public static void main(java.lang.String[]); 0: iconst_0 1: istore_1 2: iload_1

    3: bipush 10 5: if_icmpge 22 8: getstatic #2 // Field java/lang/System.out:Ljava/io/PrintStream; 11: ldc #3 // String Hello 13: invokevirtual #4 // Method java/io/PrintStream.println:(Ljava/lang/String;)V 16: iinc 1, 1 19: goto 2 22: return 0 1 locals stack String[] 0 iload_1 0
  40. public static void main(java.lang.String[]); 0: iconst_0 1: istore_1 2: iload_1

    3: bipush 10 5: if_icmpge 22 8: getstatic #2 // Field java/lang/System.out:Ljava/io/PrintStream; 11: ldc #3 // String Hello 13: invokevirtual #4 // Method java/io/PrintStream.println:(Ljava/lang/String;)V 16: iinc 1, 1 19: goto 2 22: return 0 1 locals stack String[] 0 iload_1 0
  41. public static void main(java.lang.String[]); 0: iconst_0 1: istore_1 2: iload_1

    3: bipush 10 5: if_icmpge 22 8: getstatic #2 // Field java/lang/System.out:Ljava/io/PrintStream; 11: ldc #3 // String Hello 13: invokevirtual #4 // Method java/io/PrintStream.println:(Ljava/lang/String;)V 16: iinc 1, 1 19: goto 2 22: return 0 1 locals stack String[] 0 iload_1 0
  42. public static void main(java.lang.String[]); 0: iconst_0 1: istore_1 2: iload_1

    3: bipush 10 5: if_icmpge 22 8: getstatic #2 // Field java/lang/System.out:Ljava/io/PrintStream; 11: ldc #3 // String Hello 13: invokevirtual #4 // Method java/io/PrintStream.println:(Ljava/lang/String;)V 16: iinc 1, 1 19: goto 2 22: return 0 1 locals stack String[] 0 0
  43. public static void main(java.lang.String[]); 0: iconst_0 1: istore_1 2: iload_1

    3: bipush 10 5: if_icmpge 22 8: getstatic #2 // Field java/lang/System.out:Ljava/io/PrintStream; 11: ldc #3 // String Hello 13: invokevirtual #4 // Method java/io/PrintStream.println:(Ljava/lang/String;)V 16: iinc 1, 1 19: goto 2 22: return 0 1 locals stack String[] 0 0 bipush 10
  44. public static void main(java.lang.String[]); 0: iconst_0 1: istore_1 2: iload_1

    3: bipush 10 5: if_icmpge 22 8: getstatic #2 // Field java/lang/System.out:Ljava/io/PrintStream; 11: ldc #3 // String Hello 13: invokevirtual #4 // Method java/io/PrintStream.println:(Ljava/lang/String;)V 16: iinc 1, 1 19: goto 2 22: return 0 1 locals stack String[] 0 0 bipush 10
  45. public static void main(java.lang.String[]); 0: iconst_0 1: istore_1 2: iload_1

    3: bipush 10 5: if_icmpge 22 8: getstatic #2 // Field java/lang/System.out:Ljava/io/PrintStream; 11: ldc #3 // String Hello 13: invokevirtual #4 // Method java/io/PrintStream.println:(Ljava/lang/String;)V 16: iinc 1, 1 19: goto 2 22: return 0 1 locals stack String[] 0 0 bipush 10 byte as int push 10
  46. public static void main(java.lang.String[]); 0: iconst_0 1: istore_1 2: iload_1

    3: bipush 10 5: if_icmpge 22 8: getstatic #2 // Field java/lang/System.out:Ljava/io/PrintStream; 11: ldc #3 // String Hello 13: invokevirtual #4 // Method java/io/PrintStream.println:(Ljava/lang/String;)V 16: iinc 1, 1 19: goto 2 22: return 0 1 locals stack String[] 0 0 bipush 10 10
  47. public static void main(java.lang.String[]); 0: iconst_0 1: istore_1 2: iload_1

    3: bipush 10 5: if_icmpge 22 8: getstatic #2 // Field java/lang/System.out:Ljava/io/PrintStream; 11: ldc #3 // String Hello 13: invokevirtual #4 // Method java/io/PrintStream.println:(Ljava/lang/String;)V 16: iinc 1, 1 19: goto 2 22: return 0 1 locals stack String[] 0 0 bipush 10 10
  48. public static void main(java.lang.String[]); 0: iconst_0 1: istore_1 2: iload_1

    3: bipush 10 5: if_icmpge 22 8: getstatic #2 // Field java/lang/System.out:Ljava/io/PrintStream; 11: ldc #3 // String Hello 13: invokevirtual #4 // Method java/io/PrintStream.println:(Ljava/lang/String;)V 16: iinc 1, 1 19: goto 2 22: return 0 1 locals stack String[] 0 0 bipush 10 10
  49. public static void main(java.lang.String[]); 0: iconst_0 1: istore_1 2: iload_1

    3: bipush 10 5: if_icmpge 22 8: getstatic #2 // Field java/lang/System.out:Ljava/io/PrintStream; 11: ldc #3 // String Hello 13: invokevirtual #4 // Method java/io/PrintStream.println:(Ljava/lang/String;)V 16: iinc 1, 1 19: goto 2 22: return 0 1 locals stack String[] 0 0 10
  50. public static void main(java.lang.String[]); 0: iconst_0 1: istore_1 2: iload_1

    3: bipush 10 5: if_icmpge 22 8: getstatic #2 // Field java/lang/System.out:Ljava/io/PrintStream; 11: ldc #3 // String Hello 13: invokevirtual #4 // Method java/io/PrintStream.println:(Ljava/lang/String;)V 16: iinc 1, 1 19: goto 2 22: return 0 1 locals stack String[] 0 0 10 if_icmpge 22
  51. public static void main(java.lang.String[]); 0: iconst_0 1: istore_1 2: iload_1

    3: bipush 10 5: if_icmpge 22 8: getstatic #2 // Field java/lang/System.out:Ljava/io/PrintStream; 11: ldc #3 // String Hello 13: invokevirtual #4 // Method java/io/PrintStream.println:(Ljava/lang/String;)V 16: iinc 1, 1 19: goto 2 22: return 0 1 locals stack String[] 0 0 10 if_icmpge 22
  52. public static void main(java.lang.String[]); 0: iconst_0 1: istore_1 2: iload_1

    3: bipush 10 5: if_icmpge 22 8: getstatic #2 // Field java/lang/System.out:Ljava/io/PrintStream; 11: ldc #3 // String Hello 13: invokevirtual #4 // Method java/io/PrintStream.println:(Ljava/lang/String;)V 16: iinc 1, 1 19: goto 2 22: return 0 1 locals stack String[] 0 0 10 if_icmpge 22 if int compare greater-than or equal to then jump to bytecode 22
  53. public static void main(java.lang.String[]); 0: iconst_0 1: istore_1 2: iload_1

    3: bipush 10 5: if_icmpge 22 8: getstatic #2 // Field java/lang/System.out:Ljava/io/PrintStream; 11: ldc #3 // String Hello 13: invokevirtual #4 // Method java/io/PrintStream.println:(Ljava/lang/String;)V 16: iinc 1, 1 19: goto 2 22: return 0 1 locals stack String[] 0 0 10 if_icmpge 22 if int compare greater-than or equal to then jump to bytecode 22
  54. public static void main(java.lang.String[]); 0: iconst_0 1: istore_1 2: iload_1

    3: bipush 10 5: if_icmpge 22 8: getstatic #2 // Field java/lang/System.out:Ljava/io/PrintStream; 11: ldc #3 // String Hello 13: invokevirtual #4 // Method java/io/PrintStream.println:(Ljava/lang/String;)V 16: iinc 1, 1 19: goto 2 22: return 0 1 locals stack String[] 0 0 10 if_icmpge 22
  55. public static void main(java.lang.String[]); 0: iconst_0 1: istore_1 2: iload_1

    3: bipush 10 5: if_icmpge 22 8: getstatic #2 // Field java/lang/System.out:Ljava/io/PrintStream; 11: ldc #3 // String Hello 13: invokevirtual #4 // Method java/io/PrintStream.println:(Ljava/lang/String;)V 16: iinc 1, 1 19: goto 2 22: return 0 1 locals stack String[] 0 0 10 if_icmpge 22
  56. public static void main(java.lang.String[]); 0: iconst_0 1: istore_1 2: iload_1

    3: bipush 10 5: if_icmpge 22 8: getstatic #2 // Field java/lang/System.out:Ljava/io/PrintStream; 11: ldc #3 // String Hello 13: invokevirtual #4 // Method java/io/PrintStream.println:(Ljava/lang/String;)V 16: iinc 1, 1 19: goto 2 22: return 0 1 locals stack String[] 0 0 10 if_icmpge 22
  57. public static void main(java.lang.String[]); 0: iconst_0 1: istore_1 2: iload_1

    3: bipush 10 5: if_icmpge 22 8: getstatic #2 // Field java/lang/System.out:Ljava/io/PrintStream; 11: ldc #3 // String Hello 13: invokevirtual #4 // Method java/io/PrintStream.println:(Ljava/lang/String;)V 16: iinc 1, 1 19: goto 2 22: return 0 1 locals stack String[] 0 0 10 if_icmpge 22
  58. public static void main(java.lang.String[]); 0: iconst_0 1: istore_1 2: iload_1

    3: bipush 10 5: if_icmpge 22 8: getstatic #2 // Field java/lang/System.out:Ljava/io/PrintStream; 11: ldc #3 // String Hello 13: invokevirtual #4 // Method java/io/PrintStream.println:(Ljava/lang/String;)V 16: iinc 1, 1 19: goto 2 22: return 0 1 locals stack String[] 0 0 10 if_icmpge 22
  59. public static void main(java.lang.String[]); 0: iconst_0 1: istore_1 2: iload_1

    3: bipush 10 5: if_icmpge 22 8: getstatic #2 // Field java/lang/System.out:Ljava/io/PrintStream; 11: ldc #3 // String Hello 13: invokevirtual #4 // Method java/io/PrintStream.println:(Ljava/lang/String;)V 16: iinc 1, 1 19: goto 2 22: return 0 1 locals stack String[] 0 0 >= 10 if_icmpge 22
  60. public static void main(java.lang.String[]); 0: iconst_0 1: istore_1 2: iload_1

    3: bipush 10 5: if_icmpge 22 8: getstatic #2 // Field java/lang/System.out:Ljava/io/PrintStream; 11: ldc #3 // String Hello 13: invokevirtual #4 // Method java/io/PrintStream.println:(Ljava/lang/String;)V 16: iinc 1, 1 19: goto 2 22: return 0 1 locals stack String[] 0
  61. public static void main(java.lang.String[]); 0: iconst_0 1: istore_1 2: iload_1

    3: bipush 10 5: if_icmpge 22 8: getstatic #2 // Field java/lang/System.out:Ljava/io/PrintStream; 11: ldc #3 // String Hello 13: invokevirtual #4 // Method java/io/PrintStream.println:(Ljava/lang/String;)V 16: iinc 1, 1 19: goto 2 22: return 0 1 locals stack String[] 0 getstatic #2
  62. $ javap -v Print Classfile /Users/jw/Desktop/bytecodes/Print.class Last modified Oct 18,

    2017; size 462 bytes MD5 checksum cf33844b3ed95ff736b59ba4b8417a0c Compiled from "Print.java" public class Print minor version: 0 major version: 52 flags: ACC_PUBLIC, ACC_SUPER { public Print(); descriptor: ()V flags: ACC_PUBLIC Code: stack=1, locals=1, args_size=1 0: aload_0 1: invokespecial #1 // Method java/lang/Object."<init>":()V 4: return LineNumberTable: line 1: 0 public static void main(java.lang.String[]); descriptor: ([Ljava/lang/String;)V flags: ACC_PUBLIC, ACC_STATIC Code: stack=2, locals=2, args_size=1 0: iconst_0 1: istore_1 2: iload_1 3: bipush 10 5: if_icmpge 22 8: getstatic #2 // Field java/lang/System.out:Ljava/io/PrintStream; 11: ldc #3 // String Hello 13: invokevirtual #4 // Method java/io/PrintStream.println:(Ljava/lang/String;)V 16: iinc 1, 1 19: goto 2 22: return LineNumberTable: line 3: 0 line 4: 8 line 3: 16 line 6: 22 StackMapTable: number_of_entries = 2 frame_type = 252 /* append */ offset_delta = 2 locals = [ int ] frame_type = 250 /* chop */ offset_delta = 19 } SourceFile: "Print.java" getstatic #2 Constant pool: #1 = Methodref #6.#16 // java/lang/Object."<init>":()V #2 = Fieldref #17.#18 // java/lang/System.out:Ljava/io/PrintStream; #3 = String #19 // Hello #4 = Methodref #20.#21 // java/io/PrintStream.println:(Ljava/lang/String;)V #5 = Class #22 // Print #6 = Class #23 // java/lang/Object #7 = Utf8 <init> #8 = Utf8 ()V #9 = Utf8 Code #10 = Utf8 LineNumberTable #11 = Utf8 main #12 = Utf8 ([Ljava/lang/String;)V #13 = Utf8 StackMapTable #14 = Utf8 SourceFile #15 = Utf8 Print.java #16 = NameAndType #7:#8 // "<init>":()V #17 = Class #24 // java/lang/System #18 = NameAndType #25:#26 // out:Ljava/io/PrintStream; #19 = Utf8 Hello #20 = Class #27 // java/io/PrintStream #21 = NameAndType #28:#29 // println:(Ljava/lang/String;)V #22 = Utf8 Print #23 = Utf8 java/lang/Object #24 = Utf8 java/lang/System #25 = Utf8 out #26 = Utf8 Ljava/io/PrintStream; #27 = Utf8 java/io/PrintStream #28 = Utf8 println #29 = Utf8 (Ljava/lang/String;)V
  63. Constant pool: #1 = Methodref #6.#16 // java/lang/Object."<init>":()V #2 =

    Fieldref #17.#18 // java/lang/System.out:Ljava/io/PrintStream; #3 = String #19 // Hello #4 = Methodref #20.#21 // java/io/PrintStream.println:(Ljava/lang/String;)V #5 = Class #22 // Print #6 = Class #23 // java/lang/Object #7 = Utf8 <init> #8 = Utf8 ()V #9 = Utf8 Code #10 = Utf8 LineNumberTable #11 = Utf8 main #12 = Utf8 ([Ljava/lang/String;)V #13 = Utf8 StackMapTable #14 = Utf8 SourceFile #15 = Utf8 Print.java #16 = NameAndType #7:#8 // "<init>":()V #17 = Class #24 // java/lang/System #18 = NameAndType #25:#26 // out:Ljava/io/PrintStream; #19 = Utf8 Hello #20 = Class #27 // java/io/PrintStream #21 = NameAndType #28:#29 // println:(Ljava/lang/String;)V #22 = Utf8 Print #23 = Utf8 java/lang/Object #24 = Utf8 java/lang/System #25 = Utf8 out #26 = Utf8 Ljava/io/PrintStream; #27 = Utf8 java/io/PrintStream #28 = Utf8 println #29 = Utf8 (Ljava/lang/String;)V getstatic #2
  64. Constant pool: #1 = Methodref #6.#16 // java/lang/Object."<init>":()V #2 =

    Fieldref #17.#18 // java/lang/System.out:Ljava/io/PrintStream; #3 = String #19 // Hello #4 = Methodref #20.#21 // java/io/PrintStream.println:(Ljava/lang/String;)V #5 = Class #22 // Print #6 = Class #23 // java/lang/Object #7 = Utf8 <init> #8 = Utf8 ()V #9 = Utf8 Code #10 = Utf8 LineNumberTable #11 = Utf8 main #12 = Utf8 ([Ljava/lang/String;)V #13 = Utf8 StackMapTable #14 = Utf8 SourceFile #15 = Utf8 Print.java #16 = NameAndType #7:#8 // "<init>":()V #17 = Class #24 // java/lang/System #18 = NameAndType #25:#26 // out:Ljava/io/PrintStream; #19 = Utf8 Hello #20 = Class #27 // java/io/PrintStream #21 = NameAndType #28:#29 // println:(Ljava/lang/String;)V #22 = Utf8 Print #23 = Utf8 java/lang/Object #24 = Utf8 java/lang/System #25 = Utf8 out #26 = Utf8 Ljava/io/PrintStream; #27 = Utf8 java/io/PrintStream #28 = Utf8 println #29 = Utf8 (Ljava/lang/String;)V getstatic #2
  65. Constant pool: #1 = Methodref #6.#16 // java/lang/Object."<init>":()V #2 =

    Fieldref #17.#18 // java/lang/System.out:Ljava/io/PrintStream; #3 = String #19 // Hello #4 = Methodref #20.#21 // java/io/PrintStream.println:(Ljava/lang/String;)V #5 = Class #22 // Print #6 = Class #23 // java/lang/Object #7 = Utf8 <init> #8 = Utf8 ()V #9 = Utf8 Code #10 = Utf8 LineNumberTable #11 = Utf8 main #12 = Utf8 ([Ljava/lang/String;)V #13 = Utf8 StackMapTable #14 = Utf8 SourceFile #15 = Utf8 Print.java #16 = NameAndType #7:#8 // "<init>":()V #17 = Class #24 // java/lang/System #18 = NameAndType #25:#26 // out:Ljava/io/PrintStream; #19 = Utf8 Hello #20 = Class #27 // java/io/PrintStream #21 = NameAndType #28:#29 // println:(Ljava/lang/String;)V #22 = Utf8 Print #23 = Utf8 java/lang/Object #24 = Utf8 java/lang/System #25 = Utf8 out #26 = Utf8 Ljava/io/PrintStream; #27 = Utf8 java/io/PrintStream #28 = Utf8 println #29 = Utf8 (Ljava/lang/String;)V getstatic #2
  66. Constant pool: #1 = Methodref #6.#16 // java/lang/Object."<init>":()V #2 =

    Fieldref #17.#18 // java/lang/System.out:Ljava/io/PrintStream; #3 = String #19 // Hello #4 = Methodref #20.#21 // java/io/PrintStream.println:(Ljava/lang/String;)V #5 = Class #22 // Print #6 = Class #23 // java/lang/Object #7 = Utf8 <init> #8 = Utf8 ()V #9 = Utf8 Code #10 = Utf8 LineNumberTable #11 = Utf8 main #12 = Utf8 ([Ljava/lang/String;)V #13 = Utf8 StackMapTable #14 = Utf8 SourceFile #15 = Utf8 Print.java #16 = NameAndType #7:#8 // "<init>":()V #17 = Class #24 // java/lang/System #18 = NameAndType #25:#26 // out:Ljava/io/PrintStream; #19 = Utf8 Hello #20 = Class #27 // java/io/PrintStream #21 = NameAndType #28:#29 // println:(Ljava/lang/String;)V #22 = Utf8 Print #23 = Utf8 java/lang/Object #24 = Utf8 java/lang/System #25 = Utf8 out #26 = Utf8 Ljava/io/PrintStream; #27 = Utf8 java/io/PrintStream #28 = Utf8 println #29 = Utf8 (Ljava/lang/String;)V getstatic #2
  67. Constant pool: #1 = Methodref #6.#16 // java/lang/Object."<init>":()V #2 =

    Fieldref #17.#18 // java/lang/System.out:Ljava/io/PrintStream; #3 = String #19 // Hello #4 = Methodref #20.#21 // java/io/PrintStream.println:(Ljava/lang/String;)V #5 = Class #22 // Print #6 = Class #23 // java/lang/Object #7 = Utf8 <init> #8 = Utf8 ()V #9 = Utf8 Code #10 = Utf8 LineNumberTable #11 = Utf8 main #12 = Utf8 ([Ljava/lang/String;)V #13 = Utf8 StackMapTable #14 = Utf8 SourceFile #15 = Utf8 Print.java #16 = NameAndType #7:#8 // "<init>":()V #17 = Class #24 // java/lang/System #18 = NameAndType #25:#26 // out:Ljava/io/PrintStream; #19 = Utf8 Hello #20 = Class #27 // java/io/PrintStream #21 = NameAndType #28:#29 // println:(Ljava/lang/String;)V #22 = Utf8 Print #23 = Utf8 java/lang/Object #24 = Utf8 java/lang/System #25 = Utf8 out #26 = Utf8 Ljava/io/PrintStream; #27 = Utf8 java/io/PrintStream #28 = Utf8 println #29 = Utf8 (Ljava/lang/String;)V getstatic #2
  68. Constant pool: #1 = Methodref #6.#16 // java/lang/Object."<init>":()V #2 =

    Fieldref #17.#18 // java/lang/System.out:Ljava/io/PrintStream; #3 = String #19 // Hello #4 = Methodref #20.#21 // java/io/PrintStream.println:(Ljava/lang/String;)V #5 = Class #22 // Print #6 = Class #23 // java/lang/Object #7 = Utf8 <init> #8 = Utf8 ()V #9 = Utf8 Code #10 = Utf8 LineNumberTable #11 = Utf8 main #12 = Utf8 ([Ljava/lang/String;)V #13 = Utf8 StackMapTable #14 = Utf8 SourceFile #15 = Utf8 Print.java #16 = NameAndType #7:#8 // "<init>":()V #17 = Class #24 // java/lang/System #18 = NameAndType #25:#26 // out:Ljava/io/PrintStream; #19 = Utf8 Hello #20 = Class #27 // java/io/PrintStream #21 = NameAndType #28:#29 // println:(Ljava/lang/String;)V #22 = Utf8 Print #23 = Utf8 java/lang/Object #24 = Utf8 java/lang/System #25 = Utf8 out #26 = Utf8 Ljava/io/PrintStream; #27 = Utf8 java/io/PrintStream #28 = Utf8 println #29 = Utf8 (Ljava/lang/String;)V getstatic #2
  69. Constant pool: #1 = Methodref #6.#16 // java/lang/Object."<init>":()V #2 =

    Fieldref #17.#18 // java/lang/System.out:Ljava/io/PrintStream; #3 = String #19 // Hello #4 = Methodref #20.#21 // java/io/PrintStream.println:(Ljava/lang/String;)V #5 = Class #22 // Print #6 = Class #23 // java/lang/Object #7 = Utf8 <init> #8 = Utf8 ()V #9 = Utf8 Code #10 = Utf8 LineNumberTable #11 = Utf8 main #12 = Utf8 ([Ljava/lang/String;)V #13 = Utf8 StackMapTable #14 = Utf8 SourceFile #15 = Utf8 Print.java #16 = NameAndType #7:#8 // "<init>":()V #17 = Class #24 // java/lang/System #18 = NameAndType #25:#26 // out:Ljava/io/PrintStream; #19 = Utf8 Hello #20 = Class #27 // java/io/PrintStream #21 = NameAndType #28:#29 // println:(Ljava/lang/String;)V #22 = Utf8 Print #23 = Utf8 java/lang/Object #24 = Utf8 java/lang/System #25 = Utf8 out #26 = Utf8 Ljava/io/PrintStream; #27 = Utf8 java/io/PrintStream #28 = Utf8 println #29 = Utf8 (Ljava/lang/String;)V getstatic #2
  70. Constant pool: #1 = Methodref #6.#16 // java/lang/Object."<init>":()V #2 =

    Fieldref #17.#18 // java/lang/System.out:Ljava/io/PrintStream; #3 = String #19 // Hello #4 = Methodref #20.#21 // java/io/PrintStream.println:(Ljava/lang/String;)V #5 = Class #22 // Print #6 = Class #23 // java/lang/Object #7 = Utf8 <init> #8 = Utf8 ()V #9 = Utf8 Code #10 = Utf8 LineNumberTable #11 = Utf8 main #12 = Utf8 ([Ljava/lang/String;)V #13 = Utf8 StackMapTable #14 = Utf8 SourceFile #15 = Utf8 Print.java #16 = NameAndType #7:#8 // "<init>":()V #17 = Class #24 // java/lang/System #18 = NameAndType #25:#26 // out:Ljava/io/PrintStream; #19 = Utf8 Hello #20 = Class #27 // java/io/PrintStream #21 = NameAndType #28:#29 // println:(Ljava/lang/String;)V #22 = Utf8 Print #23 = Utf8 java/lang/Object #24 = Utf8 java/lang/System #25 = Utf8 out #26 = Utf8 Ljava/io/PrintStream; #27 = Utf8 java/io/PrintStream #28 = Utf8 println #29 = Utf8 (Ljava/lang/String;)V getstatic #2
  71. Constant pool: #1 = Methodref #6.#16 // java/lang/Object."<init>":()V #2 =

    Fieldref #17.#18 // java/lang/System.out:Ljava/io/PrintStream; #3 = String #19 // Hello #4 = Methodref #20.#21 // java/io/PrintStream.println:(Ljava/lang/String;)V #5 = Class #22 // Print #6 = Class #23 // java/lang/Object #7 = Utf8 <init> #8 = Utf8 ()V #9 = Utf8 Code #10 = Utf8 LineNumberTable #11 = Utf8 main #12 = Utf8 ([Ljava/lang/String;)V #13 = Utf8 StackMapTable #14 = Utf8 SourceFile #15 = Utf8 Print.java #16 = NameAndType #7:#8 // "<init>":()V #17 = Class #24 // java/lang/System #18 = NameAndType #25:#26 // out:Ljava/io/PrintStream; #19 = Utf8 Hello #20 = Class #27 // java/io/PrintStream #21 = NameAndType #28:#29 // println:(Ljava/lang/String;)V #22 = Utf8 Print #23 = Utf8 java/lang/Object #24 = Utf8 java/lang/System #25 = Utf8 out #26 = Utf8 Ljava/io/PrintStream; #27 = Utf8 java/io/PrintStream #28 = Utf8 println #29 = Utf8 (Ljava/lang/String;)V getstatic #2
  72. Constant pool: #1 = Methodref #6.#16 // java/lang/Object."<init>":()V #2 =

    Fieldref #17.#18 // java/lang/System.out:Ljava/io/PrintStream; #3 = String #19 // Hello #4 = Methodref #20.#21 // java/io/PrintStream.println:(Ljava/lang/String;)V #5 = Class #22 // Print #6 = Class #23 // java/lang/Object #7 = Utf8 <init> #8 = Utf8 ()V #9 = Utf8 Code #10 = Utf8 LineNumberTable #11 = Utf8 main #12 = Utf8 ([Ljava/lang/String;)V #13 = Utf8 StackMapTable #14 = Utf8 SourceFile #15 = Utf8 Print.java #16 = NameAndType #7:#8 // "<init>":()V #17 = Class #24 // java/lang/System #18 = NameAndType #25:#26 // out:Ljava/io/PrintStream; #19 = Utf8 Hello #20 = Class #27 // java/io/PrintStream #21 = NameAndType #28:#29 // println:(Ljava/lang/String;)V #22 = Utf8 Print #23 = Utf8 java/lang/Object #24 = Utf8 java/lang/System #25 = Utf8 out #26 = Utf8 Ljava/io/PrintStream; #27 = Utf8 java/io/PrintStream #28 = Utf8 println #29 = Utf8 (Ljava/lang/String;)V getstatic #2
  73. Constant pool: #1 = Methodref #6.#16 // java/lang/Object."<init>":()V #2 =

    Fieldref #17.#18 // java/lang/System.out:Ljava/io/PrintStream; #3 = String #19 // Hello #4 = Methodref #20.#21 // java/io/PrintStream.println:(Ljava/lang/String;)V #5 = Class #22 // Print #6 = Class #23 // java/lang/Object #7 = Utf8 <init> #8 = Utf8 ()V #9 = Utf8 Code #10 = Utf8 LineNumberTable #11 = Utf8 main #12 = Utf8 ([Ljava/lang/String;)V #13 = Utf8 StackMapTable #14 = Utf8 SourceFile #15 = Utf8 Print.java #16 = NameAndType #7:#8 // "<init>":()V #17 = Class #24 // java/lang/System #18 = NameAndType #25:#26 // out:Ljava/io/PrintStream; #19 = Utf8 Hello #20 = Class #27 // java/io/PrintStream #21 = NameAndType #28:#29 // println:(Ljava/lang/String;)V #22 = Utf8 Print #23 = Utf8 java/lang/Object #24 = Utf8 java/lang/System #25 = Utf8 out #26 = Utf8 Ljava/io/PrintStream; #27 = Utf8 java/io/PrintStream #28 = Utf8 println #29 = Utf8 (Ljava/lang/String;)V getstatic #2
  74. Constant pool: #1 = Methodref #6.#16 // java/lang/Object."<init>":()V #2 =

    Fieldref #17.#18 // java/lang/System.out:Ljava/io/PrintStream; #3 = String #19 // Hello #4 = Methodref #20.#21 // java/io/PrintStream.println:(Ljava/lang/String;)V #5 = Class #22 // Print #6 = Class #23 // java/lang/Object #7 = Utf8 <init> #8 = Utf8 ()V #9 = Utf8 Code #10 = Utf8 LineNumberTable #11 = Utf8 main #12 = Utf8 ([Ljava/lang/String;)V #13 = Utf8 StackMapTable #14 = Utf8 SourceFile #15 = Utf8 Print.java #16 = NameAndType #7:#8 // "<init>":()V #17 = Class #24 // java/lang/System #18 = NameAndType #25:#26 // out:Ljava/io/PrintStream; #19 = Utf8 Hello #20 = Class #27 // java/io/PrintStream #21 = NameAndType #28:#29 // println:(Ljava/lang/String;)V #22 = Utf8 Print #23 = Utf8 java/lang/Object #24 = Utf8 java/lang/System #25 = Utf8 out #26 = Utf8 Ljava/io/PrintStream; #27 = Utf8 java/io/PrintStream #28 = Utf8 println #29 = Utf8 (Ljava/lang/String;)V getstatic #2
  75. public static void main(java.lang.String[]); 0: iconst_0 1: istore_1 2: iload_1

    3: bipush 10 5: if_icmpge 22 8: getstatic #2 // Field java/lang/System.out:Ljava/io/PrintStream; 11: ldc #3 // String Hello 13: invokevirtual #4 // Method java/io/PrintStream.println:(Ljava/lang/String;)V 16: iinc 1, 1 19: goto 2 22: return 0 1 locals stack String[] 0 getstatic #2 (out)
  76. public static void main(java.lang.String[]); 0: iconst_0 1: istore_1 2: iload_1

    3: bipush 10 5: if_icmpge 22 8: getstatic #2 // Field java/lang/System.out:Ljava/io/PrintStream; 11: ldc #3 // String Hello 13: invokevirtual #4 // Method java/io/PrintStream.println:(Ljava/lang/String;)V 16: iinc 1, 1 19: goto 2 22: return 0 1 locals stack String[] 0 getstatic #2 out
  77. public static void main(java.lang.String[]); 0: iconst_0 1: istore_1 2: iload_1

    3: bipush 10 5: if_icmpge 22 8: getstatic #2 // Field java/lang/System.out:Ljava/io/PrintStream; 11: ldc #3 // String Hello 13: invokevirtual #4 // Method java/io/PrintStream.println:(Ljava/lang/String;)V 16: iinc 1, 1 19: goto 2 22: return 0 1 locals stack String[] 0 getstatic #2 out
  78. public static void main(java.lang.String[]); 0: iconst_0 1: istore_1 2: iload_1

    3: bipush 10 5: if_icmpge 22 8: getstatic #2 // Field java/lang/System.out:Ljava/io/PrintStream; 11: ldc #3 // String Hello 13: invokevirtual #4 // Method java/io/PrintStream.println:(Ljava/lang/String;)V 16: iinc 1, 1 19: goto 2 22: return 0 1 locals stack String[] 0 out
  79. public static void main(java.lang.String[]); 0: iconst_0 1: istore_1 2: iload_1

    3: bipush 10 5: if_icmpge 22 8: getstatic #2 // Field java/lang/System.out:Ljava/io/PrintStream; 11: ldc #3 // String Hello 13: invokevirtual #4 // Method java/io/PrintStream.println:(Ljava/lang/String;)V 16: iinc 1, 1 19: goto 2 22: return 0 1 locals stack String[] 0 out ldc #3
  80. public static void main(java.lang.String[]); 0: iconst_0 1: istore_1 2: iload_1

    3: bipush 10 5: if_icmpge 22 8: getstatic #2 // Field java/lang/System.out:Ljava/io/PrintStream; 11: ldc #3 // String Hello 13: invokevirtual #4 // Method java/io/PrintStream.println:(Ljava/lang/String;)V 16: iinc 1, 1 19: goto 2 22: return 0 1 locals stack String[] 0 out ldc #3 (Hello)
  81. public static void main(java.lang.String[]); 0: iconst_0 1: istore_1 2: iload_1

    3: bipush 10 5: if_icmpge 22 8: getstatic #2 // Field java/lang/System.out:Ljava/io/PrintStream; 11: ldc #3 // String Hello 13: invokevirtual #4 // Method java/io/PrintStream.println:(Ljava/lang/String;)V 16: iinc 1, 1 19: goto 2 22: return 0 1 locals stack String[] 0 out ldc #3 (Hello) load constant #3
  82. public static void main(java.lang.String[]); 0: iconst_0 1: istore_1 2: iload_1

    3: bipush 10 5: if_icmpge 22 8: getstatic #2 // Field java/lang/System.out:Ljava/io/PrintStream; 11: ldc #3 // String Hello 13: invokevirtual #4 // Method java/io/PrintStream.println:(Ljava/lang/String;)V 16: iinc 1, 1 19: goto 2 22: return 0 1 locals stack String[] 0 out ldc #3 (Hello)
  83. public static void main(java.lang.String[]); 0: iconst_0 1: istore_1 2: iload_1

    3: bipush 10 5: if_icmpge 22 8: getstatic #2 // Field java/lang/System.out:Ljava/io/PrintStream; 11: ldc #3 // String Hello 13: invokevirtual #4 // Method java/io/PrintStream.println:(Ljava/lang/String;)V 16: iinc 1, 1 19: goto 2 22: return 0 1 locals stack String[] 0 out ldc #3 Hello
  84. public static void main(java.lang.String[]); 0: iconst_0 1: istore_1 2: iload_1

    3: bipush 10 5: if_icmpge 22 8: getstatic #2 // Field java/lang/System.out:Ljava/io/PrintStream; 11: ldc #3 // String Hello 13: invokevirtual #4 // Method java/io/PrintStream.println:(Ljava/lang/String;)V 16: iinc 1, 1 19: goto 2 22: return 0 1 locals stack String[] 0 out ldc #3 Hello
  85. public static void main(java.lang.String[]); 0: iconst_0 1: istore_1 2: iload_1

    3: bipush 10 5: if_icmpge 22 8: getstatic #2 // Field java/lang/System.out:Ljava/io/PrintStream; 11: ldc #3 // String Hello 13: invokevirtual #4 // Method java/io/PrintStream.println:(Ljava/lang/String;)V 16: iinc 1, 1 19: goto 2 22: return 0 1 locals stack String[] 0 out Hello
  86. public static void main(java.lang.String[]); 0: iconst_0 1: istore_1 2: iload_1

    3: bipush 10 5: if_icmpge 22 8: getstatic #2 // Field java/lang/System.out:Ljava/io/PrintStream; 11: ldc #3 // String Hello 13: invokevirtual #4 // Method java/io/PrintStream.println:(Ljava/lang/String;)V 16: iinc 1, 1 19: goto 2 22: return 0 1 locals stack String[] 0 out Hello invokevirtual #4
  87. public static void main(java.lang.String[]); 0: iconst_0 1: istore_1 2: iload_1

    3: bipush 10 5: if_icmpge 22 8: getstatic #2 // Field java/lang/System.out:Ljava/io/PrintStream; 11: ldc #3 // String Hello 13: invokevirtual #4 // Method java/io/PrintStream.println:(Ljava/lang/String;)V 16: iinc 1, 1 19: goto 2 22: return 0 1 locals stack String[] 0 out Hello invokevirtual #4 (PrintStream.println)
  88. public static void main(java.lang.String[]); 0: iconst_0 1: istore_1 2: iload_1

    3: bipush 10 5: if_icmpge 22 8: getstatic #2 // Field java/lang/System.out:Ljava/io/PrintStream; 11: ldc #3 // String Hello 13: invokevirtual #4 // Method java/io/PrintStream.println:(Ljava/lang/String;)V 16: iinc 1, 1 19: goto 2 22: return 0 1 locals stack String[] 0 out Hello invokevirtual #4 (PrintStream.println)
  89. public static void main(java.lang.String[]); 0: iconst_0 1: istore_1 2: iload_1

    3: bipush 10 5: if_icmpge 22 8: getstatic #2 // Field java/lang/System.out:Ljava/io/PrintStream; 11: ldc #3 // String Hello 13: invokevirtual #4 // Method java/io/PrintStream.println:(Ljava/lang/String;)V 16: iinc 1, 1 19: goto 2 22: return 0 1 locals stack String[] 0 out Hello invokevirtual #4 (PrintStream.println)
  90. public static void main(java.lang.String[]); 0: iconst_0 1: istore_1 2: iload_1

    3: bipush 10 5: if_icmpge 22 8: getstatic #2 // Field java/lang/System.out:Ljava/io/PrintStream; 11: ldc #3 // String Hello 13: invokevirtual #4 // Method java/io/PrintStream.println:(Ljava/lang/String;)V 16: iinc 1, 1 19: goto 2 22: return 0 1 locals stack String[] 0 out Hello invokevirtual #4 (PrintStream.println)
  91. public static void main(java.lang.String[]); 0: iconst_0 1: istore_1 2: iload_1

    3: bipush 10 5: if_icmpge 22 8: getstatic #2 // Field java/lang/System.out:Ljava/io/PrintStream; 11: ldc #3 // String Hello 13: invokevirtual #4 // Method java/io/PrintStream.println:(Ljava/lang/String;)V 16: iinc 1, 1 19: goto 2 22: return 0 1 locals stack String[] 0 out Hello invokevirtual #4 (PrintStream.println)
  92. public static void main(java.lang.String[]); 0: iconst_0 1: istore_1 2: iload_1

    3: bipush 10 5: if_icmpge 22 8: getstatic #2 // Field java/lang/System.out:Ljava/io/PrintStream; 11: ldc #3 // String Hello 13: invokevirtual #4 // Method java/io/PrintStream.println:(Ljava/lang/String;)V 16: iinc 1, 1 19: goto 2 22: return 0 1 locals stack String[] 0
  93. public static void main(java.lang.String[]); 0: iconst_0 1: istore_1 2: iload_1

    3: bipush 10 5: if_icmpge 22 8: getstatic #2 // Field java/lang/System.out:Ljava/io/PrintStream; 11: ldc #3 // String Hello 13: invokevirtual #4 // Method java/io/PrintStream.println:(Ljava/lang/String;)V 16: iinc 1, 1 19: goto 2 22: return 0 1 locals stack String[] 0 iinc 1, 1
  94. public static void main(java.lang.String[]); 0: iconst_0 1: istore_1 2: iload_1

    3: bipush 10 5: if_icmpge 22 8: getstatic #2 // Field java/lang/System.out:Ljava/io/PrintStream; 11: ldc #3 // String Hello 13: invokevirtual #4 // Method java/io/PrintStream.println:(Ljava/lang/String;)V 16: iinc 1, 1 19: goto 2 22: return 0 1 locals stack String[] 0 iinc 1, 1
  95. public static void main(java.lang.String[]); 0: iconst_0 1: istore_1 2: iload_1

    3: bipush 10 5: if_icmpge 22 8: getstatic #2 // Field java/lang/System.out:Ljava/io/PrintStream; 11: ldc #3 // String Hello 13: invokevirtual #4 // Method java/io/PrintStream.println:(Ljava/lang/String;)V 16: iinc 1, 1 19: goto 2 22: return 0 1 locals stack String[] 0 iinc 1, 1 int increment of local 1 by 1
  96. public static void main(java.lang.String[]); 0: iconst_0 1: istore_1 2: iload_1

    3: bipush 10 5: if_icmpge 22 8: getstatic #2 // Field java/lang/System.out:Ljava/io/PrintStream; 11: ldc #3 // String Hello 13: invokevirtual #4 // Method java/io/PrintStream.println:(Ljava/lang/String;)V 16: iinc 1, 1 19: goto 2 22: return 0 1 locals stack String[] 0 iinc 1, 1 +1
  97. public static void main(java.lang.String[]); 0: iconst_0 1: istore_1 2: iload_1

    3: bipush 10 5: if_icmpge 22 8: getstatic #2 // Field java/lang/System.out:Ljava/io/PrintStream; 11: ldc #3 // String Hello 13: invokevirtual #4 // Method java/io/PrintStream.println:(Ljava/lang/String;)V 16: iinc 1, 1 19: goto 2 22: return 0 1 locals stack String[] 0+1 iinc 1, 1
  98. public static void main(java.lang.String[]); 0: iconst_0 1: istore_1 2: iload_1

    3: bipush 10 5: if_icmpge 22 8: getstatic #2 // Field java/lang/System.out:Ljava/io/PrintStream; 11: ldc #3 // String Hello 13: invokevirtual #4 // Method java/io/PrintStream.println:(Ljava/lang/String;)V 16: iinc 1, 1 19: goto 2 22: return 0 1 locals stack String[] 1 iinc 1, 1
  99. public static void main(java.lang.String[]); 0: iconst_0 1: istore_1 2: iload_1

    3: bipush 10 5: if_icmpge 22 8: getstatic #2 // Field java/lang/System.out:Ljava/io/PrintStream; 11: ldc #3 // String Hello 13: invokevirtual #4 // Method java/io/PrintStream.println:(Ljava/lang/String;)V 16: iinc 1, 1 19: goto 2 22: return 0 1 locals stack String[] 1
  100. public static void main(java.lang.String[]); 0: iconst_0 1: istore_1 2: iload_1

    3: bipush 10 5: if_icmpge 22 8: getstatic #2 // Field java/lang/System.out:Ljava/io/PrintStream; 11: ldc #3 // String Hello 13: invokevirtual #4 // Method java/io/PrintStream.println:(Ljava/lang/String;)V 16: iinc 1, 1 19: goto 2 22: return 0 1 locals stack String[] 1
  101. public static void main(java.lang.String[]); 0: iconst_0 1: istore_1 2: iload_1

    3: bipush 10 5: if_icmpge 22 8: getstatic #2 // Field java/lang/System.out:Ljava/io/PrintStream; 11: ldc #3 // String Hello 13: invokevirtual #4 // Method java/io/PrintStream.println:(Ljava/lang/String;)V 16: iinc 1, 1 19: goto 2 22: return 0 1 locals stack String[] 1 >>
  102. public static void main(java.lang.String[]); 0: iconst_0 1: istore_1 2: iload_1

    3: bipush 10 5: if_icmpge 22 8: getstatic #2 // Field java/lang/System.out:Ljava/io/PrintStream; 11: ldc #3 // String Hello 13: invokevirtual #4 // Method java/io/PrintStream.println:(Ljava/lang/String;)V 16: iinc 1, 1 19: goto 2 22: return 0 1 locals stack String[] 9
  103. public static void main(java.lang.String[]); 0: iconst_0 1: istore_1 2: iload_1

    3: bipush 10 5: if_icmpge 22 8: getstatic #2 // Field java/lang/System.out:Ljava/io/PrintStream; 11: ldc #3 // String Hello 13: invokevirtual #4 // Method java/io/PrintStream.println:(Ljava/lang/String;)V 16: iinc 1, 1 19: goto 2 22: return 0 1 locals stack String[] 9
  104. public static void main(java.lang.String[]); 0: iconst_0 1: istore_1 2: iload_1

    3: bipush 10 5: if_icmpge 22 8: getstatic #2 // Field java/lang/System.out:Ljava/io/PrintStream; 11: ldc #3 // String Hello 13: invokevirtual #4 // Method java/io/PrintStream.println:(Ljava/lang/String;)V 16: iinc 1, 1 19: goto 2 22: return 0 1 locals stack String[] 10
  105. public static void main(java.lang.String[]); 0: iconst_0 1: istore_1 2: iload_1

    3: bipush 10 5: if_icmpge 22 8: getstatic #2 // Field java/lang/System.out:Ljava/io/PrintStream; 11: ldc #3 // String Hello 13: invokevirtual #4 // Method java/io/PrintStream.println:(Ljava/lang/String;)V 16: iinc 1, 1 19: goto 2 22: return 0 1 locals stack String[] 10
  106. public static void main(java.lang.String[]); 0: iconst_0 1: istore_1 2: iload_1

    3: bipush 10 5: if_icmpge 22 8: getstatic #2 // Field java/lang/System.out:Ljava/io/PrintStream; 11: ldc #3 // String Hello 13: invokevirtual #4 // Method java/io/PrintStream.println:(Ljava/lang/String;)V 16: iinc 1, 1 19: goto 2 22: return 0 1 locals stack String[] 10 10
  107. public static void main(java.lang.String[]); 0: iconst_0 1: istore_1 2: iload_1

    3: bipush 10 5: if_icmpge 22 8: getstatic #2 // Field java/lang/System.out:Ljava/io/PrintStream; 11: ldc #3 // String Hello 13: invokevirtual #4 // Method java/io/PrintStream.println:(Ljava/lang/String;)V 16: iinc 1, 1 19: goto 2 22: return 0 1 locals stack String[] 10 10 10
  108. public static void main(java.lang.String[]); 0: iconst_0 1: istore_1 2: iload_1

    3: bipush 10 5: if_icmpge 22 8: getstatic #2 // Field java/lang/System.out:Ljava/io/PrintStream; 11: ldc #3 // String Hello 13: invokevirtual #4 // Method java/io/PrintStream.println:(Ljava/lang/String;)V 16: iinc 1, 1 19: goto 2 22: return 0 1 locals stack String[] 10 10 >= 10
  109. public static void main(java.lang.String[]); 0: iconst_0 1: istore_1 2: iload_1

    3: bipush 10 5: if_icmpge 22 8: getstatic #2 // Field java/lang/System.out:Ljava/io/PrintStream; 11: ldc #3 // String Hello 13: invokevirtual #4 // Method java/io/PrintStream.println:(Ljava/lang/String;)V 16: iinc 1, 1 19: goto 2 22: return 0 1 locals stack String[] 10
  110. public static void main(java.lang.String[]); 0: iconst_0 1: istore_1 2: iload_1

    3: bipush 10 5: if_icmpge 22 8: getstatic #2 // Field java/lang/System.out:Ljava/io/PrintStream; 11: ldc #3 // String Hello 13: invokevirtual #4 // Method java/io/PrintStream.println:(Ljava/lang/String;)V 16: iinc 1, 1 19: goto 2 22: return
  111. $ cat Primitives.java public class Primitives { public static void

    asByte() { for (byte i = 0; i < 10; i++) { System.out.println("Hello"); } } public static void asShort() { for (short i = 0; i < 10; i++) { System.out.println("Hello"); } } public static void asInt() { for (int i = 0; i < 10; i++) { System.out.println("Hello"); } } public static void asLong() { for (long i = 0L; i < 10L; i++) { System.out.println("Hello"); } } }
  112. $ cat Primitives.java public class Primitives { public static void

    asByte() { for (byte i = 0; i < 10; i++) { System.out.println("Hello"); } } public static void asShort() { for (short i = 0; i < 10; i++) { System.out.println("Hello"); } } public static void asInt() { for (int i = 0; i < 10; i++) { System.out.println("Hello"); } } public static void asLong() { for (long i = 0L; i < 10L; i++) { System.out.println("Hello"); } } }
  113. $ javac Primitives.java $ javap -c Primitives public class Primitives

    { public Primitives(); Code: 0: aload_0 1: invokespecial #1 // Method java/lang/Object."<init>":()V 4: return public static void asByte(); Code: 0: iconst_0 1: istore_0 2: iload_0 3: bipush 10 5: if_icmpge 24 8: getstatic #2 // Field java/lang/System.out:Ljava/io/PrintStream; 11: ldc #3 // String Hello 13: invokevirtual #4 // Method java/io/PrintStream.println:(Ljava/lang/String;)V 16: iload_0 17: iconst_1 18: iadd 19: i2b 20: istore_0 21: goto 2 24: return public static void asShort(); Code: 0: iconst_0 1: istore_0 2: iload_0 3: bipush 10 5: if_icmpge 24 8: getstatic #2 // Field java/lang/System.out:Ljava/io/PrintStream; 11: ldc #3 // String Hello 13: invokevirtual #4 // Method java/io/PrintStream.println:(Ljava/lang/String;)V 16: iload_0 17: iconst_1 18: iadd 19: i2s 20: istore_0 21: goto 2 24: return public static void asInt(); Code: 0: iconst_0 1: istore_0 2: iload_0 3: bipush 10 5: if_icmpge 22 8: getstatic #2 // Field java/lang/System.out:Ljava/io/PrintStream; 11: ldc #3 // String Hello 13: invokevirtual #4 // Method java/io/PrintStream.println:(Ljava/lang/String;)V 16: iinc 0, 1 19: goto 2 22: return public static void asLong(); Code: 0: lconst_0 1: lstore_0 2: lload_0 3: ldc2_w #5 // long 10l 6: lcmp 7: ifge 25 10: getstatic #2 // Field java/lang/System.out:Ljava/io/PrintStream; 13: ldc #3 // String Hello 15: invokevirtual #4 // Method java/io/PrintStream.println:(Ljava/lang/String;)V 18: lload_0 19: lconst_1 20: ladd 21: lstore_0 22: goto 2 25: return }
  114. static void asByte(); 0: iconst_0 1: istore_0 2: iload_0 3:

    bipush 10 5: if_icmpge 24 8: getstatic #2 11: ldc #3 13: invokevirtual #4 16: iload_0 17: iconst_1 18: iadd 19: i2b 20: istore_0 21: goto 2 24: return static void asShort(); 0: iconst_0 1: istore_0 2: iload_0 3: bipush 10 5: if_icmpge 24 8: getstatic #2 11: ldc #3 13: invokevirtual #4 16: iload_0 17: iconst_1 18: iadd 19: i2s 20: istore_0 21: goto 2 24: return static void asInt(); 0: iconst_0 1: istore_0 2: iload_0 3: bipush 10 5: if_icmpge 22 8: getstatic #2 11: ldc #3 13: invokevirtual #4 16: iinc 0, 1 19: goto 2 22: return static void asLong(); 0: lconst_0 1: lstore_0 2: lload_0 3: ldc2_w #5 6: lcmp 7: ifge 25 10: getstatic #2 13: ldc #3 15: invokevirtual #4 18: lload_0 19: lconst_1 20: ladd 21: lstore_0 22: goto 2 25: return
  115. static void asByte(); 0: iconst_0 1: istore_0 2: iload_0 3:

    bipush 10 5: if_icmpge 24 8: getstatic #2 11: ldc #3 13: invokevirtual #4 16: iload_0 17: iconst_1 18: iadd 19: i2b 20: istore_0 21: goto 2 24: return static void asShort(); 0: iconst_0 1: istore_0 2: iload_0 3: bipush 10 5: if_icmpge 24 8: getstatic #2 11: ldc #3 13: invokevirtual #4 16: iload_0 17: iconst_1 18: iadd 19: i2s 20: istore_0 21: goto 2 24: return static void asInt(); 0: iconst_0 1: istore_0 2: iload_0 3: bipush 10 5: if_icmpge 22 8: getstatic #2 11: ldc #3 13: invokevirtual #4 16: iinc 0, 1 19: goto 2 22: return static void asLong(); 0: lconst_0 1: lstore_0 2: lload_0 3: ldc2_w #5 6: lcmp 7: ifge 25 10: getstatic #2 13: ldc #3 15: invokevirtual #4 18: lload_0 19: lconst_1 20: ladd 21: lstore_0 22: goto 2 25: return
  116. static void asByte(); 0: iconst_0 1: istore_0 2: iload_0 3:

    bipush 10 5: if_icmpge 24 8: getstatic #2 11: ldc #3 13: invokevirtual #4 16: iload_0 17: iconst_1 18: iadd 19: i2b 20: istore_0 21: goto 2 24: return static void asShort(); 0: iconst_0 1: istore_0 2: iload_0 3: bipush 10 5: if_icmpge 24 8: getstatic #2 11: ldc #3 13: invokevirtual #4 16: iload_0 17: iconst_1 18: iadd 19: i2s 20: istore_0 21: goto 2 24: return static void asInt(); 0: iconst_0 1: istore_0 2: iload_0 3: bipush 10 5: if_icmpge 22 8: getstatic #2 11: ldc #3 13: invokevirtual #4 16: iinc 0, 1 19: goto 2 22: return static void asLong(); 0: lconst_0 1: lstore_0 2: lload_0 3: ldc2_w #5 6: lcmp 7: ifge 25 10: getstatic #2 13: ldc #3 15: invokevirtual #4 18: lload_0 19: lconst_1 20: ladd 21: lstore_0 22: goto 2 25: return
  117. static void asByte(); 0: iconst_0 1: istore_0 2: iload_0 3:

    bipush 10 5: if_icmpge 24 8: getstatic #2 11: ldc #3 13: invokevirtual #4 16: iload_0 17: iconst_1 18: iadd 19: i2b 20: istore_0 21: goto 2 24: return static void asShort(); 0: iconst_0 1: istore_0 2: iload_0 3: bipush 10 5: if_icmpge 24 8: getstatic #2 11: ldc #3 13: invokevirtual #4 16: iload_0 17: iconst_1 18: iadd 19: i2s 20: istore_0 21: goto 2 24: return static void asInt(); 0: iconst_0 1: istore_0 2: iload_0 3: bipush 10 5: if_icmpge 22 8: getstatic #2 11: ldc #3 13: invokevirtual #4 16: iinc 0, 1 19: goto 2 22: return static void asLong(); 0: lconst_0 1: lstore_0 2: lload_0 3: ldc2_w #5 6: lcmp 7: ifge 25 10: getstatic #2 13: ldc #3 15: invokevirtual #4 18: lload_0 19: lconst_1 20: ladd 21: lstore_0 22: goto 2 25: return
  118. static void asByte(); 0: iconst_0 1: istore_0 2: iload_0 3:

    bipush 10 5: if_icmpge 24 8: getstatic #2 11: ldc #3 13: invokevirtual #4 16: iload_0 17: iconst_1 18: iadd 19: i2b 20: istore_0 21: goto 2 24: return static void asShort(); 0: iconst_0 1: istore_0 2: iload_0 3: bipush 10 5: if_icmpge 24 8: getstatic #2 11: ldc #3 13: invokevirtual #4 16: iload_0 17: iconst_1 18: iadd 19: i2s 20: istore_0 21: goto 2 24: return static void asInt(); 0: iconst_0 1: istore_0 2: iload_0 3: bipush 10 5: if_icmpge 22 8: getstatic #2 11: ldc #3 13: invokevirtual #4 16: iinc 0, 1 19: goto 2 22: return static void asLong(); 0: lconst_0 1: lstore_0 2: lload_0 3: ldc2_w #5 6: lcmp 7: ifge 25 10: getstatic #2 13: ldc #3 15: invokevirtual #4 18: lload_0 19: lconst_1 20: ladd 21: lstore_0 22: goto 2 25: return
  119. static void asByte(); 0: iconst_0 1: istore_0 2: iload_0 3:

    bipush 10 5: if_icmpge 24 8: getstatic #2 11: ldc #3 13: invokevirtual #4 16: iload_0 17: iconst_1 18: iadd 19: i2b 20: istore_0 21: goto 2 24: return static void asShort(); 0: iconst_0 1: istore_0 2: iload_0 3: bipush 10 5: if_icmpge 24 8: getstatic #2 11: ldc #3 13: invokevirtual #4 16: iload_0 17: iconst_1 18: iadd 19: i2s 20: istore_0 21: goto 2 24: return static void asInt(); 0: iconst_0 1: istore_0 2: iload_0 3: bipush 10 5: if_icmpge 22 8: getstatic #2 11: ldc #3 13: invokevirtual #4 16: iinc 0, 1 19: goto 2 22: return static void asLong(); 0: lconst_0 1: lstore_0 2: lload_0 3: ldc2_w #5 6: lcmp 7: ifge 25 10: getstatic #2 13: ldc #3 15: invokevirtual #4 18: lload_0 19: lconst_1 20: ladd 21: lstore_0 22: goto 2 25: return
  120. static void asByte(); 0: iconst_0 1: istore_0 2: iload_0 3:

    bipush 10 5: if_icmpge 24 8: getstatic #2 11: ldc #3 13: invokevirtual #4 16: iload_0 17: iconst_1 18: iadd 19: i2b 20: istore_0 21: goto 2 24: return static void asShort(); 0: iconst_0 1: istore_0 2: iload_0 3: bipush 10 5: if_icmpge 24 8: getstatic #2 11: ldc #3 13: invokevirtual #4 16: iload_0 17: iconst_1 18: iadd 19: i2s 20: istore_0 21: goto 2 24: return static void asInt(); 0: iconst_0 1: istore_0 2: iload_0 3: bipush 10 5: if_icmpge 22 8: getstatic #2 11: ldc #3 13: invokevirtual #4 16: iinc 0, 1 19: goto 2 22: return static void asLong(); 0: lconst_0 1: lstore_0 2: lload_0 3: ldc2_w #5 6: lcmp 7: ifge 25 10: getstatic #2 13: ldc #3 15: invokevirtual #4 18: lload_0 19: lconst_1 20: ladd 21: lstore_0 22: goto 2 25: return
  121. static void asByte(); 0: iconst_0 1: istore_0 2: iload_0 3:

    bipush 10 5: if_icmpge 24 8: getstatic #2 11: ldc #3 13: invokevirtual #4 16: iload_0 17: iconst_1 18: iadd 19: i2b 20: istore_0 21: goto 2 24: return static void asShort(); 0: iconst_0 1: istore_0 2: iload_0 3: bipush 10 5: if_icmpge 24 8: getstatic #2 11: ldc #3 13: invokevirtual #4 16: iload_0 17: iconst_1 18: iadd 19: i2s 20: istore_0 21: goto 2 24: return static void asInt(); 0: iconst_0 1: istore_0 2: iload_0 3: bipush 10 5: if_icmpge 22 8: getstatic #2 11: ldc #3 13: invokevirtual #4 16: iinc 0, 1 19: goto 2 22: return static void asLong(); 0: lconst_0 1: lstore_0 2: lload_0 3: ldc2_w #5 6: lcmp 7: ifge 25 10: getstatic #2 13: ldc #3 15: invokevirtual #4 18: lload_0 19: lconst_1 20: ladd 21: lstore_0 22: goto 2 25: return
  122. static void asByte(); 0: iconst_0 1: istore_0 2: iload_0 3:

    bipush 10 5: if_icmpge 24 8: getstatic #2 11: ldc #3 13: invokevirtual #4 16: iload_0 17: iconst_1 18: iadd 19: i2b 20: istore_0 21: goto 2 24: return static void asShort(); 0: iconst_0 1: istore_0 2: iload_0 3: bipush 10 5: if_icmpge 24 8: getstatic #2 11: ldc #3 13: invokevirtual #4 16: iload_0 17: iconst_1 18: iadd 19: i2s 20: istore_0 21: goto 2 24: return static void asInt(); 0: iconst_0 1: istore_0 2: iload_0 3: bipush 10 5: if_icmpge 22 8: getstatic #2 11: ldc #3 13: invokevirtual #4 16: iinc 0, 1 19: goto 2 22: return static void asLong(); 0: lconst_0 1: lstore_0 2: lload_0 3: ldc2_w #5 6: lcmp 7: ifge 25 10: getstatic #2 13: ldc #3 15: invokevirtual #4 18: lload_0 19: lconst_1 20: ladd 21: lstore_0 22: goto 2 25: return
  123. static void asByte(); 0: iconst_0 1: istore_0 2: iload_0 3:

    bipush 10 5: if_icmpge 24 8: getstatic #2 11: ldc #3 13: invokevirtual #4 16: iload_0 17: iconst_1 18: iadd 19: i2b 20: istore_0 21: goto 2 24: return static void asShort(); 0: iconst_0 1: istore_0 2: iload_0 3: bipush 10 5: if_icmpge 24 8: getstatic #2 11: ldc #3 13: invokevirtual #4 16: iload_0 17: iconst_1 18: iadd 19: i2s 20: istore_0 21: goto 2 24: return static void asInt(); 0: iconst_0 1: istore_0 2: iload_0 3: bipush 10 5: if_icmpge 22 8: getstatic #2 11: ldc #3 13: invokevirtual #4 16: iinc 0, 1 19: goto 2 22: return static void asLong(); 0: lconst_0 1: lstore_0 2: lload_0 3: ldc2_w #5 6: lcmp 7: ifge 25 10: getstatic #2 13: ldc #3 15: invokevirtual #4 18: lload_0 19: lconst_1 20: ladd 21: lstore_0 22: goto 2 25: return
  124. static void asByte(); 0: iconst_0 1: istore_0 2: iload_0 3:

    bipush 10 5: if_icmpge 24 8: getstatic #2 11: ldc #3 13: invokevirtual #4 16: iload_0 17: iconst_1 18: iadd 19: i2b 20: istore_0 21: goto 2 24: return static void asShort(); 0: iconst_0 1: istore_0 2: iload_0 3: bipush 10 5: if_icmpge 24 8: getstatic #2 11: ldc #3 13: invokevirtual #4 16: iload_0 17: iconst_1 18: iadd 19: i2s 20: istore_0 21: goto 2 24: return static void asInt(); 0: iconst_0 1: istore_0 2: iload_0 3: bipush 10 5: if_icmpge 22 8: getstatic #2 11: ldc #3 13: invokevirtual #4 16: iinc 0, 1 19: goto 2 22: return static void asLong(); 0: lconst_0 1: lstore_0 2: lload_0 3: ldc2_w #5 6: lcmp 7: ifge 25 10: getstatic #2 13: ldc #3 15: invokevirtual #4 18: lload_0 19: lconst_1 20: ladd 21: lstore_0 22: goto 2 25: return
  125. $ cat Java8.java public class Java8 { public static Runnable

    sayHi(String name) { return () -> System.out.println("Hello, " + name); } }
  126. $ cat Java8.java public class Java8 { public static Runnable

    sayHi(String name) { return () -> System.out.println("Hello, " + name); } } $ javac Java8.java
  127. $ javap -c -p Java8 public class Java8 { public

    static java.lang.Runnable sayHi(java.lang.String); Code: 0: aload_0 1: invokedynamic #2, 0 // InvokeDynamic #0:run:(Ljava/lang/String;)Ljava/lang/Runnable; 6: areturn private static void lambda$sayHi$0(java.lang.String); Code: 0: getstatic #3 // Field java/lang/System.out:Ljava/io/PrintStream; 3: new #4 // class java/lang/StringBuilder 6: dup 7: invokespecial #5 // Method java/lang/StringBuilder."<init>":()V 10: ldc #6 // String Hello, 12: invokevirtual #7 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/Strin 15: aload_0 16: invokevirtual #7 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/Strin 19: invokevirtual #8 // Method java/lang/StringBuilder.toString:()Ljava/lang/String; 22: invokevirtual #9 // Method java/io/PrintStream.println:(Ljava/lang/String;)V 25: return }
  128. $ javap -c -p Java8 public class Java8 { public

    static java.lang.Runnable sayHi(java.lang.String); Code: 0: aload_0 1: invokedynamic #2, 0 // InvokeDynamic #0:run:(Ljava/lang/String;)Ljava/lang/Runnable; 6: areturn private static void lambda$sayHi$0(java.lang.String); Code: 0: getstatic #3 // Field java/lang/System.out:Ljava/io/PrintStream; 3: new #4 // class java/lang/StringBuilder 6: dup 7: invokespecial #5 // Method java/lang/StringBuilder."<init>":()V 10: ldc #6 // String Hello, 12: invokevirtual #7 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/Strin 15: aload_0 16: invokevirtual #7 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/Strin 19: invokevirtual #8 // Method java/lang/StringBuilder.toString:()Ljava/lang/String; 22: invokevirtual #9 // Method java/io/PrintStream.println:(Ljava/lang/String;)V 25: return }
  129. $ javap -c -p Java8 public class Java8 { public

    static java.lang.Runnable sayHi(java.lang.String); Code: 0: aload_0 1: invokedynamic #2, 0 // InvokeDynamic #0:run:(Ljava/lang/String;)Ljava/lang/Runnable; 6: areturn private static void lambda$sayHi$0(java.lang.String); Code: 0: getstatic #3 // Field java/lang/System.out:Ljava/io/PrintStream; 3: new #4 // class java/lang/StringBuilder 6: dup 7: invokespecial #5 // Method java/lang/StringBuilder."<init>":()V 10: ldc #6 // String Hello, 12: invokevirtual #7 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/Strin 15: aload_0 16: invokevirtual #7 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/Strin 19: invokevirtual #8 // Method java/lang/StringBuilder.toString:()Ljava/lang/String; 22: invokevirtual #9 // Method java/io/PrintStream.println:(Ljava/lang/String;)V 25: return }
  130. $ javap -c -p Java8 public class Java8 { public

    static java.lang.Runnable sayHi(java.lang.String); Code: 0: aload_0 1: invokedynamic #2, 0 // InvokeDynamic #0:run:(Ljava/lang/String;)Ljava/lang/Runnable; 6: areturn private static void lambda$sayHi$0(java.lang.String); Code: 0: getstatic #3 // Field java/lang/System.out:Ljava/io/PrintStream; 3: new #4 // class java/lang/StringBuilder 6: dup 7: invokespecial #5 // Method java/lang/StringBuilder."<init>":()V 10: ldc #6 // String Hello, 12: invokevirtual #7 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/Strin 15: aload_0 16: invokevirtual #7 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/Strin 19: invokevirtual #8 // Method java/lang/StringBuilder.toString:()Ljava/lang/String; 22: invokevirtual #9 // Method java/io/PrintStream.println:(Ljava/lang/String;)V 25: return }
  131. $ git clone https://github.com/bazelbuild/bazel.git && cd bazel $ brew install

    bazel $ bazel build //src/tools/android/java/com/google/devtools/build/android/desugar:Desugar_deploy.jar
  132. $ git clone https://github.com/bazelbuild/bazel.git && cd bazel $ brew install

    bazel $ bazel build //src/tools/android/java/com/google/devtools/build/android/desugar:Desugar_deploy.jar INFO: Found 1 target... Target //src/tools/android/java/com/google/devtools/build/android/desugar:Desugar_deploy.jar up-to-date: bazel-bin/src/tools/android/java/com/google/devtools/build/android/desugar/Desugar_deploy.jar INFO: Elapsed time: 67.849s, Critical Path: 11.96s
  133. $ git clone https://github.com/bazelbuild/bazel.git && cd bazel $ brew install

    bazel $ bazel build //src/tools/android/java/com/google/devtools/build/android/desugar:Desugar_deploy.jar INFO: Found 1 target... Target //src/tools/android/java/com/google/devtools/build/android/desugar:Desugar_deploy.jar up-to-date: bazel-bin/src/tools/android/java/com/google/devtools/build/android/desugar/Desugar_deploy.jar INFO: Elapsed time: 67.849s, Critical Path: 11.96s
  134. $ git clone https://github.com/bazelbuild/bazel.git && cd bazel $ brew install

    bazel $ bazel build //src/tools/android/java/com/google/devtools/build/android/desugar:Desugar_deploy.jar INFO: Found 1 target... Target //src/tools/android/java/com/google/devtools/build/android/desugar:Desugar_deploy.jar up-to-date: bazel-bin/src/tools/android/java/com/google/devtools/build/android/desugar/Desugar_deploy.jar INFO: Elapsed time: 67.849s, Critical Path: 11.96s ⌘+C
  135. $ git clone https://github.com/bazelbuild/bazel.git && cd bazel $ brew install

    bazel $ bazel build //src/tools/android/java/com/google/devtools/build/android/desugar:Desugar_deploy.jar INFO: Found 1 target... Target //src/tools/android/java/com/google/devtools/build/android/desugar:Desugar_deploy.jar up-to-date: bazel-bin/src/tools/android/java/com/google/devtools/build/android/desugar/Desugar_deploy.jar INFO: Elapsed time: 67.849s, Critical Path: 11.96s
  136. $ git clone https://github.com/bazelbuild/bazel.git && cd bazel $ brew install

    bazel $ bazel build //src/tools/android/java/com/google/devtools/build/android/desugar:Desugar_deploy.jar INFO: Found 1 target... Target //src/tools/android/java/com/google/devtools/build/android/desugar:Desugar_deploy.jar up-to-date: bazel-bin/src/tools/android/java/com/google/devtools/build/android/desugar/Desugar_deploy.jar INFO: Elapsed time: 67.849s, Critical Path: 11.96s $ cd ..
  137. $ java -jar \ bazel/bazel-bin/src/tools/android/java/com/google/devtools/build/android/desugar/Desugar_deploy.jar \ --help Options category 'input':

    --bootclasspath_entry (a valid filesystem path; may be used multiple times) Bootclasspath that was used to compile the --input Jar with, like javac's - bootclasspath flag (required). --classpath_entry (a valid filesystem path; may be used multiple times) Ordered classpath (Jar or directory) to resolve symbols in the --input Jar, like javac's -cp flag. --input [-i] (a valid filesystem path; may be used multiple times) Input Jar or directory with classes to desugar (required, the n-th input is paired withthe n-th output). Options category 'misc': --[no]best_effort_tolerate_missing_deps (a boolean; default: "true") Whether to tolerate missing dependencies on the classpath in some cases. You should strive to set this flag to false. --[no]copy_bridges_from_classpath (a boolean; default: "false") Copy bridges from classpath to desugared classes. --[no]desugar_interface_method_bodies_if_needed (a boolean; default: "true") Rewrites default and static methods in interfaces if --min_sdk_version < 24. This only works correctly if subclasses of rewritten interfaces as well as uses of static interface methods are run through this tool as well. --[no]desugar_try_with_resources_if_needed (a boolean; default: "true") Rewrites try-with-resources statements if --min_sdk_version < 19. --[no]desugar_try_with_resources_omit_runtime_classes (a boolean; default: "false") Omits the runtime classes necessary to support try-with-resources from the output. This property has effect only if -- desugar_try_with_resources_if_needed is used. --[no]emit_dependency_metadata_as_needed (a boolean; default: "false") Whether to emit META-INF/desugar_deps as needed for later consistency checking. --min_sdk_version (an integer; default: "1") Minimum targeted sdk version. If >= 24, enables default methods in interfaces. --[no]rewrite_calls_to_long_compare (a boolean; default: "false") Rewrite calls to Long.compare(long, long) to the JVM instruction lcmp regardless of --min_sdk_version. --[no]verbose [-v] (a boolean; default: "false") Enables verbose debugging output. Options category 'output': --output [-o] (a valid filesystem path; may be used multiple times) Output Jar or directory to write desugared classes into (required, the n-th output is paired with the n-th input, output must be a Jar if input is a Jar).
  138. $ mkdir desugared $ java -jar \ bazel/bazel-bin/src/tools/android/java/com/google/devtools/build/android/desugar/Desugar_deploy.jar \ --bootclasspath_entry

    /Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Home/jre/lib/rt.jar \ --input . \ --output desugared
  139. $ mkdir desugared $ java -jar \ bazel/bazel-bin/src/tools/android/java/com/google/devtools/build/android/desugar/Desugar_deploy.jar \ --bootclasspath_entry

    /Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Home/jre/lib/rt.jar \ --input . \ --output desugared $ tree . ├── Java8.class ├── Java8.java ├── bazel │ └── <snipped> └── desugared ├── Java8$$Lambda$0.class └── Java8.class
  140. $ javap -c -p desugared/Java8.class public class Java8 { public

    static java.lang.Runnable sayHi(java.lang.String); Code: 0: new #13 // class Java8$$Lambda$0 3: dup 4: aload_0 5: invokespecial #16 // Method Java8$$Lambda$0."<init>":(Ljava/lang/String;)V 8: areturn static void lambda$sayHi$0$Lambda(java.lang.String); Code: 0: getstatic #3 // Field java/lang/System.out:Ljava/io/PrintStream; 3: new #4 // class java/lang/StringBuilder 6: dup 7: invokespecial #5 // Method java/lang/StringBuilder."<init>":()V 10: ldc #6 // String Hello, 12: invokevirtual #7 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder; 15: aload_0 16: invokevirtual #7 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder; 19: invokevirtual #8 // Method java/lang/StringBuilder.toString:()Ljava/lang/String; 22: invokevirtual #9 // Method java/io/PrintStream.println:(Ljava/lang/String;)V 25: return }Z
  141. $ javap -c -p desugared/Java8.class public class Java8 { public

    static java.lang.Runnable sayHi(java.lang.String); Code: 0: new #13 // class Java8$$Lambda$0 3: dup 4: aload_0 5: invokespecial #16 // Method Java8$$Lambda$0."<init>":(Ljava/lang/String;)V 8: areturn static void lambda$sayHi$0$Lambda(java.lang.String); Code: 0: getstatic #3 // Field java/lang/System.out:Ljava/io/PrintStream; 3: new #4 // class java/lang/StringBuilder 6: dup 7: invokespecial #5 // Method java/lang/StringBuilder."<init>":()V 10: ldc #6 // String Hello, 12: invokevirtual #7 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder; 15: aload_0 16: invokevirtual #7 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder; 19: invokevirtual #8 // Method java/lang/StringBuilder.toString:()Ljava/lang/String; 22: invokevirtual #9 // Method java/io/PrintStream.println:(Ljava/lang/String;)V 25: return }Z <snipped>
  142. $ javap -c -p desugared/Java8.class public class Java8 { public

    static java.lang.Runnable sayHi(java.lang.String); Code: 0: new #13 // class Java8$$Lambda$0 3: dup 4: aload_0 5: invokespecial #16 // Method Java8$$Lambda$0."<init>":(Ljava/lang/String;)V 8: areturn static void lambda$sayHi$0$Lambda(java.lang.String); <snipped> }Z
  143. $ javap -c -p desugared/Java8.class public class Java8 { public

    static java.lang.Runnable sayHi(java.lang.String); Code: 0: new #13 // class Java8$$Lambda$0 3: dup 4: aload_0 5: invokespecial #16 // Method Java8$$Lambda$0."<init>":(Ljava/lang/String;)V 8: areturn static void lambda$sayHi$0$Lambda(java.lang.String); <snipped> }Z
  144. $ javap -c -p desugared/Java8.class public class Java8 { public

    static java.lang.Runnable sayHi(java.lang.String); Code: 0: new #13 // class Java8$$Lambda$0 3: dup 4: aload_0 5: invokespecial #16 // Method Java8$$Lambda$0."<init>":(Ljava/lang/String;)V 8: areturn static void lambda$sayHi$0$Lambda(java.lang.String); <snipped> }Z
  145. $ javap -c -p desugared/Java8.class public class Java8 { public

    static java.lang.Runnable sayHi(java.lang.String); Code: 0: new #13 // class Java8$$Lambda$0 3: dup 4: aload_0 5: invokespecial #16 // Method Java8$$Lambda$0."<init>":(Ljava/lang/String;)V 8: areturn static void lambda$sayHi$0$Lambda(java.lang.String); <snipped> }Z
  146. $ javap -c -p desugared/Java8.class public class Java8 { public

    static java.lang.Runnable sayHi(java.lang.String); Code: 0: new #13 // class Java8$$Lambda$0 3: dup 4: aload_0 5: invokespecial #16 // Method Java8$$Lambda$0."<init>":(Ljava/lang/String;)V 8: areturn static void lambda$sayHi$0$Lambda(java.lang.String); <snipped> }Z
  147. $ javap -c -p desugared/Java8.class public class Java8 { public

    static java.lang.Runnable sayHi(java.lang.String); Code: 0: new #13 // class Java8$$Lambda$0 3: dup 4: aload_0 5: invokespecial #16 // Method Java8$$Lambda$0."<init>":(Ljava/lang/String;)V 8: areturn static void lambda$sayHi$0$Lambda(java.lang.String); <snipped> }Z
  148. $ javap -c -p 'desugared/Java8$$Lambda$0.class' final class Java8$$Lambda$0 implements java.lang.Runnable

    { private final java.lang.String arg$1; Java8$$Lambda$0(java.lang.String); Code: 0: aload_0 1: invokespecial #13 // Method java/lang/Object."<init>":()V 4: aload_0 5: aload_1 6: putfield #15 // Field arg$1:Ljava/lang/String; 9: return public void run(); Code: 0: aload_0 1: getfield #15 // Field arg$1:Ljava/lang/String; 4: invokestatic #21 // Method Java8.lambda$sayHi$0$Lambda:(Ljava/lang/String;)V 7: return }
  149. $ javap -c -p 'desugared/Java8$$Lambda$0.class' final class Java8$$Lambda$0 implements java.lang.Runnable

    { private final java.lang.String arg$1; Java8$$Lambda$0(java.lang.String); Code: 0: aload_0 1: invokespecial #13 // Method java/lang/Object."<init>":()V 4: aload_0 5: aload_1 6: putfield #15 // Field arg$1:Ljava/lang/String; 9: return public void run(); Code: 0: aload_0 1: getfield #15 // Field arg$1:Ljava/lang/String; 4: invokestatic #21 // Method Java8.lambda$sayHi$0$Lambda:(Ljava/lang/String;)V 7: return }
  150. $ javap -c -p 'desugared/Java8$$Lambda$0.class' final class Java8$$Lambda$0 implements java.lang.Runnable

    { private final java.lang.String arg$1; Java8$$Lambda$0(java.lang.String); Code: 0: aload_0 1: invokespecial #13 // Method java/lang/Object."<init>":()V 4: aload_0 5: aload_1 6: putfield #15 // Field arg$1:Ljava/lang/String; 9: return public void run(); Code: 0: aload_0 1: getfield #15 // Field arg$1:Ljava/lang/String; 4: invokestatic #21 // Method Java8.lambda$sayHi$0$Lambda:(Ljava/lang/String;)V 7: return }
  151. $ javap -c -p 'desugared/Java8$$Lambda$0.class' final class Java8$$Lambda$0 implements java.lang.Runnable

    { private final java.lang.String arg$1; Java8$$Lambda$0(java.lang.String); Code: 0: aload_0 1: invokespecial #13 // Method java/lang/Object."<init>":()V 4: aload_0 5: aload_1 6: putfield #15 // Field arg$1:Ljava/lang/String; 9: return public void run(); Code: 0: aload_0 1: getfield #15 // Field arg$1:Ljava/lang/String; 4: invokestatic #21 // Method Java8.lambda$sayHi$0$Lambda:(Ljava/lang/String;)V 7: return }
  152. $ javap -c -p 'desugared/Java8$$Lambda$0.class' final class Java8$$Lambda$0 implements java.lang.Runnable

    { private final java.lang.String arg$1; Java8$$Lambda$0(java.lang.String); Code: 0: aload_0 1: invokespecial #13 // Method java/lang/Object."<init>":()V 4: aload_0 5: aload_1 6: putfield #15 // Field arg$1:Ljava/lang/String; 9: return public void run(); Code: 0: aload_0 1: getfield #15 // Field arg$1:Ljava/lang/String; 4: invokestatic #21 // Method Java8.lambda$sayHi$0$Lambda:(Ljava/lang/String;)V 7: return }
  153. $ javap -c -p 'desugared/Java8$$Lambda$0.class' final class Java8$$Lambda$0 implements java.lang.Runnable

    { private final java.lang.String arg$1; Java8$$Lambda$0(java.lang.String); Code: 0: aload_0 1: invokespecial #13 // Method java/lang/Object."<init>":()V 4: aload_0 5: aload_1 6: putfield #15 // Field arg$1:Ljava/lang/String; 9: return public void run(); Code: 0: aload_0 1: getfield #15 // Field arg$1:Ljava/lang/String; 4: invokestatic #21 // Method Java8.lambda$sayHi$0$Lambda:(Ljava/lang/String;)V 7: return }
  154. $ javap -c -p 'desugared/Java8$$Lambda$0.class' final class Java8$$Lambda$0 implements java.lang.Runnable

    { private final java.lang.String arg$1; Java8$$Lambda$0(java.lang.String); Code: 0: aload_0 1: invokespecial #13 // Method java/lang/Object."<init>":()V 4: aload_0 5: aload_1 6: putfield #15 // Field arg$1:Ljava/lang/String; 9: return public void run(); Code: 0: aload_0 1: getfield #15 // Field arg$1:Ljava/lang/String; 4: invokestatic #21 // Method Java8.lambda$sayHi$0$Lambda:(Ljava/lang/String;)V 7: return }
  155. $ javap -c -p 'desugared/Java8$$Lambda$0.class' final class Java8$$Lambda$0 implements java.lang.Runnable

    { private final java.lang.String arg$1; Java8$$Lambda$0(java.lang.String); Code: 0: aload_0 1: invokespecial #13 // Method java/lang/Object."<init>":()V 4: aload_0 5: aload_1 6: putfield #15 // Field arg$1:Ljava/lang/String; 9: return public void run(); Code: 0: aload_0 1: getfield #15 // Field arg$1:Ljava/lang/String; 4: invokestatic #21 // Method Java8.lambda$sayHi$0$Lambda:(Ljava/lang/String;)V 7: return }
  156. $ javap -c -p 'desugared/Java8$$Lambda$0.class' final class Java8$$Lambda$0 implements java.lang.Runnable

    { private final java.lang.String arg$1; Java8$$Lambda$0(java.lang.String); Code: 0: aload_0 1: invokespecial #13 // Method java/lang/Object."<init>":()V 4: aload_0 5: aload_1 6: putfield #15 // Field arg$1:Ljava/lang/String; 9: return public void run(); Code: 0: aload_0 1: getfield #15 // Field arg$1:Ljava/lang/String; 4: invokestatic #21 // Method Java8.lambda$sayHi$0$Lambda:(Ljava/lang/String;)V 7: return }
  157. $ javap -c -p 'desugared/Java8$$Lambda$0.class' final class Java8$$Lambda$0 implements java.lang.Runnable

    { private final java.lang.String arg$1; Java8$$Lambda$0(java.lang.String); Code: 0: aload_0 1: invokespecial #13 // Method java/lang/Object."<init>":()V 4: aload_0 5: aload_1 6: putfield #15 // Field arg$1:Ljava/lang/String; 9: return public void run(); Code: 0: aload_0 1: getfield #15 // Field arg$1:Ljava/lang/String; 4: invokestatic #21 // Method Java8.lambda$sayHi$0$Lambda:(Ljava/lang/String;)V 7: return }
  158. $ javap -c -p 'desugared/Java8$$Lambda$0.class' final class Java8$$Lambda$0 implements java.lang.Runnable

    { private final java.lang.String arg$1; Java8$$Lambda$0(java.lang.String); Code: 0: aload_0 1: invokespecial #13 // Method java/lang/Object."<init>":()V 4: aload_0 5: aload_1 6: putfield #15 // Field arg$1:Ljava/lang/String; 9: return public void run(); Code: 0: aload_0 1: getfield #15 // Field arg$1:Ljava/lang/String; 4: invokestatic #21 // Method Java8.lambda$sayHi$0$Lambda:(Ljava/lang/String;)V 7: return }
  159. $ javap -c -p 'desugared/Java8$$Lambda$0.class' final class Java8$$Lambda$0 implements java.lang.Runnable

    { private final java.lang.String arg$1; Java8$$Lambda$0(java.lang.String); Code: 0: aload_0 1: invokespecial #13 // Method java/lang/Object."<init>":()V 4: aload_0 5: aload_1 6: putfield #15 // Field arg$1:Ljava/lang/String; 9: return public void run(); Code: 0: aload_0 1: getfield #15 // Field arg$1:Ljava/lang/String; 4: invokestatic #21 // Method Java8.lambda$sayHi$0$Lambda:(Ljava/lang/String;)V 7: return }
  160. $ javap -c -p 'desugared/Java8$$Lambda$0.class' final class Java8$$Lambda$0 implements java.lang.Runnable

    { private final java.lang.String arg$1; Java8$$Lambda$0(java.lang.String); Code: 0: aload_0 1: invokespecial #13 // Method java/lang/Object."<init>":()V 4: aload_0 5: aload_1 6: putfield #15 // Field arg$1:Ljava/lang/String; 9: return public void run(); Code: 0: aload_0 1: getfield #15 // Field arg$1:Ljava/lang/String; 4: invokestatic #21 // Method Java8.lambda$sayHi$0$Lambda:(Ljava/lang/String;)V 7: return }
  161. public class Java8 { public static Runnable sayHi(String name) {

    return () -> System.out.println("Hello, " + name); }Y }Z
  162. public class Java8 { public static Runnable sayHi(String name) {

    return () -> lambda$sayHi$0(name); }Y static void lambda$sayHi$0(String name) { System.out.println("Hello, " + name); }X }Z
  163. public class Java8 { public static Runnable sayHi(String name) {

    return new Java8$$Lambda$0(name); }Y static void lambda$sayHi$0$Lambda(String name) { System.out.println("Hello, " + name); }X }Z final class Java8$$Lambda$0 implements Runnable { private final String arg$1; Java8$$Lambda$0(String arg$1) { this.arg$1 = arg$1; }X @Override public void run() { Java8.lambda$sayHi$0$Lambda(arg$1e); }Y }Z
  164. public class Java8 { public static Runnable sayHi(String name) {

    return new Java8$$Lambda$0(name); }Y static void lambda$sayHi$0$Lambda(String name) { System.out.println("Hello, " + name); }X }Z final class Java8$$Lambda$0 implements Runnable { private final String arg$1; Java8$$Lambda$0(String arg$1) { this.arg$1 = arg$1; }X @Override public void run() { Java8.lambda$sayHi$0$Lambda(arg$1e); }Y }Z
  165. $ cat KotlinLambda.kt fun sayHi(name: String) = Runnable { println("Hello,

    $name" ) } $ kotlinc KotlinLambda.kt $ tree . ├── KotlinLambda.kt ├── KotlinLambdaKt$sayHi$1.class ├── KotlinLambdaKt.class └── META-INF └── main.kotlin_module
  166. $ javap -c -p KotlinLambdaKt public final class KotlinLambdaKt {

    public static final java.lang.Runnable sayHi(java.lang.String); Code: 0: aload_0 1: ldc #9 // String name 3: invokestatic #15 // Method kotlin/jvm/internal/Intrinsics.checkParameterIsNotNull:(Ljava/lan 6: new #17 // class KotlinLambdaKt$sayHi$1 9: dup 10: aload_0 11: invokespecial #21 // Method KotlinLambdaKt$sayHi$1."<init>":(Ljava/lang/String;)V 14: checkcast #23 // class java/lang/Runnable 17: areturn }
  167. $ javap -c -p KotlinLambdaKt public final class KotlinLambdaKt {

    public static final java.lang.Runnable sayHi(java.lang.String); Code: 0: aload_0 1: ldc #9 // String name 3: invokestatic #15 // Method kotlin/jvm/internal/Intrinsics.checkParameterIsNotNull:(Ljava/lan 6: new #17 // class KotlinLambdaKt$sayHi$1 9: dup 10: aload_0 11: invokespecial #21 // Method KotlinLambdaKt$sayHi$1."<init>":(Ljava/lang/String;)V 14: checkcast #23 // class java/lang/Runnable 17: areturn }
  168. $ javap -c -p KotlinLambdaKt public final class KotlinLambdaKt {

    public static final java.lang.Runnable sayHi(java.lang.String); Code: 0: aload_0 1: ldc #9 // String name 3: invokestatic #15 // Method kotlin/jvm/internal/Intrinsics.checkParameterIsNotNull:(Ljava/lan 6: new #17 // class KotlinLambdaKt$sayHi$1 9: dup 10: aload_0 11: invokespecial #21 // Method KotlinLambdaKt$sayHi$1."<init>":(Ljava/lang/String;)V 14: checkcast #23 // class java/lang/Runnable 17: areturn }
  169. $ javap -c -p KotlinLambdaKt public final class KotlinLambdaKt {

    public static final java.lang.Runnable sayHi(java.lang.String); Code: 0: aload_0 1: ldc #9 // String name 3: invokestatic #15 // Method kotlin/jvm/internal/Intrinsics.checkParameterIsNotNull:(Ljava/lan 6: new #17 // class KotlinLambdaKt$sayHi$1 9: dup 10: aload_0 11: invokespecial #21 // Method KotlinLambdaKt$sayHi$1."<init>":(Ljava/lang/String;)V 14: checkcast #23 // class java/lang/Runnable 17: areturn }
  170. $ javap -c -p KotlinLambdaKt public final class KotlinLambdaKt {

    public static final java.lang.Runnable sayHi(java.lang.String); Code: 0: aload_0 1: ldc #9 // String name 3: invokestatic #15 // Method kotlin/jvm/internal/Intrinsics.checkParameterIsNotNull:(Ljava/lan 6: new #17 // class KotlinLambdaKt$sayHi$1 9: dup 10: aload_0 11: invokespecial #21 // Method KotlinLambdaKt$sayHi$1."<init>":(Ljava/lang/String;)V 14: checkcast #23 // class java/lang/Runnable 17: areturn }
  171. $ javap -c -p 'KotlinLambdaKt$sayHi$1' final class KotlinLambdaKt$sayHi$1 implements java.lang.Runnable

    { final java.lang.String $name; KotlinLambdaKt$sayHi$1(java.lang.String); Code: 0: aload_0 1: aload_1 2: putfield #23 // Field $name:Ljava/lang/String; 5: aload_0 6: invokespecial #43 // Method java/lang/Object."<init>":()V 9: return public final void run(); Code: 0: new #10 // class java/lang/StringBuilder 3: dup 4: invokespecial #13 // Method java/lang/StringBuilder."<init>":()V 7: ldc #15 // String Hello, 9: invokevirtual #19 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder; 12: aload_0 13: getfield #23 // Field $name:Ljava/lang/String; 16: invokevirtual #19 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder; 19: invokevirtual #27 // Method java/lang/StringBuilder.toString:()Ljava/lang/String; 22: astore_1 23: getstatic #33 // Field java/lang/System.out:Ljava/io/PrintStream; 26: aload_1 27: invokevirtual #39 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V 30: return }
  172. $ javap -c -p 'KotlinLambdaKt$sayHi$1' final class KotlinLambdaKt$sayHi$1 implements java.lang.Runnable

    { final java.lang.String $name; KotlinLambdaKt$sayHi$1(java.lang.String); Code: 0: aload_0 1: aload_1 2: putfield #23 // Field $name:Ljava/lang/String; 5: aload_0 6: invokespecial #43 // Method java/lang/Object."<init>":()V 9: return public final void run(); Code: 0: new #10 // class java/lang/StringBuilder 3: dup 4: invokespecial #13 // Method java/lang/StringBuilder."<init>":()V 7: ldc #15 // String Hello, 9: invokevirtual #19 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder; 12: aload_0 13: getfield #23 // Field $name:Ljava/lang/String; 16: invokevirtual #19 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder; 19: invokevirtual #27 // Method java/lang/StringBuilder.toString:()Ljava/lang/String; 22: astore_1 23: getstatic #33 // Field java/lang/System.out:Ljava/io/PrintStream; 26: aload_1 27: invokevirtual #39 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V 30: return }
  173. $ javap -c -p 'KotlinLambdaKt$sayHi$1' final class KotlinLambdaKt$sayHi$1 implements java.lang.Runnable

    { final java.lang.String $name; KotlinLambdaKt$sayHi$1(java.lang.String); Code: 0: aload_0 1: aload_1 2: putfield #23 // Field $name:Ljava/lang/String; 5: aload_0 6: invokespecial #43 // Method java/lang/Object."<init>":()V 9: return public final void run(); Code: 0: new #10 // class java/lang/StringBuilder 3: dup 4: invokespecial #13 // Method java/lang/StringBuilder."<init>":()V 7: ldc #15 // String Hello, 9: invokevirtual #19 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder; 12: aload_0 13: getfield #23 // Field $name:Ljava/lang/String; 16: invokevirtual #19 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder; 19: invokevirtual #27 // Method java/lang/StringBuilder.toString:()Ljava/lang/String; 22: astore_1 23: getstatic #33 // Field java/lang/System.out:Ljava/io/PrintStream; 26: aload_1 27: invokevirtual #39 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V 30: return }
  174. $ javap -c KotlinSafeLetKt public final class KotlinSafeLetKt { public

    static final void sayHi(java.lang.String); Code: 0: aload_0 1: dup 2: ifnull 38 5: astore_1 6: aload_1 7: astore_2 8: new #9 // class java/lang/StringBuilder 11: dup 12: invokespecial #13 // Method java/lang/StringBuilder."<init>":()V 15: ldc #15 // String Hello, 17: invokevirtual #19 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder; 20: aload_2 21: invokevirtual #19 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder; 24: invokevirtual #23 // Method java/lang/StringBuilder.toString:()Ljava/lang/String; 27: astore_3 28: getstatic #29 // Field java/lang/System.out:Ljava/io/PrintStream; 31: aload_3 32: invokevirtual #35 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V 35: goto 39 38: pop 39: return }
  175. $ javap -c KotlinSafeLetKt public final class KotlinSafeLetKt { public

    static final void sayHi(java.lang.String); Code: 0: aload_0 1: dup 2: ifnull 38 5: astore_1 6: aload_1 7: astore_2 8: new #9 // class java/lang/StringBuilder 11: dup 12: invokespecial #13 // Method java/lang/StringBuilder."<init>":()V 15: ldc #15 // String Hello, 17: invokevirtual #19 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder; 20: aload_2 21: invokevirtual #19 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder; 24: invokevirtual #23 // Method java/lang/StringBuilder.toString:()Ljava/lang/String; 27: astore_3 28: getstatic #29 // Field java/lang/System.out:Ljava/io/PrintStream; 31: aload_3 32: invokevirtual #35 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V 35: goto 39 38: pop 39: return }
  176. $ javap -c KotlinSafeLetKt public final class KotlinSafeLetKt { public

    static final void sayHi(java.lang.String); Code: 0: aload_0 1: dup 2: ifnull 38 5: astore_1 6: aload_1 7: astore_2 8: new #9 // class java/lang/StringBuilder 11: dup 12: invokespecial #13 // Method java/lang/StringBuilder."<init>":()V 15: ldc #15 // String Hello, 17: invokevirtual #19 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder; 20: aload_2 21: invokevirtual #19 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder; 24: invokevirtual #23 // Method java/lang/StringBuilder.toString:()Ljava/lang/String; 27: astore_3 28: getstatic #29 // Field java/lang/System.out:Ljava/io/PrintStream; 31: aload_3 32: invokevirtual #35 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V 35: goto 39 38: pop 39: return }
  177. $ javap -c KotlinSafeLetKt public final class KotlinSafeLetKt { public

    static final void sayHi(java.lang.String); Code: 0: aload_0 1: dup 2: ifnull 38 5: astore_1 6: aload_1 7: astore_2 8: new #9 // class java/lang/StringBuilder 11: dup 12: invokespecial #13 // Method java/lang/StringBuilder."<init>":()V 15: ldc #15 // String Hello, 17: invokevirtual #19 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder; 20: aload_2 21: invokevirtual #19 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder; 24: invokevirtual #23 // Method java/lang/StringBuilder.toString:()Ljava/lang/String; 27: astore_3 28: getstatic #29 // Field java/lang/System.out:Ljava/io/PrintStream; 31: aload_3 32: invokevirtual #35 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V 35: goto 39 38: pop 39: return }
  178. $ javap -c KotlinSafeLetKt public final class KotlinSafeLetKt { public

    static final void sayHi(java.lang.String); Code: 0: aload_0 1: dup 2: ifnull 38 5: astore_1 6: aload_1 7: astore_2 8: new #9 // class java/lang/StringBuilder 11: dup 12: invokespecial #13 // Method java/lang/StringBuilder."<init>":()V 15: ldc #15 // String Hello, 17: invokevirtual #19 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder; 20: aload_2 21: invokevirtual #19 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder; 24: invokevirtual #23 // Method java/lang/StringBuilder.toString:()Ljava/lang/String; 27: astore_3 28: getstatic #29 // Field java/lang/System.out:Ljava/io/PrintStream; 31: aload_3 32: invokevirtual #35 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V 35: goto 39 38: pop 39: return }
  179. $ javap -c KotlinSafeLetKt public final class KotlinSafeLetKt { public

    static final void sayHi(java.lang.String); Code: 0: aload_0 1: dup 2: ifnull 38 5: astore_1 6: aload_1 7: astore_2 8: new #9 // class java/lang/StringBuilder 11: dup 12: invokespecial #13 // Method java/lang/StringBuilder."<init>":()V 15: ldc #15 // String Hello, 17: invokevirtual #19 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder; 20: aload_2 21: invokevirtual #19 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder; 24: invokevirtual #23 // Method java/lang/StringBuilder.toString:()Ljava/lang/String; 27: astore_3 28: getstatic #29 // Field java/lang/System.out:Ljava/io/PrintStream; 31: aload_3 32: invokevirtual #35 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V 35: goto 39 38: pop 39: return }
  180. $ javap -c KotlinSafeLetKt public final class KotlinSafeLetKt { public

    static final void sayHi(java.lang.String); Code: 0: aload_0 1: dup 2: ifnull 38 5: astore_1 6: aload_1 7: astore_2 8: new #9 // class java/lang/StringBuilder 11: dup 12: invokespecial #13 // Method java/lang/StringBuilder."<init>":()V 15: ldc #15 // String Hello, 17: invokevirtual #19 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder; 20: aload_2 21: invokevirtual #19 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder; 24: invokevirtual #23 // Method java/lang/StringBuilder.toString:()Ljava/lang/String; 27: astore_3 28: getstatic #29 // Field java/lang/System.out:Ljava/io/PrintStream; 31: aload_3 32: invokevirtual #35 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V 35: goto 39 38: pop 39: return }
  181. $ javap -c KotlinSafeLetKt public final class KotlinSafeLetKt { public

    static final void sayHi(java.lang.String); Code: 0: aload_0 1: dup 2: ifnull 38 5: astore_1 6: aload_1 7: astore_2 8: new #9 // class java/lang/StringBuilder 11: dup 12: invokespecial #13 // Method java/lang/StringBuilder."<init>":()V 15: ldc #15 // String Hello, 17: invokevirtual #19 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder; 20: aload_2 21: invokevirtual #19 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder; 24: invokevirtual #23 // Method java/lang/StringBuilder.toString:()Ljava/lang/String; 27: astore_3 28: getstatic #29 // Field java/lang/System.out:Ljava/io/PrintStream; 31: aload_3 32: invokevirtual #35 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V 35: goto 39 38: pop 39: return }
  182. $ javap -c KotlinSafeLetKt public final class KotlinSafeLetKt { public

    static final void sayHi(java.lang.String); Code: 0: aload_0 1: dup 2: ifnull 38 5: astore_1 6: aload_1 7: astore_2 8: new #9 // class java/lang/StringBuilder 11: dup 12: invokespecial #13 // Method java/lang/StringBuilder."<init>":()V 15: ldc #15 // String Hello, 17: invokevirtual #19 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder; 20: aload_2 21: invokevirtual #19 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder; 24: invokevirtual #23 // Method java/lang/StringBuilder.toString:()Ljava/lang/String; 27: astore_3 28: getstatic #29 // Field java/lang/System.out:Ljava/io/PrintStream; 31: aload_3 32: invokevirtual #35 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V 35: goto 39 38: pop 39: return }
  183. $ javap -c KotlinSafeLetKt public final class KotlinSafeLetKt { public

    static final void sayHi(java.lang.String); Code: 0: aload_0 1: dup 2: ifnull 38 5: astore_1 6: aload_1 7: astore_2 8: new #9 // class java/lang/StringBuilder 11: dup 12: invokespecial #13 // Method java/lang/StringBuilder."<init>":()V 15: ldc #15 // String Hello, 17: invokevirtual #19 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder; 20: aload_2 21: invokevirtual #19 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder; 24: invokevirtual #23 // Method java/lang/StringBuilder.toString:()Ljava/lang/String; 27: astore_3 28: getstatic #29 // Field java/lang/System.out:Ljava/io/PrintStream; 31: aload_3 32: invokevirtual #35 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V 35: goto 39 38: pop 39: return }
  184. $ javap -c KotlinSafeLetKt public final class KotlinSafeLetKt { public

    static final void sayHi(java.lang.String); Code: 0: aload_0 1: dup 2: ifnull 38 5: astore_1 6: aload_1 7: astore_2 8: new #9 // class java/lang/StringBuilder 11: dup 12: invokespecial #13 // Method java/lang/StringBuilder."<init>":()V 15: ldc #15 // String Hello, 17: invokevirtual #19 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder; 20: aload_2 21: invokevirtual #19 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder; 24: invokevirtual #23 // Method java/lang/StringBuilder.toString:()Ljava/lang/String; 27: astore_3 28: getstatic #29 // Field java/lang/System.out:Ljava/io/PrintStream; 31: aload_3 32: invokevirtual #35 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V 35: goto 39 38: pop 39: return }
  185. $ javap -c KotlinSafeLetKt public final class KotlinSafeLetKt { public

    static final void sayHi(java.lang.String); Code: 0: aload_0 1: dup 2: ifnull 38 5: astore_1 6: aload_1 7: astore_2 8: new #9 // class java/lang/StringBuilder 11: dup 12: invokespecial #13 // Method java/lang/StringBuilder."<init>":()V 15: ldc #15 // String Hello, 17: invokevirtual #19 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder; 20: aload_2 21: invokevirtual #19 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder; 24: invokevirtual #23 // Method java/lang/StringBuilder.toString:()Ljava/lang/String; 27: astore_3 28: getstatic #29 // Field java/lang/System.out:Ljava/io/PrintStream; 31: aload_3 32: invokevirtual #35 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V 35: goto 39 38: pop 39: return }
  186. $ javap -c KotlinSafeLetKt public final class KotlinSafeLetKt { public

    static final void sayHi(java.lang.String); Code: 0: aload_0 1: dup 2: ifnull 38 5: astore_1 6: aload_1 7: astore_2 8: new #9 // class java/lang/StringBuilder 11: dup 12: invokespecial #13 // Method java/lang/StringBuilder."<init>":()V 15: ldc #15 // String Hello, 17: invokevirtual #19 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder; 20: aload_2 21: invokevirtual #19 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder; 24: invokevirtual #23 // Method java/lang/StringBuilder.toString:()Ljava/lang/String; 27: astore_3 28: getstatic #29 // Field java/lang/System.out:Ljava/io/PrintStream; 31: aload_3 32: invokevirtual #35 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V 35: goto 39 38: pop 39: return }
  187. $ javap -c KotlinSafeLetKt public final class KotlinSafeLetKt { public

    static final void sayHi(java.lang.String); Code: 0: aload_0 1: dup 2: ifnull 38 5: astore_1 6: aload_1 7: astore_2 8: new #9 // class java/lang/StringBuilder 11: dup 12: invokespecial #13 // Method java/lang/StringBuilder."<init>":()V 15: ldc #15 // String Hello, 17: invokevirtual #19 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder; 20: aload_2 21: invokevirtual #19 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder; 24: invokevirtual #23 // Method java/lang/StringBuilder.toString:()Ljava/lang/String; 27: astore_3 28: getstatic #29 // Field java/lang/System.out:Ljava/io/PrintStream; 31: aload_3 32: invokevirtual #35 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V 35: goto 39 38: pop 39: return }
  188. $ javap -c KotlinSafeLetKt public final class KotlinSafeLetKt { public

    static final void sayHi(java.lang.String); Code: 0: aload_0 1: dup 2: ifnull 38 5: astore_1 6: aload_1 7: astore_2 8: new #9 // class java/lang/StringBuilder 11: dup 12: invokespecial #13 // Method java/lang/StringBuilder."<init>":()V 15: ldc #15 // String Hello, 17: invokevirtual #19 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder; 20: aload_2 21: invokevirtual #19 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder; 24: invokevirtual #23 // Method java/lang/StringBuilder.toString:()Ljava/lang/String; 27: astore_3 28: getstatic #29 // Field java/lang/System.out:Ljava/io/PrintStream; 31: aload_3 32: invokevirtual #35 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V 35: goto 39 38: pop 39: return }
  189. $ javap -c KotlinSafeLetKt public final class KotlinSafeLetKt { public

    static final void sayHi(java.lang.String); Code: 0: aload_0 1: dup 2: ifnull 38 5: astore_1 6: aload_1 7: astore_2 8: new #9 // class java/lang/StringBuilder 11: dup 12: invokespecial #13 // Method java/lang/StringBuilder."<init>":()V 15: ldc #15 // String Hello, 17: invokevirtual #19 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder; 20: aload_2 21: invokevirtual #19 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder; 24: invokevirtual #23 // Method java/lang/StringBuilder.toString:()Ljava/lang/String; 27: astore_3 28: getstatic #29 // Field java/lang/System.out:Ljava/io/PrintStream; 31: aload_3 32: invokevirtual #35 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V 35: goto 39 38: pop 39: return }
  190. $ javap -c KotlinSafeLetKt public final class KotlinSafeLetKt { public

    static final void sayHi(java.lang.String); Code: 0: aload_0 1: dup 2: ifnull 38 5: astore_1 6: aload_1 7: astore_2 8: new #9 // class java/lang/StringBuilder 11: dup 12: invokespecial #13 // Method java/lang/StringBuilder."<init>":()V 15: ldc #15 // String Hello, 17: invokevirtual #19 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder; 20: aload_2 21: invokevirtual #19 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder; 24: invokevirtual #23 // Method java/lang/StringBuilder.toString:()Ljava/lang/String; 27: astore_3 28: getstatic #29 // Field java/lang/System.out:Ljava/io/PrintStream; 31: aload_3 32: invokevirtual #35 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V 35: goto 39 38: pop 39: return }
  191. $ javap -c KotlinSafeLetKt public final class KotlinSafeLetKt { public

    static final void sayHi(java.lang.String); Code: 0: aload_0 1: dup 2: ifnull 38 5: astore_1 6: aload_1 7: astore_2 8: new #9 // class java/lang/StringBuilder 11: dup 12: invokespecial #13 // Method java/lang/StringBuilder."<init>":()V 15: ldc #15 // String Hello, 17: invokevirtual #19 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder; 20: aload_2 21: invokevirtual #19 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder; 24: invokevirtual #23 // Method java/lang/StringBuilder.toString:()Ljava/lang/String; 27: astore_3 28: getstatic #29 // Field java/lang/System.out:Ljava/io/PrintStream; 31: aload_3 32: invokevirtual #35 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V 35: goto 39 38: pop 39: return }
  192. $ mkdir proguarded $ java -jar proguard-base-5.3.3.jar \ -libraryjars /Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Home/jre/lib/rt.jar

    \ -libraryjars kotlin-stdlib-1.1.51.jar:annotations-15.0.jar \ -injars *.class \ -outjars proguarded
  193. $ mkdir proguarded $ java -jar proguard-base-5.3.3.jar \ -libraryjars /Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Home/jre/lib/rt.jar

    \ -libraryjars kotlin-stdlib-1.1.51.jar:annotations-15.0.jar \ -injars *.class \ -outjars proguarded \ -keep 'class ** { *; }'
  194. $ mkdir proguarded $ java -jar proguard-base-5.3.3.jar \ -libraryjars /Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Home/jre/lib/rt.jar

    \ -libraryjars kotlin-stdlib-1.1.51.jar:annotations-15.0.jar \ -injars *.class \ -outjars proguarded \ -keep 'class ** { *; }' $ tree . ├── KotlinSafeLet.kt ├── KotlinSafeLetKt.class ├── META-INF │ └── main.kotlin_module └── proguarded └── KotlinSafeLetKt.class
  195. $ javap -c proguarded/KotlinSafeLetKt.class public final class KotlinSafeLetKt { public

    static final void sayHi(java.lang.String); Code: 0: aload_0 1: ifnull 28 4: new #6 // class java/lang/StringBuilder 7: dup 8: ldc #1 // String Hello, 10: invokespecial #10 // Method java/lang/StringBuilder."<init>":(Ljava/lang/String;)V 13: aload_0 14: invokevirtual #11 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Lja 17: invokevirtual #12 // Method java/lang/StringBuilder.toString:()Ljava/lang/String; 20: astore_0 21: getstatic #8 // Field java/lang/System.out:Ljava/io/PrintStream; 24: aload_0 25: invokevirtual #9 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V 28: return }
  196. $ javap -c proguarded/KotlinSafeLetKt.class public final class KotlinSafeLetKt { public

    static final void sayHi(java.lang.String); Code: 0: aload_0 1: ifnull 28 4: new #6 // class java/lang/StringBuilder 7: dup 8: ldc #1 // String Hello, 10: invokespecial #10 // Method java/lang/StringBuilder."<init>":(Ljava/lang/String;)V 13: aload_0 14: invokevirtual #11 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Lja 17: invokevirtual #12 // Method java/lang/StringBuilder.toString:()Ljava/lang/String; 20: astore_0 21: getstatic #8 // Field java/lang/System.out:Ljava/io/PrintStream; 24: aload_0 25: invokevirtual #9 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V 28: return }
  197. $ javap -c proguarded/KotlinSafeLetKt.class public final class KotlinSafeLetKt { public

    static final void sayHi(java.lang.String); Code: 0: aload_0 1: ifnull 28 4: new #6 // class java/lang/StringBuilder 7: dup 8: ldc #1 // String Hello, 10: invokespecial #10 // Method java/lang/StringBuilder."<init>":(Ljava/lang/String;)V 13: aload_0 14: invokevirtual #11 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Lja 17: invokevirtual #12 // Method java/lang/StringBuilder.toString:()Ljava/lang/String; 20: astore_0 21: getstatic #8 // Field java/lang/System.out:Ljava/io/PrintStream; 24: aload_0 25: invokevirtual #9 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V 28: return }
  198. $ javap -c proguarded/KotlinSafeLetKt.class public final class KotlinSafeLetKt { public

    static final void sayHi(java.lang.String); Code: 0: aload_0 1: ifnull 28 4: new #6 // class java/lang/StringBuilder 7: dup 8: ldc #1 // String Hello, 10: invokespecial #10 // Method java/lang/StringBuilder."<init>":(Ljava/lang/String;)V 13: aload_0 14: invokevirtual #11 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Lja 17: invokevirtual #12 // Method java/lang/StringBuilder.toString:()Ljava/lang/String; 20: astore_0 21: getstatic #8 // Field java/lang/System.out:Ljava/io/PrintStream; 24: aload_0 25: invokevirtual #9 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V 28: return }
  199. $ javap -c proguarded/KotlinSafeLetKt.class public final class KotlinSafeLetKt { public

    static final void sayHi(java.lang.String); Code: 0: aload_0 1: ifnull 28 4: new #6 // class java/lang/StringBuilder 7: dup 8: ldc #1 // String Hello, 10: invokespecial #10 // Method java/lang/StringBuilder."<init>":(Ljava/lang/String;)V 13: aload_0 14: invokevirtual #11 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Lja 17: invokevirtual #12 // Method java/lang/StringBuilder.toString:()Ljava/lang/String; 20: astore_0 21: getstatic #8 // Field java/lang/System.out:Ljava/io/PrintStream; 24: aload_0 25: invokevirtual #9 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V 28: return }
  200. $ javap -c proguarded/KotlinSafeLetKt.class public final class KotlinSafeLetKt { public

    static final void sayHi(java.lang.String); Code: 0: aload_0 1: ifnull 28 4: new #6 // class java/lang/StringBuilder 7: dup 8: ldc #1 // String Hello, 10: invokespecial #10 // Method java/lang/StringBuilder."<init>":(Ljava/lang/String;)V 13: aload_0 14: invokevirtual #11 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Lja 17: invokevirtual #12 // Method java/lang/StringBuilder.toString:()Ljava/lang/String; 20: astore_0 21: getstatic #8 // Field java/lang/System.out:Ljava/io/PrintStream; 24: aload_0 25: invokevirtual #9 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V 28: return }
  201. $ javap -c proguarded/KotlinSafeLetKt.class public final class KotlinSafeLetKt { public

    static final void sayHi(java.lang.String); Code: 0: aload_0 1: ifnull 28 4: new #6 // class java/lang/StringBuilder 7: dup 8: ldc #1 // String Hello, 10: invokespecial #10 // Method java/lang/StringBuilder."<init>":(Ljava/lang/String;)V 13: aload_0 14: invokevirtual #11 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Lja 17: invokevirtual #12 // Method java/lang/StringBuilder.toString:()Ljava/lang/String; 20: astore_0 21: getstatic #8 // Field java/lang/System.out:Ljava/io/PrintStream; 24: aload_0 25: invokevirtual #9 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V 28: return }
  202. $ javap -c proguarded/KotlinSafeLetKt.class public final class KotlinSafeLetKt { public

    static final void sayHi(java.lang.String); Code: 0: aload_0 1: ifnull 28 4: new #6 // class java/lang/StringBuilder 7: dup 8: ldc #1 // String Hello, 10: invokespecial #10 // Method java/lang/StringBuilder."<init>":(Ljava/lang/String;)V 13: aload_0 14: invokevirtual #11 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Lja 17: invokevirtual #12 // Method java/lang/StringBuilder.toString:()Ljava/lang/String; 20: astore_0 21: getstatic #8 // Field java/lang/System.out:Ljava/io/PrintStream; 24: aload_0 25: invokevirtual #9 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V 28: return }
  203. $ javap -c proguarded/KotlinSafeLetKt.class public final class KotlinSafeLetKt { public

    static final void sayHi(java.lang.String); Code: 0: aload_0 1: ifnull 28 4: new #6 // class java/lang/StringBuilder 7: dup 8: ldc #1 // String Hello, 10: invokespecial #10 // Method java/lang/StringBuilder."<init>":(Ljava/lang/String;)V 13: aload_0 14: invokevirtual #11 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Lja 17: invokevirtual #12 // Method java/lang/StringBuilder.toString:()Ljava/lang/String; 20: astore_0 21: getstatic #8 // Field java/lang/System.out:Ljava/io/PrintStream; 24: aload_0 25: invokevirtual #9 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V 28: return }
  204. $ javap -c proguarded/KotlinSafeLetKt.class public final class KotlinSafeLetKt { public

    static final void sayHi(java.lang.String); Code: 0: aload_0 1: ifnull 28 4: new #6 // class java/lang/StringBuilder 7: dup 8: ldc #1 // String Hello, 10: invokespecial #10 // Method java/lang/StringBuilder."<init>":(Ljava/lang/String;)V 13: aload_0 14: invokevirtual #11 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Lja 17: invokevirtual #12 // Method java/lang/StringBuilder.toString:()Ljava/lang/String; 20: astore_0 21: getstatic #8 // Field java/lang/System.out:Ljava/io/PrintStream; 24: aload_0 25: invokevirtual #9 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V 28: return }
  205. $ javap -c proguarded/KotlinSafeLetKt.class public final class KotlinSafeLetKt { public

    static final void sayHi(java.lang.String); Code: 0: aload_0 1: ifnull 28 4: new #6 // class java/lang/StringBuilder 7: dup 8: ldc #1 // String Hello, 10: invokespecial #10 // Method java/lang/StringBuilder."<init>":(Ljava/lang/String;)V 13: aload_0 14: invokevirtual #11 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Lja 17: invokevirtual #12 // Method java/lang/StringBuilder.toString:()Ljava/lang/String; 20: astore_0 21: getstatic #8 // Field java/lang/System.out:Ljava/io/PrintStream; 24: aload_0 25: invokevirtual #9 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V 28: return }
  206. $ javap -c proguarded/KotlinSafeLetKt.class public final class KotlinSafeLetKt { public

    static final void sayHi(java.lang.String); Code: 0: aload_0 1: ifnull 28 4: new #6 // class java/lang/StringBuilder 7: dup 8: ldc #1 // String Hello, 10: invokespecial #10 // Method java/lang/StringBuilder."<init>":(Ljava/lang/String;)V 13: aload_0 14: invokevirtual #11 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Lja 17: invokevirtual #12 // Method java/lang/StringBuilder.toString:()Ljava/lang/String; 20: astore_0 21: getstatic #8 // Field java/lang/System.out:Ljava/io/PrintStream; 24: aload_0 25: invokevirtual #9 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V 28: return }
  207. $ javap -c proguarded/KotlinSafeLetKt.class public final class KotlinSafeLetKt { public

    static final void sayHi(java.lang.String); Code: 0: aload_0 1: ifnull 28 4: new #6 // class java/lang/StringBuilder 7: dup 8: ldc #1 // String Hello, 10: invokespecial #10 // Method java/lang/StringBuilder."<init>":(Ljava/lang/String;)V 13: aload_0 14: invokevirtual #11 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Lja 17: invokevirtual #12 // Method java/lang/StringBuilder.toString:()Ljava/lang/String; 20: astore_0 21: getstatic #8 // Field java/lang/System.out:Ljava/io/PrintStream; 24: aload_0 25: invokevirtual #9 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V 28: return }
  208. $ javap -c proguarded/KotlinSafeLetKt.class public final class KotlinSafeLetKt { public

    static final void sayHi(java.lang.String); Code: 0: aload_0 1: ifnull 28 4: new #6 // class java/lang/StringBuilder 7: dup 8: ldc #1 // String Hello, 10: invokespecial #10 // Method java/lang/StringBuilder."<init>":(Ljava/lang/String;)V 13: aload_0 14: invokevirtual #11 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Lja 17: invokevirtual #12 // Method java/lang/StringBuilder.toString:()Ljava/lang/String; 20: astore_0 21: getstatic #8 // Field java/lang/System.out:Ljava/io/PrintStream; 24: aload_0 25: invokevirtual #9 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V 28: return }
  209. public static final void sayHi(java.lang.String); 0: aload_0 1: ifnull 28

    4: new #6 7: dup 8: ldc #1 10: invokespecial #10 13: aload_0 14: invokevirtual #11 17: invokevirtual #12 20: astore_0 21: getstatic #8 24: aload_0 25: invokevirtual #9 28: return kotlinc: kotlinc+ProGuard: 0: aload_0 1: dup 2: ifnull 38 5: astore_1 6: aload_1 7: astore_2 8: new #9 11: dup 12: invokespecial #13 15: ldc #15 17: invokevirtual #19 20: aload_2 21: invokevirtual #19 24: invokevirtual #23 27: astore_3 28: getstatic #29 31: aload_3 32: invokevirtual #35 35: goto 39 38: pop 39: return
  210. public static final void sayHi(java.lang.String); 0: aload_0 1: ifnull 28

    4: new #6 7: dup 8: ldc #1 10: invokespecial #10 13: aload_0 14: invokevirtual #11 17: invokevirtual #12 20: astore_0 21: getstatic #8 24: aload_0 25: invokevirtual #9 28: return kotlinc: kotlinc+ProGuard: 0: aload_0 1: dup 2: ifnull 38 5: astore_1 6: aload_1 7: astore_2 8: new #9 11: dup 12: invokespecial #13 15: ldc #15 17: invokevirtual #19 20: aload_2 21: invokevirtual #19 24: invokevirtual #23 27: astore_3 28: getstatic #29 31: aload_3 32: invokevirtual #35 35: goto 39 38: pop 39: return
  211. $ mkdir dexed $ $ANDROID_HOME/build-tools/27.0.0/dx \ --dex \ --output=dexed \

    proguarded $ tree . ├── KotlinSafeLet.kt ├── KotlinSafeLetKt.class ├── META-INF │ └── main.kotlin_module ├── dexed │ └── classes.dex └── proguarded └── KotlinSafeLetKt.class
  212. $ $ANDROID_HOME/build-tools/27.0.0/dexdump -d dexed/classes.dex Opened 'dex/classes.dex', DEX version '035' Class

    #0 - Class descriptor : 'LKotlinSafeLetKt;' Access flags : 0x0011 (PUBLIC FINAL) Superclass : 'Ljava/lang/Object;' Interfaces - Static fields - Instance fields - Direct methods - #0 : (in LKotlinSafeLetKt;) name : 'sayHi' type : '(Ljava/lang/String;)V' access : 0x0019 (PUBLIC STATIC FINAL) code - registers : 3 ins : 1 outs : 2 insns size : 23 16-bit code units 000150: | 000160: 3802 1600 | // +0016 000164: 2200 0400 | // type@0004 000168: 1a01 0100 | // string@0001 00016c: 7020 0200 1000 | // method@0002 000172: 6e20 0300 2000 | 000178: 0c00 | 00017a: 6e10 0400 0000 | // method@0004 000180: 0c00 | 000182: 6201 0000 | // field@0000 000186: 6e20 0100 0100 | // method@0001 00018c: 0e00 | catches : (none) positions : locals : Virtual methods - source_file_idx : -1 (unknown) [000150] KotlinSafeLetKt.sayHi:(Ljava/lang/String;)V 0000: if-eqz v2, 0016 0002: new-instance v0, Ljava/lang/StringBuilder; 0004: const-string v1, "Hello, " 0006: invoke-direct {v0, v1}, Ljava/lang/StringBuilder;.<init>:(Ljava/lang/String;)V 0009: invoke-virtual {v0, v2}, Ljava/lang/StringBuilder;.append:(Ljava/lang/String;)Ljava/lang/StringBui 000c: move-result-object v0 000d: invoke-virtual {v0}, Ljava/lang/StringBuilder;.toString:()Ljava/lang/String; 0010: move-result-object v0 0011: sget-object v1, Ljava/lang/System;.out:Ljava/io/PrintStream; 0013: invoke-virtual {v1, v0}, Ljava/io/PrintStream;.println:(Ljava/lang/Object;)V 0016: return-void
  213. $ $ANDROID_HOME/build-tools/27.0.0/dexdump -d dexed/classes.dex Opened 'dex/classes.dex', DEX version '035' Class

    #0 - Class descriptor : 'LKotlinSafeLetKt;' Access flags : 0x0011 (PUBLIC FINAL) Superclass : 'Ljava/lang/Object;' Interfaces - Static fields - Instance fields - Direct methods - #0 : (in LKotlinSafeLetKt;) name : 'sayHi' type : '(Ljava/lang/String;)V' access : 0x0019 (PUBLIC STATIC FINAL) code - registers : 3 ins : 1 outs : 2 insns size : 23 16-bit code units 000150: | 000160: 3802 1600 | // +0016 000164: 2200 0400 | // type@0004 000168: 1a01 0100 | // string@0001 00016c: 7020 0200 1000 | // method@0002 000172: 6e20 0300 2000 | 000178: 0c00 | 00017a: 6e10 0400 0000 | // method@0004 000180: 0c00 | 000182: 6201 0000 | // field@0000 000186: 6e20 0100 0100 | // method@0001 00018c: 0e00 | catches : (none) positions : locals : Virtual methods - source_file_idx : -1 (unknown) [000150] KotlinSafeLetKt.sayHi:(Ljava/lang/String;)V 0000: if-eqz v2, 0016 0002: new-instance v0, Ljava/lang/StringBuilder; 0004: const-string v1, "Hello, " 0006: invoke-direct {v0, v1}, Ljava/lang/StringBuilder;.<init>:(Ljava/lang/String;)V 0009: invoke-virtual {v0, v2}, Ljava/lang/StringBuilder;.append:(Ljava/lang/String;)Ljava/lang/StringBui 000c: move-result-object v0 000d: invoke-virtual {v0}, Ljava/lang/StringBuilder;.toString:()Ljava/lang/String; 0010: move-result-object v0 0011: sget-object v1, Ljava/lang/System;.out:Ljava/io/PrintStream; 0013: invoke-virtual {v1, v0}, Ljava/io/PrintStream;.println:(Ljava/lang/Object;)V 0016: return-void
  214. [000150] KotlinSafeLetKt.sayHi:(Ljava/lang/String;)V 0000: if-eqz v2, 0016 0002: new-instance v0, Ljava/lang/StringBuilder;

    0004: const-string v1, "Hello, " 0006: invoke-direct {v0, v1}, Ljava/lang/StringBuilder;.<init>:(Ljava/lang/String;)V 0009: invoke-virtual {v0, v2}, Ljava/lang/StringBuilder;.append:(Ljava/lang/String;)Ljava/lan 000c: move-result-object v0 000d: invoke-virtual {v0}, Ljava/lang/StringBuilder;.toString:()Ljava/lang/String; 0010: move-result-object v0 0011: sget-object v1, Ljava/lang/System;.out:Ljava/io/PrintStream; 0013: invoke-virtual {v1, v0}, Ljava/io/PrintStream;.println:(Ljava/lang/Object;)V 0016: return-void
  215. [000150] KotlinSafeLetKt.sayHi:(Ljava/lang/String;)V 0000: if-eqz v2, 0016 0002: new-instance v0, Ljava/lang/StringBuilder;

    0004: const-string v1, "Hello, " 0006: invoke-direct {v0, v1}, Ljava/lang/StringBuilder;.<init>:(Ljava/lang/String;)V 0009: invoke-virtual {v0, v2}, Ljava/lang/StringBuilder;.append:(Ljava/lang/String;)Ljava/lan 000c: move-result-object v0 000d: invoke-virtual {v0}, Ljava/lang/StringBuilder;.toString:()Ljava/lang/String; 0010: move-result-object v0 0011: sget-object v1, Ljava/lang/System;.out:Ljava/io/PrintStream; 0013: invoke-virtual {v1, v0}, Ljava/io/PrintStream;.println:(Ljava/lang/Object;)V 0016: return-void
  216. $ cat Java8.java public class Java8 { public static Runnable

    sayHi(String name) { return () -> System.out.println("Hello, " + name); } } $ javac Java8.java
  217. $ java -jar d8/build/libs/d8.jar --help Usage: d8 [options] <input-files> where

    <input-files> are any combination of dex, class, zip, jar, or apk files and options are: --debug # Compile with debugging information (default). --release # Compile without debugging information. --output <file> # Output result in <outfile>. # <file> must be an existing directory or a zip file. --lib <file> # Add <file> as a library resource. --classpath <file> # Add <file> as a classpath resource. --min-api # Minimum Android API level compatibility --intermediate # Compile an intermediate result intended for later # merging. --file-per-class # Produce a separate dex file per class --main-dex-list <file> # List of classes to place in the primary dex file. --version # Print the version of d8. --help # Print this message.
  218. $ mkdir d8ed $ java -jar d8/build/libs/d8.jar --release \ --output

    d8ed \ *.class $ tree . ├── Java8.class ├── Java8.java ├── d8ed │ └── classes.dex ├── depot_tools │ └── <snipped> └── r8 └── <snipped>
  219. $ $ANDROID_HOME/build-tools/27.0.0/dexdump -d d8ed/classes.dex Opened 'd8/classes.dex', DEX version '035' Class

    #0 - Class descriptor : 'LJava8;' Access flags : 0x0001 (PUBLIC) Superclass : 'Ljava/lang/Object;' Interfaces - Static fields - Instance fields - Direct methods - #0 : (in LJava8;) name : '<init>' type : '()V' access : 0x10001 (PUBLIC CONSTRUCTOR) code - registers : 1 ins : 1 outs : 1 insns size : 4 16-bit code units 000228: |[000228] Java8.<init>:()V 000238: 7010 0600 0000 |0000: invoke-direct {v0}, Ljava/lang/Object;.<init>:()V // method@0006 00023e: 0e00 |0003: return-void catches : (none) positions : 0x0000 line=1 locals : 0x0000 - 0x0004 reg=0 this LJava8; #1 : (in LJava8;) name : 'sayHi' type : '(Ljava/lang/String;)Ljava/lang/Runnable;' access : 0x0009 (PUBLIC STATIC) code - registers : 2 ins : 1 outs : 2 insns size : 6 16-bit code units 00020c: |[00020c] Java8.sayHi:(Ljava/lang/String;)Ljava/lang/Runnable; 00021c: 2200 0000 |0000: new-instance v0, L-$$Lambda$Java8$W0ehijVa4A390Y5RF_BxnOCuvMs; // type@0000 000220: 7020 0000 1000 |0002: invoke-direct {v0, v1}, L-$$Lambda$Java8$W0ehijVa4A390Y5RF_BxnOCuvMs;.<init>:(Ljava/lang/String;)V // method@0000 000226: 1100 |0005: return-object v0 catches : (none) positions : 0x0000 line=3 locals : #2 : (in LJava8;) name : 'lambda$sayHi$0' type : '(Ljava/lang/String;)V' access : 0x1008 (STATIC SYNTHETIC) code - registers : 4 ins : 1 outs : 2 insns size : 23 16-bit code units 000240: |[000240] Java8.lambda$sayHi$0:(Ljava/lang/String;)V 000250: 6200 0100 |0000: sget-object v0, Ljava/lang/System;.out:Ljava/io/PrintStream; // field@0001 000254: 2201 0600 |0002: new-instance v1, Ljava/lang/StringBuilder; // type@0006 000258: 7010 0700 0100 |0004: invoke-direct {v1}, Ljava/lang/StringBuilder;.<init>:()V // method@0007 00025e: 1a02 0100 |0007: const-string v2, "Hello, " // string@0001 000262: 6e20 0800 2100 |0009: invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;.append:(Ljava/lang/String;)Ljava/lang/StringBuilder; // method@0008 000268: 6e20 0800 3100 |000c: invoke-virtual {v1, v3}, Ljava/lang/StringBuilder;.append:(Ljava/lang/String;)Ljava/lang/StringBuilder; // method@0008 00026e: 6e10 0900 0100 |000f: invoke-virtual {v1}, Ljava/lang/StringBuilder;.toString:()Ljava/lang/String; // method@0009 000274: 0c03 |0012: move-result-object v3 000276: 6e20 0500 3000 |0013: invoke-virtual {v0, v3}, Ljava/io/PrintStream;.println:(Ljava/lang/String;)V // method@0005 00027c: 0e00 |0016: return-void catches : (none) positions : 0x0000 line=3 locals : Class #1 - Class descriptor : 'L-$$Lambda$Java8$W0ehijVa4A390Y5RF_BxnOCuvMs;' Access flags : 0x1010 (FINAL SYNTHETIC) Superclass : 'Ljava/lang/Object;' Interfaces - #0 : 'Ljava/lang/Runnable;' Static fields - Instance fields - #0 : (in L-$$Lambda$Java8$W0ehijVa4A390Y5RF_BxnOCuvMs;) name : 'f$0' type : 'Ljava/lang/String;' access : 0x1012 (PRIVATE FINAL SYNTHETIC) Direct methods - #0 : (in L-$$Lambda$Java8$W0ehijVa4A390Y5RF_BxnOCuvMs;) name : '<init>' type : '(Ljava/lang/String;)V' access : 0x11001 (PUBLIC SYNTHETIC CONSTRUCTOR) code - registers : 2 ins : 2 outs : 1 insns size : 6 16-bit code units 0001d4: |[0001d4] -..Lambda.Java8.W0ehijVa4A390Y5RF_BxnOCuvMs.<init>:(Ljava/lang/String;)V 0001e4: 7010 0600 0000 |0000: invoke-direct {v0}, Ljava/lang/Object;.<init>:()V // method@0006 0001ea: 5b01 0000 |0003: iput-object v1, v0, L-$$Lambda$Java8$W0ehijVa4A390Y5RF_BxnOCuvMs;.f$0:Ljava/lang/String; // field@0000 0001ee: 0e00 |0005: return-void catches : (none) positions : locals : Virtual methods - #0 : (in L-$$Lambda$Java8$W0ehijVa4A390Y5RF_BxnOCuvMs;) name : 'run' type : '()V' access : 0x0011 (PUBLIC FINAL) code - registers : 1 ins : 1 outs : 1 insns size : 6 16-bit code units 0001f0: |[0001f0] -..Lambda.Java8.W0ehijVa4A390Y5RF_BxnOCuvMs.run:()V 000200: 5400 0000 |0000: iget-object v0, v0, L-$$Lambda$Java8$W0ehijVa4A390Y5RF_BxnOCuvMs;.f$0:Ljava/lang/String; // field@0000 000204: 7110 0300 0000 |0002: invoke-static {v0}, LJava8;.lambda$sayHi$0:(Ljava/lang/String;)V // method@0003 00020a: 0e00 |0005: return-void catches : (none) positions : locals : source_file_idx : 17 (lambda) Virtual methods - source_file_idx : 2 (Java8.java)
  220. Class #0 Class descriptor : 'LJava8;' Superclass : 'Ljava/lang/Object;' Direct

    methods #0 : (in LJava8;) name : '<init>' type : '()V' #1 : (in LJava8;) name : 'sayHi' type : '(Ljava/lang/String;)Ljava/lang/Runnable;' #2 : (in LJava8;) name : 'lambda$sayHi$0' type : '(Ljava/lang/String;)V'
  221. Class #0 Class descriptor : 'LJava8;' Superclass : 'Ljava/lang/Object;' Direct

    methods #0 : (in LJava8;) name : '<init>' type : '()V' #1 : (in LJava8;) name : 'sayHi' type : '(Ljava/lang/String;)Ljava/lang/Runnable;' #2 : (in LJava8;) name : 'lambda$sayHi$0' type : '(Ljava/lang/String;)V'
  222. Class #1 Class descriptor : 'L-$$Lambda$Java8$W0ehijVa4A390Y5RF_BxnOCuvMs;' Superclass : 'Ljava/lang/Object;' Interfaces

    #0 : 'Ljava/lang/Runnable;' Instance fields #0 name : 'f$0' type : 'Ljava/lang/String;' Direct methods #0 name : '<init>' type : '(Ljava/lang/String;)V' Virtual methods #0 name : 'run' type : '()V'
  223. Class #1 Class descriptor : 'L-$$Lambda$Java8$W0ehijVa4A390Y5RF_BxnOCuvMs;' Superclass : 'Ljava/lang/Object;' Interfaces

    #0 : 'Ljava/lang/Runnable;' Instance fields #0 name : 'f$0' type : 'Ljava/lang/String;' Direct methods #0 name : '<init>' type : '(Ljava/lang/String;)V' Virtual methods #0 name : 'run' type : '()V'
  224. $ javap -c KotlinSafeLetKt public final class KotlinSafeLetKt { public

    static final void sayHi(java.lang.String); Code: 0: aload_0 1: dup 2: ifnull 38 5: astore_1 6: aload_1 7: astore_2 8: new #9 // class java/lang/StringBuilder 11: dup 12: invokespecial #13 // Method java/lang/StringBuilder."<init>":()V 15: ldc #15 // String Hello, 17: invokevirtual #19 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder; 20: aload_2 21: invokevirtual #19 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder; 24: invokevirtual #23 // Method java/lang/StringBuilder.toString:()Ljava/lang/String; 27: astore_3 28: getstatic #29 // Field java/lang/System.out:Ljava/io/PrintStream; 31: aload_3 32: invokevirtual #35 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V 35: goto 39 38: pop 39: return }
  225. $ d8/build/libs/d8.jar --release \ --output d8ed \ KotlinSafeLetKt.class $ $ANDROID_HOME/build-tools/27.0.0/dexdump

    -d d8ed/classes.dex Opened 'd8/classes.dex', DEX version '035' Class #0 - Class descriptor : 'LKotlinSafeLetKt;' Access flags : 0x0011 (PUBLIC FINAL) Superclass : 'Ljava/lang/Object;' Interfaces - Static fields - Instance fields - Direct methods - #0 : (in LKotlinSafeLetKt;) name : 'sayHi' type : '(Ljava/lang/String;)V' access : 0x0019 (PUBLIC STATIC FINAL) code - registers : 3 ins : 1 outs : 2 insns size : 25 16-bit code units 0001a4: |[0001a4] KotlinSafeLetKt.sayHi:(Ljava/lang/String;)V 0001b4: 3802 1800 |0000: if-eqz v2, 0018 // +0018 0001b8: 2200 0500 |0002: new-instance v0, Ljava/lang/StringBuilder; // type@0005 0001bc: 7010 0200 0000 |0004: invoke-direct {v0}, Ljava/lang/StringBuilder;.<init>:()V // method@0002 0001c2: 1a01 0300 |0007: const-string v1, "Hello, " // string@0003 0001c6: 6e20 0300 1000 |0009: invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;.append:(Ljava/lang/String;)Ljava/lang/StringBuilder; // method@0003 0001cc: 6e20 0300 2000 |000c: invoke-virtual {v0, v2}, Ljava/lang/StringBuilder;.append:(Ljava/lang/String;)Ljava/lang/StringBuilder; // method@0003 0001d2: 6e10 0400 0000 |000f: invoke-virtual {v0}, Ljava/lang/StringBuilder;.toString:()Ljava/lang/String; // method@0004 0001d8: 0c02 |0012: move-result-object v2 0001da: 6200 0000 |0013: sget-object v0, Ljava/lang/System;.out:Ljava/io/PrintStream; // field@0000 0001de: 6e20 0100 2000 |0015: invoke-virtual {v0, v2}, Ljava/io/PrintStream;.println:(Ljava/lang/Object;)V // method@0001 0001e4: 0e00 |0018: return-void catches : (none) positions : 0x0002 line=2 locals : Virtual methods - source_file_idx : 4 (KotlinSafeLet.kt)
  226. [0001a4] KotlinSafeLetKt.sayHi:(Ljava/lang/String;)V 0000: if-eqz v2, 0018 0002: new-instance v0, Ljava/lang/StringBuilder;

    0004: invoke-direct {v0}, Ljava/lang/StringBuilder;.<init>:()V 0007: const-string v1, "Hello, " 0009: invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;.append:(Ljava/lang/String;)Ljava/lan 000c: invoke-virtual {v0, v2}, Ljava/lang/StringBuilder;.append:(Ljava/lang/String;)Ljava/lan 000f: invoke-virtual {v0}, Ljava/lang/StringBuilder;.toString:()Ljava/lang/String; 0012: move-result-object v2 0013: sget-object v0, Ljava/lang/System;.out:Ljava/io/PrintStream; 0015: invoke-virtual {v0, v2}, Ljava/io/PrintStream;.println:(Ljava/lang/Object;)V 0018: return-void
  227. [0001a4] KotlinSafeLetKt.sayHi:(Ljava/lang/String;)V 0000: if-eqz v2, 0018 0002: new-instance v0, Ljava/lang/StringBuilder;

    0004: invoke-direct {v0}, Ljava/lang/StringBuilder;.<init>:()V 0007: const-string v1, "Hello, " 0009: invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;.append:(Ljava/lang/String;)Ljava/lan 000c: invoke-virtual {v0, v2}, Ljava/lang/StringBuilder;.append:(Ljava/lang/String;)Ljava/lan 000f: invoke-virtual {v0}, Ljava/lang/StringBuilder;.toString:()Ljava/lang/String; 0012: move-result-object v2 0013: sget-object v0, Ljava/lang/System;.out:Ljava/io/PrintStream; 0015: invoke-virtual {v0, v2}, Ljava/io/PrintStream;.println:(Ljava/lang/Object;)V 0018: return-void
  228. [0001a4] KotlinSafeLetKt.sayHi:(Ljava/lang/String;)V 0000: if-eqz v2, 0018 0002: new-instance v0, Ljava/lang/StringBuilder;

    0004: invoke-direct {v0}, Ljava/lang/StringBuilder;.<init>:()V 0007: const-string v1, "Hello, " 0009: invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;.append:(Ljava/lang/String;)Ljava/lan 000c: invoke-virtual {v0, v2}, Ljava/lang/StringBuilder;.append:(Ljava/lang/String;)Ljava/lan 000f: invoke-virtual {v0}, Ljava/lang/StringBuilder;.toString:()Ljava/lang/String; 0012: move-result-object v2 0013: sget-object v0, Ljava/lang/System;.out:Ljava/io/PrintStream; 0015: invoke-virtual {v0, v2}, Ljava/io/PrintStream;.println:(Ljava/lang/Object;)V 0018: return-void
  229. $ tree app/build app/build │ ├── intermediates │ ├── classes

    class files for Java + apt sources │ │ │ └── transforms │ ├── desugar backported language features │ ├── dex dalvik bytecode │ └── proguard stripped, optimized, obfuscated classes │ ├── outputs │ └── apk final APKs │ └── tmp └── kotlin-classes class files for Kotlin sources
  230. $ cat Intrinsic.java class Intrinsic { static double doMath(double x,

    int y) { return Math.sqrt(x) + y; } } $ javac Intrinsic.java $ javap -c Intrinsic class Intrinsic { static double doMath(double, double); Code: 0: dload_0 1: invokestatic #2 // Method java/lang/Math.sqrt:(D)D 4: dload_2 5: dadd 6: dreturn }
  231. $ cat Intrinsic.java class Intrinsic { static double doMath(double x,

    int y) { return Math.sqrt(x) + y; } } $ javac Intrinsic.java $ javap -c Intrinsic class Intrinsic { static double doMath(double, double); Code: 0: dload_0 1: invokestatic #2 // Method java/lang/Math.sqrt:(D)D 4: dload_2 5: dadd 6: dreturn }
  232. $ $ANDROID_HOME/build-tools/27.0.0/dx --dex --output . *.class $ $ANDROID_HOME/build-tools/27.0.0/dexdump -d classes.dex

    Opened 'classes.dex', DEX version '035' Class #0 - Class descriptor : 'LIntrinsic;' Access flags : 0x0000 () Superclass : 'Ljava/lang/Object;' Direct methods - #0 : (in LIntrinsic;) name : 'doMath' type : '(DD)D' access : 0x0009 (PUBLIC STATIC) code - registers : 6 ins : 4 outs : 2 insns size : 6 16-bit code units 00012c: |[00012c] Intrinsic.doMath:(DD)D 00013c: 7120 0200 3200 |0000: invoke-static {v2, v3}, Ljava/lang/Math;.sqrt:(D)D // method@0002 000142: 0b00 |0003: move-result-wide v0 000144: cb40 |0004: add-double/2addr v0, v4 000146: 1000 |0005: return-wide v0 catches : (none) positions : 0x0000 line=3 locals : Virtual methods - source_file_idx : 4 (Intrinsic.java)
  233. $ $ANDROID_HOME/build-tools/27.0.0/dx --dex --output . *.class $ $ANDROID_HOME/build-tools/27.0.0/dexdump -d classes.dex

    Opened 'classes.dex', DEX version '035' Class #0 - Class descriptor : 'LIntrinsic;' Access flags : 0x0000 () Superclass : 'Ljava/lang/Object;' Direct methods - #0 : (in LIntrinsic;) name : 'doMath' type : '(DD)D' access : 0x0009 (PUBLIC STATIC) code - registers : 6 ins : 4 outs : 2 insns size : 6 16-bit code units 00012c: |[00012c] Intrinsic.doMath:(DD)D 00013c: 7120 0200 3200 |0000: invoke-static {v2, v3}, Ljava/lang/Math;.sqrt:(D)D // method@0002 000142: 0b00 |0003: move-result-wide v0 000144: cb40 |0004: add-double/2addr v0, v4 000146: 1000 |0005: return-wide v0 catches : (none) positions : 0x0000 line=3 locals : Virtual methods - source_file_idx : 4 (Intrinsic.java)
  234. $ adb push out/classes.dex /sdcard/classes.dex $ adb shell dex2oat \

    --dex-file=/sdcard/classes.dex \ --out-file=/sdcard/classes.oat
  235. $ adb push out/classes.dex /sdcard/classes.dex $ adb shell dex2oat \

    --dex-file=/sdcard/classes.dex \ --out-file=/sdcard/classes.oat $ adb shell oatdump --oat-file=/sdcard/classes.oat
  236. MAGIC: oat 131 LOCATION: /sdcard/classes.oat CHECKSUM: 0x77f8e67b INSTRUCTION SET: Thumb2

    INSTRUCTION SET FEATURES: -div,-atomic_ldrd_strd,-armv8a DEX FILE COUNT: 1 EXECUTABLE OFFSET: 0x00001000 INTERPRETER TO INTERPRETER BRIDGE OFFSET: 0x00000000 INTERPRETER TO COMPILED CODE BRIDGE OFFSET: 0x00000000 JNI DLSYM LOOKUP OFFSET: 0x00000000 QUICK GENERIC JNI TRAMPOLINE OFFSET: 0x00000000 QUICK IMT CONFLICT TRAMPOLINE OFFSET: 0x00000000 QUICK RESOLUTION TRAMPOLINE OFFSET: 0x00000000 QUICK TO INTERPRETER BRIDGE OFFSET: 0x00000000 IMAGE PATCH DELTA: 16551936 (0x00fc9000) IMAGE FILE LOCATION OAT CHECKSUM: 0xb98145bd IMAGE FILE LOCATION OAT BEGIN: 0x717d3000 KEY VALUE STORE: classpath = PCL[] compiler-filter = speed concurrent-copying = true debuggable = false dex2oat-cmdline = --dex-file=/sdcard/classes.dex --oat-file=/sdcard/classes.oat dex2oat-host = Arm image-location = /data/dalvik-cache/arm/system@[email protected]:/data/dalvik-cache/arm/system@[email protected]:/data/dalvik-cache/arm/system@[email protected]:/data/dalvik-cache/arm/system@[email protected]:/data/dalvik-cache/arm/system@[email protected]:/data/dalvik-cache/arm/system@[email protected]:/data/dalvik-cache/arm/system@[email protected]:/data/dalvik-cache/arm/system@[email protected]:/data/dalvik-cache/arm/system@[email protected]:/data/dalvik-cache/arm/system@[email protected]:/data/dalvik-cache/arm/ system@[email protected]:/data/dalvik-cache/arm/system@[email protected]:/data/dalvik-cache/arm/system@[email protected]:/data/dalvik-cache/arm/system@[email protected]:/data/dalvik-cache/arm/system@[email protected]:/data/dalvik-cache/arm/system@[email protected] native-debuggable = false pic = false SIZE: 4162 Dex file data for /sdcard/classes.dex Num string ids: 11 Num method ids: 4 Num field ids: 0 Num type ids: 5 Num class defs: 1 Unique strings loaded from dex code: 0 Total strings loaded from dex code: 0 Number of unique dex code items: 2 Total number of dex code bytes: 20 Layout data SectionTypeCode:LayoutTypeSometimesUsed(0-0) LayoutTypeStartupOnly(0-0) LayoutTypeHot(0-0) LayoutTypeUsedOnce(0-0) LayoutTypeUnused(0-0) SectionTypeStrings:LayoutTypeSometimesUsed(0-0) LayoutTypeStartupOnly(0-0) LayoutTypeHot(0-0) LayoutTypeUsedOnce(0-0) LayoutTypeUnused(0-0) Cumulative dex file data Num string ids: 11 Num method ids: 4 Num field ids: 0 Num type ids: 5 Num class defs: 1 Unique strings loaded from dex code: 0 Total strings loaded from dex code: 0 Number of unique dex code items: 2 Total number of dex code bytes: 20 Dependencies of /sdcard/classes.dex: Ljava/lang/Math; must be resolved with access flags 1 Ljava/lang/Object; must be resolved with access flags 1 Ljava/lang/Math;->sqrt(D)D is expected to be in class Ljava/lang/Math;, have the access flags 9 Ljava/lang/Object;-><init>()V is expected to be in class Ljava/lang/Object;, have the access flags 1 OatDexFile: location: /sdcard/classes.dex checksum: 0x52d84567 dex-file: 0x0000001c..0x0000028b type-table: 0x00000520..0x00000527 0: LIntrinsic; (offset=0x0000057c) (type_idx=1) (StatusInitialized) (OatClassAllCompiled) 0: void Intrinsic.<init>() (dex_method_idx=0) DEX CODE: 0x0000: 7010 0300 0000 | invoke-direct {v0}, void java.lang.Object.<init>() // method@3 0x0003: 0e00 | return-void OatMethodOffsets (offset=0x00000580) code_offset: 0x00001019 OatQuickMethodHeader (offset=0x00001000) vmap_table: (offset=0x00000a90) Optimized CodeInfo (number_of_dex_registers=1, number_of_stack_maps=0) StackMapEncoding (native_pc_bit_offset=0, dex_pc_bit_offset=0, dex_register_map_bit_offset=1, inline_info_bit_offset=1, register_mask_bit_offset=1, stack_mask_index_bit_offset=1, total_bit_size=1) DexRegisterLocationCatalog (number_of_entries=0, size_in_bytes=0) QuickMethodFrameInfo frame_size_in_bytes: 0 core_spill_mask: 0x00004020 (r5, r14) fp_spill_mask: 0x00000000 vr_stack_locations: ins: v0[sp + #4] method*: v1[sp + #0] outs: v0[sp + #4] CODE: (code_offset=0x00001019 size_offset=0x00001014 size=2)... 0x00001018: 4770 bx lr 1: double Intrinsic.doMath(double, double) (dex_method_idx=1) DEX CODE: 0x0000: 7120 0200 3200 | invoke-static {v2, v3}, double java.lang.Math.sqrt(double) // method@2 0x0003: 0b00 | move-result-wide v0 0x0004: cb40 | add-double/2addr v0, v4 0x0005: 1000 | return-wide v0 OatMethodOffsets (offset=0x00000584) code_offset: 0x00001039 OatQuickMethodHeader (offset=0x00001020) vmap_table: (offset=0x00000ab0) Optimized CodeInfo (number_of_dex_registers=6, number_of_stack_maps=0) StackMapEncoding (native_pc_bit_offset=0, dex_pc_bit_offset=0, dex_register_map_bit_offset=1, inline_info_bit_offset=1, register_mask_bit_offset=1, stack_mask_index_bit_offset=1, total_bit_size=1) DexRegisterLocationCatalog (number_of_entries=0, size_in_bytes=0) QuickMethodFrameInfo frame_size_in_bytes: 0 core_spill_mask: 0x00004020 (r5, r14) fp_spill_mask: 0x00000000 vr_stack_locations: locals: v0[sp + #4294967276] v1[sp + #4294967280] ins: v2[sp + #4] v3[sp + #8] v4[sp + #12] v5[sp + #16] method*: v6[sp + #0] outs: v0[sp + #4] v1[sp + #8] CODE: (code_offset=0x00001039 size_offset=0x00001034 size=10)... 0x00001038: eeb10bc0 vsqrt.f64 d0, d0 0x0000103c: ee310b00 vadd.f64 d0, d1, d0 0x00001040: 4770 bx lr OAT FILE STATS: Dumping cumulative use of 79 accounted bytes Code = 12 (15% of total) QuickMethodHeader = 48 (61% of total) CodeInfoEncoding = 19 (24% of total) CodeInfoLocationCatalog = 0 ( 0% of total) CodeInfoDexRegisterMap = 0 ( 0% of total) CodeInfoStackMasks = 0 ( 0% of total) CodeInfoRegisterMasks = 0 ( 0% of total) CodeInfoInvokeInfo = 0 ( 0% of total) CodeInfoStackMap = 0 ( 0% of total) StackMapNativePc = 0 (nan% of stack map) StackMapDexPcEncoding = 0 (nan% of stack map) StackMapDexRegisterMap = 0 (nan% of stack map) StackMapInlineInfoIndex = 0 (nan% of stack map) StackMapRegisterMaskIndex = 0 (nan% of stack map) StackMapStackMaskIndex = 0 (nan% of stack map) CodeInfoInlineInfo = 0 ( 0% of total) InlineInfoMethodIndexIdx = 0 (nan% of inline info) InlineInfoDexPc = 0 (nan% of inline info) InlineInfoExtraData = 0 (nan% of inline info) InlineInfoDexRegisterMap = 0 (nan% of inline info) InlineInfoIsLast = 0 (nan% of inline info)
  237. 1: double Intrinsic.doMath(double, double) (dex_method_idx=1) DEX CODE: 0x0000: 7120 0200

    3200 | invoke-static {v2, v3}, double java.lang.Math.sqrt(double) 0x0003: 0b00 | move-result-wide v0 0x0004: cb40 | add-double/2addr v0, v4 0x0005: 1000 | return-wide v0 OatMethodOffsets (offset=0x00000584) code_offset: 0x00001039 OatQuickMethodHeader (offset=0x00001020) vmap_table: (offset=0x00000ab0) Optimized CodeInfo (number_of_dex_registers=6, number_of_stack_maps=0) StackMapEncoding (native_pc_bit_offset=0, dex_pc_bit_offset=0, dex_register_map_bit_offset=1, inline_info_bit_offset=1, register_mask_bit_offset=1, stack_mask_index_bit_offset=1, total_bit_size=1) DexRegisterLocationCatalog (number_of_entries=0, size_in_bytes=0) QuickMethodFrameInfo frame_size_in_bytes: 0 core_spill_mask: 0x00004020 (r5, r14) fp_spill_mask: 0x00000000 vr_stack_locations: locals: v0[sp + #4294967276] v1[sp + #4294967280] ins: v2[sp + #4] v3[sp + #8] v4[sp + #12] v5[sp + #16] method*: v6[sp + #0] outs: v0[sp + #4] v1[sp + #8] CODE: (code_offset=0x00001039 size_offset=0x00001034 size=10)... 0x00001038: eeb10bc0 vsqrt.f64 d0, d0 0x0000103c: ee310b00 vadd.f64 d0, d1, d0 0x00001040: 4770 bx lr
  238. 1: double Intrinsic.doMath(double, double) (dex_method_idx=1) DEX CODE: 0x0000: 7120 0200

    3200 | invoke-static {v2, v3}, double java.lang.Math.sqrt(double) 0x0003: 0b00 | move-result-wide v0 0x0004: cb40 | add-double/2addr v0, v4 0x0005: 1000 | return-wide v0 OatMethodOffsets (offset=0x00000584) code_offset: 0x00001039 OatQuickMethodHeader (offset=0x00001020) vmap_table: (offset=0x00000ab0) Optimized CodeInfo (number_of_dex_registers=6, number_of_stack_maps=0) StackMapEncoding (native_pc_bit_offset=0, dex_pc_bit_offset=0, dex_register_map_bit_offset=1, inline_info_bit_offset=1, register_mask_bit_offset=1, stack_mask_index_bit_offset=1, total_bit_size=1) DexRegisterLocationCatalog (number_of_entries=0, size_in_bytes=0) QuickMethodFrameInfo frame_size_in_bytes: 0 core_spill_mask: 0x00004020 (r5, r14) fp_spill_mask: 0x00000000 vr_stack_locations: locals: v0[sp + #4294967276] v1[sp + #4294967280] ins: v2[sp + #4] v3[sp + #8] v4[sp + #12] v5[sp + #16] method*: v6[sp + #0] outs: v0[sp + #4] v1[sp + #8] CODE: (code_offset=0x00001039 size_offset=0x00001034 size=10)... 0x00001038: eeb10bc0 vsqrt.f64 d0, d0 0x0000103c: ee310b00 vadd.f64 d0, d1, d0 0x00001040: 4770 bx lr
  239. 1: double Intrinsic.doMath(double, double) (dex_method_idx=1) DEX CODE: 0x0000: 7120 0200

    3200 | invoke-static {v2, v3}, double java.lang.Math.sqrt(double) 0x0003: 0b00 | move-result-wide v0 0x0004: cb40 | add-double/2addr v0, v4 0x0005: 1000 | return-wide v0 OatMethodOffsets (offset=0x00000584) code_offset: 0x00001039 OatQuickMethodHeader (offset=0x00001020) vmap_table: (offset=0x00000ab0) Optimized CodeInfo (number_of_dex_registers=6, number_of_stack_maps=0) StackMapEncoding (native_pc_bit_offset=0, dex_pc_bit_offset=0, dex_register_map_bit_offset=1, inline_info_bit_offset=1, register_mask_bit_offset=1, stack_mask_index_bit_offset=1, total_bit_size=1) DexRegisterLocationCatalog (number_of_entries=0, size_in_bytes=0) QuickMethodFrameInfo frame_size_in_bytes: 0 core_spill_mask: 0x00004020 (r5, r14) fp_spill_mask: 0x00000000 vr_stack_locations: locals: v0[sp + #4294967276] v1[sp + #4294967280] ins: v2[sp + #4] v3[sp + #8] v4[sp + #12] v5[sp + #16] method*: v6[sp + #0] outs: v0[sp + #4] v1[sp + #8] CODE: (code_offset=0x00001039 size_offset=0x00001034 size=10)... 0x00001038: eeb10bc0 vsqrt.f64 d0, d0 0x0000103c: ee310b00 vadd.f64 d0, d1, d0 0x00001040: 4770 bx lr
  240. 1: double Intrinsic.doMath(double, double) (dex_method_idx=1) DEX CODE: 0x0000: 7120 0200

    3200 | invoke-static {v2, v3}, double java.lang.Math.sqrt(double) 0x0003: 0b00 | move-result-wide v0 0x0004: cb40 | add-double/2addr v0, v4 0x0005: 1000 | return-wide v0 OatMethodOffsets (offset=0x00000584) code_offset: 0x00001039 OatQuickMethodHeader (offset=0x00001020) vmap_table: (offset=0x00000ab0) Optimized CodeInfo (number_of_dex_registers=6, number_of_stack_maps=0) StackMapEncoding (native_pc_bit_offset=0, dex_pc_bit_offset=0, dex_register_map_bit_offset=1, inline_info_bit_offset=1, register_mask_bit_offset=1, stack_mask_index_bit_offset=1, total_bit_size=1) DexRegisterLocationCatalog (number_of_entries=0, size_in_bytes=0) QuickMethodFrameInfo frame_size_in_bytes: 0 core_spill_mask: 0x00004020 (r5, r14) fp_spill_mask: 0x00000000 vr_stack_locations: locals: v0[sp + #4294967276] v1[sp + #4294967280] ins: v2[sp + #4] v3[sp + #8] v4[sp + #12] v5[sp + #16] method*: v6[sp + #0] outs: v0[sp + #4] v1[sp + #8] CODE: (code_offset=0x00001039 size_offset=0x00001034 size=10)... 0x00001038: eeb10bc0 vsqrt.f64 d0, d0 0x0000103c: ee310b00 vadd.f64 d0, d1, d0 0x00001040: 4770 bx lr
  241. 1: double Intrinsic.doMath(double, double) (dex_method_idx=1) DEX CODE: 0x0000: 7120 0200

    3200 | invoke-static {v2, v3}, double java.lang.Math.sqrt(double) 0x0003: 0b00 | move-result-wide v0 0x0004: cb40 | add-double/2addr v0, v4 0x0005: 1000 | return-wide v0 OatMethodOffsets (offset=0x00000584) code_offset: 0x00001039 OatQuickMethodHeader (offset=0x00001020) vmap_table: (offset=0x00000ab0) Optimized CodeInfo (number_of_dex_registers=6, number_of_stack_maps=0) StackMapEncoding (native_pc_bit_offset=0, dex_pc_bit_offset=0, dex_register_map_bit_offset=1, inline_info_bit_offset=1, register_mask_bit_offset=1, stack_mask_index_bit_offset=1, total_bit_size=1) DexRegisterLocationCatalog (number_of_entries=0, size_in_bytes=0) QuickMethodFrameInfo frame_size_in_bytes: 0 core_spill_mask: 0x00004020 (r5, r14) fp_spill_mask: 0x00000000 vr_stack_locations: locals: v0[sp + #4294967276] v1[sp + #4294967280] ins: v2[sp + #4] v3[sp + #8] v4[sp + #12] v5[sp + #16] method*: v6[sp + #0] outs: v0[sp + #4] v1[sp + #8] CODE: (code_offset=0x00001040 size_offset=0x0000103c size=12)... 0x00001040: F20F51D0 sqrtsd xmm2, xmm0 0x00001044: F20F58CA addsd xmm1, xmm2 0x00001048: 0F28C1 movaps xmm0, xmm1 0x0000104b: C3 ret