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

Dekompiling (droidcon Berlin 2019)

Dekompiling (droidcon Berlin 2019)

Kotlin has many features that are leaps and bounds ahead of Java. However, its primary target platform being the JVM, all of these features still need to compile to the same bytecode as Java does. This is a look at how a variety of interesting Kotlin features are compiled to bytecode, and what their Java equivalents would be. Even though Kotlin abstracts away much of the virtual machine and the original feature set of Java with its own features, it’s still important to know what your Kotlin code compiles to. Not only can this knowledge give you the power to optimize your code, but it will also help you avoid subtle bugs that would otherwise be near impossible to track down.

Talk recording (re-recorded after the conference): https://www.droidcon.com/media-detail?video=370862982

Márton Braun

July 03, 2019
Tweet

More Decks by Márton Braun

Other Decks in Programming

Transcript

  1. // access flags 0x19 public final static main()V L0 LINENUMBER

    2 L0 LDC "hello " ICONST_3 INVOKESTATIC DecKt.multiply (Ljava/lang/String;I)Ljava/lang/String; ASTORE 0 L1 ICONST_0 ISTORE 1 L2 GETSTATIC java/lang/System.out : Ljava/io/PrintStream; ALOAD 0 INVOKEVIRTUAL java/io/PrintStream.println (Ljava/lang/Object;)V L3 L4 LINENUMBER 3 L4 RETURN L5 MAXSTACK = 2 MAXLOCALS = 2 fun main() { println(multiply("hello ", 3)) } public final class DecKt { public static final void main() { String var0 = multiply("hello ", 3); boolean var1 = false; System.out.println(var0); } }
  2. // access flags 0x19 public final static main()V L0 LINENUMBER

    2 L0 LDC "hello " ICONST_3 INVOKESTATIC DecKt.multiply (Ljava/lang/String;I)Ljava/lang/String; ASTORE 0 L1 ICONST_0 ISTORE 1 L2 GETSTATIC java/lang/System.out : Ljava/io/PrintStream; ALOAD 0 INVOKEVIRTUAL java/io/PrintStream.println (Ljava/lang/Object;)V L3 L4 LINENUMBER 3 L4 RETURN L5 MAXSTACK = 2 MAXLOCALS = 2 fun main() { println(multiply("hello ", 3)) } public final class DecKt { public static final void main() { String var0 = multiply("hello ", 3); boolean var1 = false; System.out.println(var0); } }
  3. // access flags 0x19 public final static main()V L0 LINENUMBER

    2 L0 LDC "hello " ICONST_3 INVOKESTATIC DecKt.multiply (Ljava/lang/String;I)Ljava/lang/String; ASTORE 0 L1 ICONST_0 ISTORE 1 L2 GETSTATIC java/lang/System.out : Ljava/io/PrintStream; ALOAD 0 INVOKEVIRTUAL java/io/PrintStream.println (Ljava/lang/Object;)V L3 L4 LINENUMBER 3 L4 RETURN L5 MAXSTACK = 2 MAXLOCALS = 2 fun main() { println(multiply("hello ", 3)) } public final class DecKt { public static final void main() { String var0 = multiply("hello ", 3); boolean var1 = false; System.out.println(var0); } }
  4. // access flags 0x19 public final static main()V L0 LINENUMBER

    2 L0 LDC "hello " ICONST_3 INVOKESTATIC DecKt.multiply (Ljava/lang/String;I)Ljava/lang/String; ASTORE 0 L1 ICONST_0 ISTORE 1 L2 GETSTATIC java/lang/System.out : Ljava/io/PrintStream; ALOAD 0 INVOKEVIRTUAL java/io/PrintStream.println (Ljava/lang/Object;)V L3 L4 LINENUMBER 3 L4 RETURN L5 MAXSTACK = 2 MAXLOCALS = 2 fun main() { println(multiply("hello ", 3)) } public final class DecKt { public static final void main() { String var0 = multiply("hello ", 3); boolean var1 = false; System.out.println(var0); } }
  5. fun main() { println(multiply("hello ", 3)) } public final class

    DecKt { public static final void main() { String var0 = multiply("hello ", 3); boolean var1 = false; System.out.println(var0); } } // access flags 0x19 public final static main()V L0 LINENUMBER 2 L0 LDC "hello " ICONST_3 INVOKESTATIC DecKt.multiply (Ljava/lang/String;I)Ljava/lang/String; ASTORE 0 L1 ICONST_0 ISTORE 1 L2 GETSTATIC java/lang/System.out : Ljava/io/PrintStream; ALOAD 0 INVOKEVIRTUAL java/io/PrintStream.println (Ljava/lang/Object;)V L3 L4 LINENUMBER 3 L4 RETURN L5 MAXSTACK = 2 MAXLOCALS = 2
  6. fun main() { println(multiply("hello ", 3)) } public final class

    DecKt { public static final void main() { String var0 = multiply("hello ", 3); boolean var1 = false; System.out.println(var0); } } // access flags 0x19 public final static main()V L0 LINENUMBER 2 L0 LDC "hello " ICONST_3 INVOKESTATIC DecKt.multiply (Ljava/lang/String;I)Ljava/lang/String; ASTORE 0 L1 ICONST_0 ISTORE 1 L2 GETSTATIC java/lang/System.out : Ljava/io/PrintStream; ALOAD 0 INVOKEVIRTUAL java/io/PrintStream.println (Ljava/lang/Object;)V L3 L4 LINENUMBER 3 L4 RETURN L5 MAXSTACK = 2 MAXLOCALS = 2 .java .kt .class
  7. fun main() { println( ) } multiply("hello ", 3) "hello

    hello hello " fun multiply(string: String, times: Int): String { }
  8. fun main() { println( ) } multiply("hello ", 3) "hello

    hello hello " fun multiply(string: String, times: Int): String { var result = "" }
  9. fun main() { println( ) } multiply("hello ", 3) "hello

    hello hello " fun multiply(string: String, times: Int): String { var result = "" for (i in 0 until times) { } }
  10. fun main() { println( ) } multiply("hello ", 3) "hello

    hello hello " fun multiply(string: String, times: Int): String { var result = "" for (i in 0 until times) { result = result + string } }
  11. fun main() { println( ) } multiply("hello ", 3) "hello

    hello hello " fun multiply(string: String, times: Int): String { var result = "" for (i in 0 until times) { result = result + string } return result }
  12. fun multiply(string: String, times: Int): String { var result =

    "" for (i in 0 until times) { result = result + string } return result } @NotNull public static final String multiply(@NotNull String string, int times) { Intrinsics.checkParameterIsNotNull(string, "string"); String result = ""; int var3 = 0; for (int var4 = times; var3 < var4; ++var3) { result = result + string; } return result; }
  13. fun multiply(string: String, times: Int): String { var result =

    "" for (i in 0 until times) { result = result + string } return result } @NotNull public static final String multiply(@NotNull String string, int times) { Intrinsics.checkParameterIsNotNull(string, "string"); String result = ""; int var3 = 0; for (int var4 = times; var3 < var4; ++var3) { result = result + string; } return result; }
  14. fun multiply(string: String, times: Int): String { var result =

    "" for (i in 0 until times) { result = result + string } return result } @NotNull public static final String multiply(@NotNull String string, int times) { Intrinsics.checkParameterIsNotNull(string, "string"); String result = ""; int var3 = 0; for (int var4 = times; var3 < var4; ++var3) { result = result + string; } return result; } Int? @Nullable Integer
  15. fun multiply(string: String, times: Int): String { var result =

    "" for (i in 0 until times) { result = result + string } return result } @NotNull public static final String multiply(@NotNull String string, int times) { Intrinsics.checkParameterIsNotNull(string, "string"); String result = ""; int var3 = 0; for (int var4 = times; var3 < var4; ++var3) { result = result + string; } return result; }
  16. fun multiply(string: String, times: Int): String { var result =

    "" for (i in 0 until times) { result = result + string } return result } @NotNull public static final String multiply(@NotNull String string, int times) { Intrinsics.checkParameterIsNotNull(string, "string"); String result = ""; int var3 = 0; for (int var4 = times; var3 < var4; ++var3) { result = result + string; } return result; } public class Intrinsics { public static void checkParameterIsNotNull( Object value, String paramName ) { if (value == null) { throwParameterIsNullException(paramName); } } private static void throwParameterIsNullException( String paramName ) { // ... throw new IllegalArgumentException( "Parameter specified as non-null is null: " + "method " + className + "." + methodName + ", parameter " + paramName); } }
  17. fun multiply(string: String, times: Int): String { var result =

    "" for (i in 0 until times) { result = result + string } return result } @NotNull public static final String multiply(@NotNull String string, int times) { Intrinsics.checkParameterIsNotNull(string, "string"); String result = ""; int var3 = 0; for (int var4 = times; var3 < var4; ++var3) { result = result + string; } return result; } public class Intrinsics { public static void checkParameterIsNotNull( Object value, String paramName ) { if (value == null) { throwParameterIsNullException(paramName); } } private static void throwParameterIsNullException( String paramName ) { // ... throw new IllegalArgumentException( "Parameter specified as non-null is null: " + "method " + className + "." + methodName + ", parameter " + paramName); } }
  18. fun multiply(string: String, times: Int): String { var result =

    "" for (i in 0 until times) { result = result + string } return result } @NotNull public static final String multiply(@NotNull String string, int times) { Intrinsics.checkParameterIsNotNull(string, "string"); String result = ""; int var3 = 0; for (int var4 = times; var3 < var4; ++var3) { result = result + string; } return result; }
  19. fun multiply(string: String, times: Int): String { var result =

    "" for (i in 0 until times) { result = result + string } return result } @NotNull public static final String multiply(@NotNull String string, int times) { Intrinsics.checkParameterIsNotNull(string, "string"); String result = ""; int var3 = 0; for (int var4 = times; var3 < var4; ++var3) { result = result + string; } return result; }
  20. fun multiply(string: String, times: Int): String { var result =

    "" for (i in 0 until times) { result = result + string } return result } @NotNull public static final String multiply(@NotNull String string, int times) { Intrinsics.checkParameterIsNotNull(string, "string"); String result = ""; int var3 = 0; for (int var4 = times; var3 < var4; ++var3) { result = result + string; } return result; }
  21. fun string: String, var result = "" for (i in

    0 until times) { result = result + } return result } @NotNull public static final String multiply(@NotNull String string, int times) { Intrinsics.checkParameterIsNotNull(string, "string"); String result = ""; int var3 = 0; for (int var4 = times; var3 < var4; ++var3) { result = result + string; } return result; } times: Int): String { string multiply(
  22. @NotNull public static final String multiply(@NotNull String string, int times)

    { Intrinsics.checkParameterIsNotNull(string, "string"); String result = ""; int var3 = 0; for (int var4 = times; var3 < var4; ++var3) { result = result + string; } return result; } fun String. var result = "" for (i in 0 until times) { result = result + } return result } times: Int): String { this multiply(
  23. fun String.multiply(times: Int): String { var result = "" for

    (i in 0 until times) { result = result + this } return result } ); @NotNull public static final String multiply(@NotNull String Intrinsics.checkParameterIsNotNull( String result = ""; int var3 = 0; for (int var4 = times; var3 < var4; ++var3) { result = result + } return result; } , int times) { string "string" , string string;
  24. @NotNull public static final String multiply(@NotNull String $this$multiply, int time

    Intrinsics.checkParameterIsNotNull($this$multiply, "$this$multiply"); String result = ""; int var3 = 0; for (int var4 = times; var3 < var4; ++var3) { result = result + $this$multiply; } return result; } fun String.multiply(times: Int): String { var result = "" for (i in 0 until times) { result = result + this } return result }
  25. @NotNull public static final String multiply(@NotNull String $this$multiply, int time

    Intrinsics.checkParameterIsNotNull($this$multiply, "$this$multiply"); String result = ""; int var3 = 0; for (int var4 = times; var3 < var4; ++var3) { result = result + $this$multiply; } return result; } fun String.multiply(times: Int): String { var result = "" for (i in 0 until times) { result = result + this } return result }
  26. @NotNull public static final String multiply(@NotNull String $this$multiply, int time

    Intrinsics.checkParameterIsNotNull($this$multiply, "$this$multiply"); String result = ""; int var3 = 0; for (int var4 = times; var3 < var4; ++var3) { result = result + $this$multiply; } return result; } fun String.multiply(times: Int): String { var result = "" for (i in 0 until times) { result = result + this } return result }
  27. @NotNull public static final String multiply(@NotNull String $this$multiply, int times)

    { Intrinsics.checkParameterIsNotNull($this$multiply, "$this$multiply"); String result = ""; int var3 = 0; for (int var4 = times; var3 < var4; ++var3) { result = result + $this$multiply; } return result; } fun String.multiply(times: Int): String { var result = "" for (i in 0 until times) { result = result + this } return result }
  28. @NotNull public static final String multiply(@NotNull String $this$multiply, int times)

    { Intrinsics.checkParameterIsNotNull($this$multiply, "$this$multiply"); String result = ""; int var3 = 0; for (int var4 = times; var3 < var4; ++var3) { result = result + $this$multiply; } return result; } fun String.multiply(times: Int): String { var result = "" for (i in 0 until times) { result = result + this } return result } { open } { override } class Cat : Animal() fun main() { val animal: Animal = Cat() animal.identify() } println("This is a cat!") } identify() { fun abstract class Animal identify() { fun println("This is an animal.") }
  29. @NotNull public static final String multiply(@NotNull String $this$multiply, int times)

    { Intrinsics.checkParameterIsNotNull($this$multiply, "$this$multiply"); String result = ""; int var3 = 0; for (int var4 = times; var3 < var4; ++var3) { result = result + $this$multiply; } return result; } fun String.multiply(times: Int): String { var result = "" for (i in 0 until times) { result = result + this } return result } { open } { override } class Cat : Animal() fun main() { val animal: Animal = Cat() animal.identify() } println("This is a cat!") } identify() { fun abstract class Animal identify() { fun println("This is an animal.") } "This is a cat!"
  30. @NotNull public static final String multiply(@NotNull String $this$multiply, int times)

    { Intrinsics.checkParameterIsNotNull($this$multiply, "$this$multiply"); String result = ""; int var3 = 0; for (int var4 = times; var3 < var4; ++var3) { result = result + $this$multiply; } return result; } fun String.multiply(times: Int): String { var result = "" for (i in 0 until times) { result = result + this } return result } class Cat : Animal() fun main() { val animal: Animal = Cat() animal.identify() } println("This is a cat!") } identify() { fun abstract class Animal identify() { println("This is an animal.") } fun Animal. Cat.
  31. @NotNull public static final String multiply(@NotNull String $this$multiply, int times)

    { Intrinsics.checkParameterIsNotNull($this$multiply, "$this$multiply"); String result = ""; int var3 = 0; for (int var4 = times; var3 < var4; ++var3) { result = result + $this$multiply; } return result; } fun String.multiply(times: Int): String { var result = "" for (i in 0 until times) { result = result + this } return result } class Cat : Animal() fun main() { val animal: Animal = Cat() animal.identify() } println("This is a cat!") } identify() { Animal. Cat. fun abstract class Animal identify() { println("This is an animal.") } fun "This is an animal."
  32. @NotNull public static final String multiply(@NotNull String $this$multiply, int times)

    { Intrinsics.checkParameterIsNotNull($this$multiply, "$this$multiply"); String result = ""; int var3 = 0; for (int var4 = times; var3 < var4; ++var3) { result = result + $this$multiply; } return result; } fun String.multiply(times: Int): String { var result = "" for (i in 0 until times) { result = result + this } return result }
  33. @NotNull public static final String multiply(@NotNull String $this$multiply, int times)

    { Intrinsics.checkParameterIsNotNull($this$multiply, "$this$multiply"); String result = ""; int var3 = 0; for (int var4 = times; var3 < var4; ++var3) { result = result + $this$multiply; } return result; } fun String.multiply(times: Int): String { var result = "" for (i in 0 until times) { result = result + this } return result }
  34. @NotNull public static final String multiply(@NotNull String $this$multiply, int times)

    { Intrinsics.checkParameterIsNotNull($this$multiply, "$this$multiply"); String result = ""; int var3 = 0; for (int var4 = times; var3 < var4; ++var3) { result = result + $this$multiply; } return result; } fun String.multiply(times: Int): String { var result = "" for (i in 0 until times) { result += this } return result }
  35. @NotNull public static final String multiply(@NotNull String $this$multiply, int times)

    { Intrinsics.checkParameterIsNotNull($this$multiply, "$this$multiply"); String result = ""; int var3 = 0; for (int var4 = times; var3 < var4; ++var3) { result = result + $this$multiply; } return result; } fun String.multiply(times: Int): String { var result = "" for (i in 0 until times) { result += this } return result }
  36. @NotNull public static final String multiply(@NotNull String $this$multiply, int times)

    { Intrinsics.checkParameterIsNotNull($this$multiply, "$this$multiply"); String result = ""; int var3 = 0; for (int var4 = times; var3 < var4; ++var3) { result = result + $this$multiply; } return result; } fun String.multiply(times: Int): String { var result = "" for (i in 0 until times) { result += this } return result }
  37. @NotNull public static final String multiply(@NotNull String $this$multiply, int times)

    { Intrinsics.checkParameterIsNotNull($this$multiply, "$this$multiply"); String result = ""; int var3 = 0; for (int var4 = times; var3 < var4; ++var3) { result = result + $this$multiply; } return result; } fun String.multiply(times: Int): String { var result = "" for (i in 0 until times) { result += this } return result } a += b a.plusAssign(b) a -= b a.minusAssign(b)
  38. @NotNull public static final String multiply(@NotNull String $this$multiply, int times)

    { Intrinsics.checkParameterIsNotNull($this$multiply, "$this$multiply"); String result = ""; int var3 = 0; for (int var4 = times; var3 < var4; ++var3) { result = result + $this$multiply; } return result; } fun String.multiply(times: Int): String { var result = "" for (i in 0 until times) { result += this } return result } a = a + b a = a - b a += b a.plusAssign(b) a -= b a.minusAssign(b)
  39. @NotNull public static final String multiply(@NotNull String $this$multiply, int times)

    { Intrinsics.checkParameterIsNotNull($this$multiply, "$this$multiply"); String result = ""; int var3 = 0; for (int var4 = times; var3 < var4; ++var3) { result = result + $this$multiply; } return result; } fun String.multiply(times: Int): String { var result = "" for (i in 0 until times) { result += this } return result } a = a + b a = a - b a += b a.plusAssign(b) a -= b a.minusAssign(b) a + b a.plus(b) a - b a.minus(b)
  40. @NotNull public static final String multiply(@NotNull String $this$multiply, int times)

    { Intrinsics.checkParameterIsNotNull($this$multiply, "$this$multiply"); String result = ""; int var3 = 0; for (int var4 = times; var3 < var4; ++var3) { result = result + $this$multiply; } return result; } fun String.multiply(times: Int): String { var result = "" for (i in 0 until times) { result += this } return result }
  41. fun String.multiply(times: Int): String { var result = "" for

    (i in 0 until times) { result += this } return result }
  42. fun repeat(times: Int, action: () -> Unit) { action() }

    for (i in 0 until times) { } fun String.multiply(times: Int): String { var result = "" for (i in 0 until times) { result += this } return result }
  43. fun String.multiply(times: Int): String { var result = "" repeat(times)

    { result += this } return result } fun repeat(times: Int, action: () -> Unit) { for (i in 0 until times) { action() } }
  44. public static final void repeat(int times, @NotNull Function0 action) {

    Intrinsics.checkParameterIsNotNull(action, "action"); int var2 = 0; for (int var3 = times; var2 < var3; ++var2) { action.invoke(); } } fun repeat(times: Int, action: () -> Unit) { for (i in 0 until times) { action() } }
  45. public static final void repeat(int times, @NotNull Function0 action) {

    Intrinsics.checkParameterIsNotNull(action, "action"); int var2 = 0; for (int var3 = times; var2 < var3; ++var2) { action.invoke(); } } fun repeat(times: Int, action: () -> Unit) { for (i in 0 until times) { action() } }
  46. public static final void repeat(int times, @NotNull Function0 action) {

    Intrinsics.checkParameterIsNotNull(action, "action"); int var2 = 0; for (int var3 = times; var2 < var3; ++var2) { action.invoke(); } } fun repeat(times: Int, action: () -> Unit) { for (i in 0 until times) { action() } } package kotlin.jvm.functions /** A function that takes 0 arguments. */ public interface Function0<out R> : Function<R> { /** Invokes the function. */ public operator fun invoke(): R }
  47. public static final void repeat(int times, @NotNull Function0 action) {

    Intrinsics.checkParameterIsNotNull(action, "action"); int var2 = 0; for (int var3 = times; var2 < var3; ++var2) { action.invoke(); } } fun repeat(times: Int, action: () -> Unit) { for (i in 0 until times) { action() } } package kotlin.jvm.functions /** A function that takes 0 arguments. */ public interface Function0<out R> : Function<R> { /** Invokes the function. */ public operator fun invoke(): R } /** A function that takes 1 argument. */ public interface Function1<in P1, out R> : Function<R> { /** Invokes the function with the specified argument. */ public operator fun invoke(p1: P1): R }
  48. public static final void repeat(int times, @NotNull Function0 action) {

    Intrinsics.checkParameterIsNotNull(action, "action"); int var2 = 0; for (int var3 = times; var2 < var3; ++var2) { action.invoke(); } } fun repeat(times: Int, action: () -> Unit) { for (i in 0 until times) { action() } }
  49. public static final void repeat(int times, @NotNull Function0 action) {

    Intrinsics.checkParameterIsNotNull(action, "action"); int var2 = 0; for (int var3 = times; var2 < var3; ++var2) { action.invoke(); } } fun repeat(times: Int, action: () -> Unit) { for (i in 0 until times) { action() } }
  50. public static final void repeat(int times, @NotNull Function0 action) {

    Intrinsics.checkParameterIsNotNull(action, "action"); int var2 = 0; for (int var3 = times; var2 < var3; ++var2) { action.invoke(); } } fun repeat(times: Int, action: () -> Unit) { for (i in 0 until times) { action() } }
  51. public static final void repeat(int times, @NotNull Function0 action) {

    Intrinsics.checkParameterIsNotNull(action, "action"); int var2 = 0; for (int var3 = times; var2 < var3; ++var2) { action.invoke(); } } fun repeat(times: Int, action: () -> Unit) { for (i in 0 until times) { action() } }
  52. fun String.multiply(times: Int): String { var result = "" repeat(times)

    { result += this } return result } public static final void repeat(int times, @NotNull Function0 action) { Intrinsics.checkParameterIsNotNull(action, "action"); int var2 = 0; for (int var3 = times; var2 < var3; ++var2) { action.invoke(); } }
  53. }); return (String) result.element; } @NotNull public static final String

    multiply(@NotNull final String $this$multiply, int times) { Intrinsics.checkParameterIsNotNull($this$multiply, "$this$multiply"); final ObjectRef result = new ObjectRef(); result.element = ""; repeat(times, new Function0() { public final void invoke() { ObjectRef var10000 = result; String var10001 = (String) var10000.element; var10000.element = var10001 + $this$multiply; }
  54. }); return (String) result.element; } @NotNull public static final String

    multiply(@NotNull final String $this$multiply, int times) { Intrinsics.checkParameterIsNotNull($this$multiply, "$this$multiply"); final ObjectRef result = new ObjectRef(); result.element = ""; repeat(times, new Function0() { public final void invoke() { ObjectRef var10000 = result; String var10001 = (String) var10000.element; var10000.element = var10001 + $this$multiply; }
  55. // ... }); return (String) result.element; } @NotNull public static

    final String multiply(@NotNull final String $this$multiply, int times) { Intrinsics.checkParameterIsNotNull($this$multiply, "$this$multiply"); final ObjectRef result = new ObjectRef(); result.element = ""; repeat(times, new Function0() { public final void invoke() { ObjectRef var10000 = result; String var10001 = (String) var10000.element; var10000.element = var10001 + $this$multiply; }
  56. // ... }); return (String) result.element; } @NotNull public static

    final String multiply(@NotNull final String $this$multiply, int times) { Intrinsics.checkParameterIsNotNull($this$multiply, "$this$multiply"); final ObjectRef result = new ObjectRef(); result.element = ""; repeat(times, new Function0() { public final void invoke() { ObjectRef var10000 = result; String var10001 = (String) var10000.element; var10000.element = var10001 + $this$multiply; } String result = ""; return result;
  57. // ... }); return (String) result.element; } @NotNull public static

    final String multiply(@NotNull final String $this$multiply, int times) { Intrinsics.checkParameterIsNotNull($this$multiply, "$this$multiply"); final ObjectRef result = new ObjectRef(); result.element = ""; repeat(times, new Function0() { public final void invoke() { ObjectRef var10000 = result; String var10001 = (String) var10000.element; var10000.element = var10001 + $this$multiply; } String result = ""; return result; result += $this$multiply;
  58. // ... }); return (String) result.element; } @NotNull public static

    final String multiply(@NotNull final String $this$multiply, int times) { Intrinsics.checkParameterIsNotNull($this$multiply, "$this$multiply"); final ObjectRef result = new ObjectRef(); result.element = ""; repeat(times, new Function0() { public final void invoke() { ObjectRef var10000 = result; String var10001 = (String) var10000.element; var10000.element = var10001 + $this$multiply; } String result = ""; return result; result += $this$multiply;
  59. // ... }); return (String) result.element; } @NotNull public static

    final String multiply(@NotNull final String $this$multiply, int times) { Intrinsics.checkParameterIsNotNull($this$multiply, "$this$multiply"); final ObjectRef result = new ObjectRef(); result.element = ""; repeat(times, new Function0() { public final void invoke() { ObjectRef var10000 = result; String var10001 = (String) var10000.element; var10000.element = var10001 + $this$multiply; } final String result = ""; return result; result += $this$multiply;
  60. // ... }); return (String) result.element; } @NotNull public static

    final String multiply(@NotNull final String $this$multiply, int times) { Intrinsics.checkParameterIsNotNull($this$multiply, "$this$multiply"); final ObjectRef result = new ObjectRef(); result.element = ""; repeat(times, new Function0() { public final void invoke() { ObjectRef var10000 = result; String var10001 = (String) var10000.element; var10000.element = var10001 + $this$multiply; } final String result = ""; return result; result += $this$multiply;
  61. }); return (String) result.element; } @NotNull public static final String

    multiply(@NotNull final String $this$multiply, int times) { Intrinsics.checkParameterIsNotNull($this$multiply, "$this$multiply"); final ObjectRef result = new ObjectRef(); result.element = ""; repeat(times, new Function0() { public final void invoke() { ObjectRef var10000 = result; String var10001 = (String) var10000.element; var10000.element = var10001 + $this$multiply; } final String result = ""; return result; result += $this$multiply; "" result String
  62. // ... }); return (String) result.element; } @NotNull public static

    final String multiply(@NotNull final String $this$multiply, int times) { Intrinsics.checkParameterIsNotNull($this$multiply, "$this$multiply"); final ObjectRef result = new ObjectRef(); result.element = ""; repeat(times, new Function0() { public final void invoke() { ObjectRef var10000 = result; String var10001 = (String) var10000.element; var10000.element = var10001 + $this$multiply; } final String result = ""; return result; result += $this$multiply; "hi" result String
  63. // ... }); return (String) result.element; } @NotNull public static

    final String multiply(@NotNull final String $this$multiply, int times) { Intrinsics.checkParameterIsNotNull($this$multiply, "$this$multiply"); final ObjectRef result = new ObjectRef(); result.element = ""; repeat(times, new Function0() { public final void invoke() { ObjectRef var10000 = result; String var10001 = (String) var10000.element; var10000.element = var10001 + $this$multiply; } final String result = ""; return result; result += $this$multiply; "hi" result String "" result String
  64. // ... }); return (String) result.element; } @NotNull public static

    final String multiply(@NotNull final String $this$multiply, int times) { Intrinsics.checkParameterIsNotNull($this$multiply, "$this$multiply"); final ObjectRef result = new ObjectRef(); result.element = ""; repeat(times, new Function0() { public final void invoke() { ObjectRef var10000 = result; String var10001 = (String) var10000.element; var10000.element = var10001 + $this$multiply; }
  65. // ... }); return (String) result.element; } @NotNull public static

    final String multiply(@NotNull final String $this$multiply, int times) { Intrinsics.checkParameterIsNotNull($this$multiply, "$this$multiply"); final ObjectRef result = new ObjectRef(); result.element = ""; repeat(times, new Function0() { public final void invoke() { ObjectRef var10000 = result; String var10001 = (String) var10000.element; var10000.element = var10001 + $this$multiply; } public static final class ObjectRef<T> { public T element; @Override public String toString() { return String.valueOf(element); } }
  66. // ... }); return (String) result.element; } @NotNull public static

    final String multiply(@NotNull final String $this$multiply, int times) { Intrinsics.checkParameterIsNotNull($this$multiply, "$this$multiply"); final ObjectRef result = new ObjectRef(); result.element = ""; repeat(times, new Function0() { public final void invoke() { ObjectRef var10000 = result; String var10001 = (String) var10000.element; var10000.element = var10001 + $this$multiply; }
  67. // ... }); return (String) result.element; } @NotNull public static

    final String multiply(@NotNull final String $this$multiply, int times) { Intrinsics.checkParameterIsNotNull($this$multiply, "$this$multiply"); final ObjectRef result = new ObjectRef(); result.element = ""; repeat(times, new Function0() { public final void invoke() { ObjectRef var10000 = result; String var10001 = (String) var10000.element; var10000.element = var10001 + $this$multiply; } "" result String "" result String
  68. // ... }); return (String) result.element; } @NotNull public static

    final String multiply(@NotNull final String $this$multiply, int times) { Intrinsics.checkParameterIsNotNull($this$multiply, "$this$multiply"); final ObjectRef result = new ObjectRef(); result.element = ""; repeat(times, new Function0() { public final void invoke() { ObjectRef var10000 = result; String var10001 = (String) var10000.element; var10000.element = var10001 + $this$multiply; } "" result String "" result String "" result String element ObjectRef
  69. // ... }); return (String) result.element; } @NotNull public static

    final String multiply(@NotNull final String $this$multiply, int times) { Intrinsics.checkParameterIsNotNull($this$multiply, "$this$multiply"); final ObjectRef result = new ObjectRef(); result.element = ""; repeat(times, new Function0() { public final void invoke() { ObjectRef var10000 = result; String var10001 = (String) var10000.element; var10000.element = var10001 + $this$multiply; } "" result String "" result String "hi" ObjectRef result String element
  70. // ... }); return (String) result.element; } @NotNull public static

    final String multiply(@NotNull final String $this$multiply, int times) { Intrinsics.checkParameterIsNotNull($this$multiply, "$this$multiply"); final ObjectRef result = new ObjectRef(); result.element = ""; repeat(times, new Function0() { public final void invoke() { ObjectRef var10000 = result; String var10001 = (String) var10000.element; var10000.element = var10001 + $this$multiply; }
  71. // ... }); return (String) result.element; } @NotNull public static

    final String multiply(@NotNull final String $this$multiply, int times) { Intrinsics.checkParameterIsNotNull($this$multiply, "$this$multiply"); final ObjectRef result = new ObjectRef(); result.element = ""; repeat(times, new Function0() { public final void invoke() { ObjectRef var10000 = result; String var10001 = (String) var10000.element; var10000.element = var10001 + $this$multiply; } fun example() { repeat(20) { println("Ni.") } }
  72. // ... }); return (String) result.element; } @NotNull public static

    final String multiply(@NotNull final String $this$multiply, int times) { Intrinsics.checkParameterIsNotNull($this$multiply, "$this$multiply"); final ObjectRef result = new ObjectRef(); result.element = ""; repeat(times, new Function0() { public final void invoke() { ObjectRef var10000 = result; String var10001 = (String) var10000.element; var10000.element = var10001 + $this$multiply; } fun example() { repeat(20) { println("Ni.") } } public static final void example() { repeat(20, (Function0) null.INSTANCE); }
  73. // ... }); return (String) result.element; } @NotNull public static

    final String multiply(@NotNull final String $this$multiply, int times) { Intrinsics.checkParameterIsNotNull($this$multiply, "$this$multiply"); final ObjectRef result = new ObjectRef(); result.element = ""; repeat(times, new Function0() { public final void invoke() { ObjectRef var10000 = result; String var10001 = (String) var10000.element; var10000.element = var10001 + $this$multiply; } fun example() { repeat(20) { println("Ni.") } } public static final void example() { repeat(20, (Function0) null.INSTANCE); }
  74. // ... }); return (String) result.element; } @NotNull public static

    final String multiply(@NotNull final String $this$multiply, int times) { Intrinsics.checkParameterIsNotNull($this$multiply, "$this$multiply"); final ObjectRef result = new ObjectRef(); result.element = ""; repeat(times, new Function0() { public final void invoke() { ObjectRef var10000 = result; String var10001 = (String) var10000.element; var10000.element = var10001 + $this$multiply; } public static final void example() { repeat(20, (Function0) null.INSTANCE); } final class NiKt$example$1 implements Function0 { public static final NiKt$example$1 INSTANCE = new NiKt$example$1(); public final void invoke() { String str = "Ni."; System.out.println(str); } }
  75. // ... }); return (String) result.element; } @NotNull public static

    final String multiply(@NotNull final String $this$multiply, int times) { Intrinsics.checkParameterIsNotNull($this$multiply, "$this$multiply"); final ObjectRef result = new ObjectRef(); result.element = ""; repeat(times, new Function0() { public final void invoke() { ObjectRef var10000 = result; String var10001 = (String) var10000.element; var10000.element = var10001 + $this$multiply; } public static final void example() { repeat(20, (Function0) null.INSTANCE); } final class NiKt$example$1 implements Function0 { public static final NiKt$example$1 INSTANCE = new NiKt$example$1(); public final void invoke() { String str = "Ni."; System.out.println(str); } }
  76. // ... }); return (String) result.element; } @NotNull public static

    final String multiply(@NotNull final String $this$multiply, int times) { Intrinsics.checkParameterIsNotNull($this$multiply, "$this$multiply"); final ObjectRef result = new ObjectRef(); result.element = ""; repeat(times, new Function0() { public final void invoke() { ObjectRef var10000 = result; String var10001 = (String) var10000.element; var10000.element = var10001 + $this$multiply; } public static final void example() { repeat(20, (Function0) null.INSTANCE); } final class NiKt$example$1 implements Function0 { public static final NiKt$example$1 INSTANCE = new NiKt$example$1(); public final void invoke() { String str = "Ni."; System.out.println(str); } }
  77. // ... }); return (String) result.element; } @NotNull public static

    final String multiply(@NotNull final String $this$multiply, int times) { Intrinsics.checkParameterIsNotNull($this$multiply, "$this$multiply"); final ObjectRef result = new ObjectRef(); result.element = ""; repeat(times, new Function0() { public final void invoke() { ObjectRef var10000 = result; String var10001 = (String) var10000.element; var10000.element = var10001 + $this$multiply; } public static final void example() { repeat(20, (Function0) NiKt$example$1.INSTANCE); } final class NiKt$example$1 implements Function0 { public static final NiKt$example$1 INSTANCE = new NiKt$example$1(); public final void invoke() { String str = "Ni."; System.out.println(str); } }
  78. // ... }); return (String) result.element; } @NotNull public static

    final String multiply(@NotNull final String $this$multiply, int times) { Intrinsics.checkParameterIsNotNull($this$multiply, "$this$multiply"); final ObjectRef result = new ObjectRef(); result.element = ""; repeat(times, new Function0() { public final void invoke() { ObjectRef var10000 = result; String var10001 = (String) var10000.element; var10000.element = var10001 + $this$multiply; } public static final void example() { repeat(20, (Function0) NiKt$example$1.INSTANCE); } final class NiKt$example$1 implements Function0 { public static final NiKt$example$1 INSTANCE = new NiKt$example$1(); public final void invoke() { String str = "Ni."; System.out.println(str); } }
  79. // ... }); return (String) result.element; } @NotNull public static

    final String multiply(@NotNull final String $this$multiply, int times) { Intrinsics.checkParameterIsNotNull($this$multiply, "$this$multiply"); final ObjectRef result = new ObjectRef(); result.element = ""; repeat(times, new Function0() { public final void invoke() { ObjectRef var10000 = result; String var10001 = (String) var10000.element; var10000.element = var10001 + $this$multiply; }
  80. // ... }); return (String) result.element; } @NotNull public static

    final String multiply(@NotNull final String $this$multiply, int times) { Intrinsics.checkParameterIsNotNull($this$multiply, "$this$multiply"); final ObjectRef result = new ObjectRef(); result.element = ""; repeat(times, new Function0() { public final void invoke() { ObjectRef var10000 = result; String var10001 = (String) var10000.element; var10000.element = var10001 + $this$multiply; }
  81. fun repeat(times: Int, action: () -> Unit) { for (i

    in 0 until times) { action() } }
  82. inline fun repeat(times: Int, action: () -> Unit) { for

    (i in 0 until times) { action() } }
  83. public static final void repeat(int times, @NotNull Function0 action) {

    Intrinsics.checkParameterIsNotNull(action, "action"); int var3 = 0; for (int var4 = times; var3 < var4; ++var3) { action.invoke(); } } inline fun repeat(times: Int, action: () -> Unit) { for (i in 0 until times) { action() } }
  84. public static final void repeat(int times, @NotNull Function0 action) {

    Intrinsics.checkParameterIsNotNull(action, "action"); int var3 = 0; for (int var4 = times; var3 < var4; ++var3) { action.invoke(); } } fun String.multiply(times: Int): String { var result = "" repeat(times) { result += this } return result }
  85. fun String.multiply(times: Int): String { var result = "" repeat(times)

    { result += this } return result } @NotNull public static final String multiply(@NotNull String $this$multiply, int times) { Intrinsics.checkParameterIsNotNull($this$multiply, "$this$multiply"); String result = ""; int var4 = 0; for (int var5 = times; var4 < var5; ++var4) { result = result + $this$multiply; } return result; }
  86. inline fun repeat(times: Int, action: () -> Unit) { for

    (i in 0 until times) { action() } } fun String.multiply(times: Int): String { var result = "" repeat(times) { result += this } return result }
  87. inline fun repeat(times: Int, action: () -> Unit) { for

    (i in 0 until times) { action() } } fun String.multiply(times: Int): String { var result = "" repeat(times) { result += this } return result }
  88. inline fun repeat( , action: () -> Unit) { for

    (i in 0 until ) { action() } } fun String.multiply(times: Int): String { var result = "" repeat( ) { result += this } return result } times times times: Int
  89. inline fun repeat( , action: () -> Unit) { for

    (i in 0 until ) { action() } } times fun String.multiply(times: Int): String { var result = "" repeat( ) { result += this } return result }
  90. inline fun repeat( , ) { for (i in 0

    until ) { } } times fun String.multiply(times: Int): String { var result = "" repeat( ) return result } action action: () -> Unit } { result += this ()
  91. inline fun repeat( , ) { for (i in 0

    until ) { } } () fun String.multiply(times: Int): String { var result = "" repeat( ) return result } { result += this } times
  92. inline fun repeat( , ) { } for (i in

    0 until times) { result += this } fun String.multiply(times: Int): String { var result = "" return result } repeat( )
  93. for (i in 0 until times) { result += this

    } fun String.multiply(times: Int): String { var result = "" return result } repeat( )
  94. fun String.multiply(times: Int): String { var result = "" return

    result } for (i in 0 until times) { result += this }
  95. fun String.multiply(times: Int): String { var result = "" repeat(times)

    { result += this } return result } inline fun repeat(times: Int, action: () -> Unit) { for (i in 0 until times) { action() } }
  96. inline fun repeat(times: Int, action: () -> Unit) { for

    (i in 0 until times) { action() } } fun String.multiply(times: Int): String { var result = "" repeat(times) { result += this } return result }
  97. inline fun repeat(times: Int, action: () -> Unit) { for

    (i in 0 until times) { action() } } ALOAD 2 NEW java/lang/StringBuilder DUP INVOKESPECIAL java/lang/StringBuilder.<init> ()V SWAP INVOKEVIRTUAL java/lang/StringBuilder.append (Ljava/lang/String;) Ljava/lang/StringBuilder; ALOAD 0 INVOKEVIRTUAL java/lang/StringBuilder.append (Ljava/lang/String;) Ljava/lang/StringBuilder; INVOKEVIRTUAL java/lang/StringBuilder.toString () Ljava/lang/String; fun String.multiply(times: Int): String { var result = "" repeat(times) { result += this } return result }
  98. inline fun repeat(times: Int, action: () -> Unit) { for

    (i in 0 until times) { action() } } ALOAD 2 NEW java/lang/StringBuilder DUP INVOKESPECIAL java/lang/StringBuilder.<init> ()V SWAP INVOKEVIRTUAL java/lang/StringBuilder.append (Ljava/lang/String;) Ljava/lang/StringBuilder; ALOAD 0 INVOKEVIRTUAL java/lang/StringBuilder.append (Ljava/lang/String;) Ljava/lang/StringBuilder; INVOKEVIRTUAL java/lang/StringBuilder.toString () Ljava/lang/String; fun String.multiply(times: Int): String { var result = "" repeat(times) { result += this } return result }
  99. inline fun repeat(times: Int, action: () -> Unit) { for

    (i in 0 until times) { action() } } ALOAD 2 NEW java/lang/StringBuilder DUP INVOKESPECIAL java/lang/StringBuilder.<init> ()V SWAP INVOKEVIRTUAL java/lang/StringBuilder.append (Ljava/lang/String;) Ljava/lang/StringBuilder; ALOAD 0 INVOKEVIRTUAL java/lang/StringBuilder.append (Ljava/lang/String;) Ljava/lang/StringBuilder; INVOKEVIRTUAL java/lang/StringBuilder.toString () Ljava/lang/String; fun String.multiply(times: Int): String { var result = "" repeat(times) { result += this } return result }
  100. inline fun repeat(times: Int, action: () -> Unit) { for

    (i in 0 until times) { action() } } ALOAD 2 NEW java/lang/StringBuilder DUP INVOKESPECIAL java/lang/StringBuilder.<init> ()V SWAP INVOKEVIRTUAL java/lang/StringBuilder.append (Ljava/lang/String;) Ljava/lang/StringBuilder; ALOAD 0 INVOKEVIRTUAL java/lang/StringBuilder.append (Ljava/lang/String;) Ljava/lang/StringBuilder; INVOKEVIRTUAL java/lang/StringBuilder.toString () Ljava/lang/String; fun String.multiply(times: Int): String { var result = "" repeat(times) { result += this } return result }
  101. inline fun repeat(times: Int, action: () -> Unit) { for

    (i in 0 until times) { action() } } ALOAD 2 NEW java/lang/StringBuilder DUP INVOKESPECIAL java/lang/StringBuilder.<init> ()V SWAP INVOKEVIRTUAL java/lang/StringBuilder.append (Ljava/lang/String;) Ljava/lang/StringBuilder; ALOAD 0 INVOKEVIRTUAL java/lang/StringBuilder.append (Ljava/lang/String;) Ljava/lang/StringBuilder; INVOKEVIRTUAL java/lang/StringBuilder.toString () Ljava/lang/String; fun String.multiply(times: Int): String { var result = "" repeat(times) { result += this } return result }
  102. inline fun repeat(times: Int, action: () -> Unit) { for

    (i in 0 until times) { action() } } ALOAD 2 NEW java/lang/StringBuilder DUP INVOKESPECIAL java/lang/StringBuilder.<init> ()V SWAP INVOKEVIRTUAL java/lang/StringBuilder.append (Ljava/lang/String;) Ljava/lang/StringBuilder; ALOAD 0 INVOKEVIRTUAL java/lang/StringBuilder.append (Ljava/lang/String;) Ljava/lang/StringBuilder; INVOKEVIRTUAL java/lang/StringBuilder.toString () Ljava/lang/String; fun String.multiply(times: Int): String { var result = "" repeat(times) { result += this } return result }
  103. inline fun repeat(times: Int, action: () -> Unit) { for

    (i in 0 until times) { action() } } ALOAD 2 NEW java/lang/StringBuilder DUP INVOKESPECIAL java/lang/StringBuilder.<init> ()V SWAP INVOKEVIRTUAL java/lang/StringBuilder.append (Ljava/lang/String;) Ljava/lang/StringBuilder; ALOAD 0 INVOKEVIRTUAL java/lang/StringBuilder.append (Ljava/lang/String;) Ljava/lang/StringBuilder; INVOKEVIRTUAL java/lang/StringBuilder.toString () Ljava/lang/String; fun String.multiply(times: Int): String { var result = "" repeat(times) { result += this } return result }
  104. inline fun repeat(times: Int, action: () -> Unit) { for

    (i in 0 until times) { action() } } ALOAD 2 NEW java/lang/StringBuilder DUP INVOKESPECIAL java/lang/StringBuilder.<init> ()V SWAP INVOKEVIRTUAL java/lang/StringBuilder.append (Ljava/lang/String;) Ljava/lang/StringBuilder; ALOAD 0 INVOKEVIRTUAL java/lang/StringBuilder.append (Ljava/lang/String;) Ljava/lang/StringBuilder; INVOKEVIRTUAL java/lang/StringBuilder.toString () Ljava/lang/String; fun String.multiply(times: Int): String { var result = "" repeat(times) { result += this } return result }
  105. fun String.multiply(times: Int): String { var result = "" repeat(times)

    { result += this } return result } inline fun repeat(times: Int, action: () -> Unit) { for (i in 0 until times) { action() } }
  106. fun String.multiply(times: Int): String { val builder = StringBuilder() repeat(times)

    { builder.append(this) } return builder.toString() } inline fun repeat(times: Int, action: () -> Unit) { for (i in 0 until times) { action() } }
  107. fun String.multiply(times: Int): String { val builder = StringBuilder() repeat(times)

    { builder.append(this) } return builder.toString() } inline fun repeat(times: Int, action: () -> Unit) { for (i in 0 until times) { action() } } @NotNull public static final String multiply(@NotNull String $this$multiply, int times) { Intrinsics.checkParameterIsNotNull($this$multiply, "$this$multiply"); StringBuilder builder = new StringBuilder(); int var4 = 0; for (int var5 = times; var4 < var5; ++var4) { builder.append($this$multiply); } String var100 = builder.toString(); Intrinsics.checkExpressionValueIsNotNull(var100, "builder.toString()"); return var100; }
  108. fun String.multiply(times: Int): String { val builder = StringBuilder() repeat(times)

    { builder.append(this) } return builder.toString() } inline fun repeat(times: Int, action: () -> Unit) { for (i in 0 until times) { action() } } @NotNull public static final String multiply(@NotNull String $this$multiply, int times) { Intrinsics.checkParameterIsNotNull($this$multiply, "$this$multiply"); StringBuilder builder = new StringBuilder(); int var4 = 0; for (int var5 = times; var4 < var5; ++var4) { builder.append($this$multiply); } String var100 = builder.toString(); Intrinsics.checkExpressionValueIsNotNull(var100, "builder.toString()"); return var100; }
  109. fun String.multiply(times: Int): String { val builder = StringBuilder() repeat(times)

    { builder.append(this) } return builder.toString() } inline fun repeat(times: Int, action: () -> Unit) { for (i in 0 until times) { action() } } @NotNull public static final String multiply(@NotNull String $this$multiply, int times) { Intrinsics.checkParameterIsNotNull($this$multiply, "$this$multiply"); StringBuilder builder = new StringBuilder(); int var4 = 0; for (int var5 = times; var4 < var5; ++var4) { builder.append($this$multiply); } String var100 = builder.toString(); Intrinsics.checkExpressionValueIsNotNull(var100, "builder.toString()"); return var100; }
  110. fun String.multiply(times: Int): String { val builder = StringBuilder() repeat(times)

    { builder.append(this) } return builder.toString() } inline fun repeat(times: Int, action: () -> Unit) { for (i in 0 until times) { action() } }
  111. fun String.multiply(times: Int): String { val builder = StringBuilder() repeat(times)

    { builder.append(this) } return builder.toString() } inline fun repeat(times: Int, action: () -> Unit) { for (i in 0 until times) { action() } } fun buildString(builderAction: StringBuilder.() -> Unit): String { val builder = StringBuilder() builder.builderAction() return builder.toString() }
  112. fun String.multiply(times: Int): String { val builder = StringBuilder() repeat(times)

    { builder.append(this) } return builder.toString() } inline fun repeat(times: Int, action: () -> Unit) { for (i in 0 until times) { action() } } fun buildString(builderAction: StringBuilder.() -> Unit): String { val builder = StringBuilder() builder.builderAction() return builder.toString() }
  113. fun String.multiply(times: Int): String { val builder = StringBuilder() repeat(times)

    { builder.append(this) } return builder.toString() } fun buildString(builderAction: StringBuilder.() -> Unit): String { val builder = StringBuilder() builder.builderAction() return builder.toString() }
  114. fun String.multiply(times: Int): String { } fun buildString(builderAction: StringBuilder.() ->

    Unit): String { val builder = StringBuilder() builder.builderAction() return builder.toString() } repeat(times) { append(this) } } return buildString {
  115. fun String.multiply(times: Int): String { return buildString { } }

    fun buildString(builderAction: StringBuilder.() -> Unit): String { val builder = StringBuilder() builder.builderAction() return builder.toString() } repeat(times) { append(this) }
  116. fun String.multiply(times: Int): String { return buildString { } }

    fun buildString(builderAction: StringBuilder.() -> Unit): String { val builder = StringBuilder() builder.builderAction() return builder.toString() } repeat(times) { this.append(this) }
  117. fun String.multiply(times: Int): String { return buildString { } }

    fun buildString(builderAction: StringBuilder.() -> Unit): String { val builder = StringBuilder() builder.builderAction() return builder.toString() } repeat(times) { this.append(this) }
  118. fun String.multiply(times: Int): String { return buildString { } }

    fun buildString(builderAction: StringBuilder.() -> Unit): String { val builder = StringBuilder() builder.builderAction() return builder.toString() } repeat(times) { this.append(this) }
  119. fun String.multiply(times: Int): String { return buildString { repeat(times) {

    } } } fun buildString(builderAction: StringBuilder.() -> Unit): String { val builder = StringBuilder() builder.builderAction() return builder.toString() } append(this@multiply) this.
  120. fun String.multiply(times: Int): String { return buildString { repeat(times) {

    } } } fun buildString(builderAction: StringBuilder.() -> Unit): String { val builder = StringBuilder() builder.builderAction() return builder.toString() } append(this@multiply) this.
  121. fun String.multiply(times: Int): String { return buildString { repeat(times) {

    } } } inline fun repeat(times: Int, action: () -> Unit) { for (i in 0 until times) { action() } } fun buildString(builderAction: StringBuilder.() -> Unit): String { val builder = StringBuilder() builder.builderAction() return builder.toString() } append(this@multiply) this.
  122. inline fun repeat(times: Int, action: () -> Unit) { for

    (i in 0 until times) { action() } } fun buildString(builderAction: StringBuilder.() -> Unit): String { val builder = StringBuilder() builder.builderAction() return builder.toString() } fun String.multiply(times: Int): String { return buildString { repeat(times) { append(this@multiply) } } } @NotNull public static final String multiply(@NotNull final String $this$multiply, final int times) { Intrinsics.checkParameterIsNotNull($this$multiply, "$this$multiply"); return buildString(new Function1() { public void invoke(@NotNull StringBuilder $this$buildString) { Intrinsics.checkParameterIsNotNull($this$buildString, "..."); int var4 = 0; for (int var5 = times; var4 < var5; ++var4) { $this$buildString.append($this$multiply); } } }); }
  123. inline fun repeat(times: Int, action: () -> Unit) { for

    (i in 0 until times) { action() } } fun buildString(builderAction: StringBuilder.() -> Unit): String { val builder = StringBuilder() builder.builderAction() return builder.toString() } fun String.multiply(times: Int): String { return buildString { repeat(times) { append(this@multiply) } } } @NotNull public static final String multiply(@NotNull final String $this$multiply, final int times) { Intrinsics.checkParameterIsNotNull($this$multiply, "$this$multiply"); return buildString(new Function1() { public void invoke(@NotNull StringBuilder $this$buildString) { Intrinsics.checkParameterIsNotNull($this$buildString, "..."); int var4 = 0; for (int var5 = times; var4 < var5; ++var4) { $this$buildString.append($this$multiply); } } }); }
  124. inline fun repeat(times: Int, action: () -> Unit) { for

    (i in 0 until times) { action() } } fun buildString(builderAction: StringBuilder.() -> Unit): String { val builder = StringBuilder() builder.builderAction() return builder.toString() } fun String.multiply(times: Int): String { return buildString { repeat(times) { append(this@multiply) } } } @NotNull public static final String multiply(@NotNull final String $this$multiply, final int times) { Intrinsics.checkParameterIsNotNull($this$multiply, "$this$multiply"); return buildString(new Function1() { public void invoke(@NotNull StringBuilder $this$buildString) { Intrinsics.checkParameterIsNotNull($this$buildString, "..."); int var4 = 0; for (int var5 = times; var4 < var5; ++var4) { $this$buildString.append($this$multiply); } } }); }
  125. inline fun repeat(times: Int, action: () -> Unit) { for

    (i in 0 until times) { action() } } fun buildString(builderAction: StringBuilder.() -> Unit): String { val builder = StringBuilder() builder.builderAction() return builder.toString() } fun String.multiply(times: Int): String { return buildString { repeat(times) { append(this@multiply) } } } @NotNull public static final String multiply(@NotNull final String $this$multiply, final int times) { Intrinsics.checkParameterIsNotNull($this$multiply, "$this$multiply"); return buildString(new Function1() { public void invoke(@NotNull StringBuilder $this$buildString) { Intrinsics.checkParameterIsNotNull($this$buildString, "..."); int var4 = 0; for (int var5 = times; var4 < var5; ++var4) { $this$buildString.append($this$multiply); } } }); }
  126. fun String.multiply(times: Int): String { return buildString { repeat(times) {

    append(this@multiply) } } } return buildString(new Function1() { public void invoke(@NotNull StringBuilder $this$buildString) { Intrinsics.checkParameterIsNotNull($this$buildString, "..."); } }); int var4 = 0; for (int var5 = times; var4 < var5; ++var4) { $this$buildString.append($this$multiply); } @NotNull public static final String multiply(@NotNull final String $this$multiply, final int times) { Intrinsics.checkParameterIsNotNull($this$multiply, "$this$multiply"); }
  127. return buildString(new Function1() { public void invoke(@NotNull StringBuilder $this$buildString) {

    Intrinsics.checkParameterIsNotNull($this$buildString, "..."); } }); @NotNull public static final String multiply(@NotNull final String $this$multiply, final int times) { Intrinsics.checkParameterIsNotNull($this$multiply, "$this$multiply"); int var4 = 0; for (int var5 = times; var4 < var5; ++var4) { $this$buildString.append($this$multiply); } } fun buildString(builderAction: StringBuilder.() -> Unit): String { val builder = StringBuilder() builder.builderAction() return builder.toString() }
  128. return buildString(new Function1() { public void invoke(@NotNull StringBuilder $this$buildString) {

    Intrinsics.checkParameterIsNotNull($this$buildString, "..."); } }); @NotNull public static final String multiply(@NotNull final String $this$multiply, final int times) { Intrinsics.checkParameterIsNotNull($this$multiply, "$this$multiply"); int var4 = 0; for (int var5 = times; var4 < var5; ++var4) { $this$buildString.append($this$multiply); } } inline fun buildString(builderAction: StringBuilder.() -> Unit): String { val builder = StringBuilder() builder.builderAction() return builder.toString() }
  129. inline fun buildString(builderAction: StringBuilder.() -> Unit): String { val builder

    = StringBuilder() builder.builderAction() return builder.toString() } StringBuilder $this$buildString = new StringBuilder(); String var10000 = $this$buildString.toString(); Intrinsics.checkExpressionValueIsNotNull(var10000, "..."); return var10000; @NotNull public static final String multiply(@NotNull final String $this$multiply, final int times) { Intrinsics.checkParameterIsNotNull($this$multiply, "$this$multiply"); int var4 = 0; for (int var5 = times; var4 < var5; ++var4) { $this$buildString.append($this$multiply); } }
  130. fun String.multiply(times: Int): String { return buildString { repeat(times) {

    append(this@multiply) } } } inline fun repeat(times: Int, action: () -> Unit) { for (i in 0 until times) { action() } } inline fun buildString(builderAction: StringBuilder.() -> Unit): String { val builder = StringBuilder() builder.builderAction() return builder.toString() }
  131. fun String.multiply(times: Int): String { return buildString { repeat(times) {

    append(this@multiply) } } } inline fun repeat(times: Int, action: () -> Unit) { for (i in 0 until times) { action() } } inline fun buildString(builderAction: StringBuilder.() -> Unit): String { val builder = StringBuilder() builder.builderAction() return builder.toString() }
  132. fun String.multiply(times: Int): String { return buildString { repeat(times) {

    append(this@multiply) } } } inline fun repeat(times: Int, action: () -> Unit) { for (i in 0 until times) { action() } } inline fun buildString(builderAction: StringBuilder.() -> Unit): String { val builder = StringBuilder() builder.builderAction() return builder.toString() } package kotlin.text @kotlin.internal.InlineOnly public inline fun buildString( builderAction: StringBuilder.() -> Unit ): String = StringBuilder().apply(builderAction).toString() package kotlin @kotlin.internal.InlineOnly public inline fun repeat(times: Int, action: (Int) -> Unit) { contract { callsInPlace(action) } for (index in 0 until times) { action(index) } }
  133. fun String.multiply(times: Int): String { return buildString { repeat(times) {

    append(this@multiply) } } } inline fun repeat(times: Int, action: () -> Unit) { for (i in 0 until times) { action() } } inline fun buildString(builderAction: StringBuilder.() -> Unit): String { val builder = StringBuilder() builder.builderAction() return builder.toString() } package kotlin.text @kotlin.internal.InlineOnly public inline fun buildString( builderAction: StringBuilder.() -> Unit ): String = StringBuilder().apply(builderAction).toString() package kotlin @kotlin.internal.InlineOnly public inline fun repeat(times: Int, action: (Int) -> Unit) { contract { callsInPlace(action) } for (index in 0 until times) { action(index) } }
  134. fun String.multiply(times: Int): String { return buildString { repeat(times) {

    append(this@multiply) } } } inline fun repeat(times: Int, action: () -> Unit) { for (i in 0 until times) { action() } } inline fun buildString(builderAction: StringBuilder.() -> Unit): String { val builder = StringBuilder() builder.builderAction() return builder.toString() } package kotlin.text @kotlin.internal.InlineOnly public inline fun buildString( builderAction: StringBuilder.() -> Unit ): String = StringBuilder().apply(builderAction).toString() package kotlin @kotlin.internal.InlineOnly public inline fun repeat(times: Int, action: (Int) -> Unit) { contract { callsInPlace(action) } for (index in 0 until times) { action(index) } }
  135. fun String.multiply(times: Int): String { return buildString(capacity = length *

    times) { repeat(times) { append(this@multiply) } } }
  136. Related talks • Kotlin: Uncovered  Victoria Gonda, Chicago Roboto

    2017  https://vimeo.com/217569130 • Desugaring Kotlin features and their performance impact  Ionuț Baloșin, VoxxedDays Bucharest 2019  https://www.youtube.com/watch?v=D2a2vK-mfp4 • Kotlin Under the Hood  Chet Haase & Romain Guy, I/O ’19  https://www.youtube.com/watch?v=Ta5wBJsC39s
  137. References • Execution in the Kingdom of Nouns  https://steve-yegge.blogspot.com/2006/03/execution-in-

    kingdom-of-nouns.html • Kotlin 1.3 changes to functional types  https://kotlinlang.org/docs/reference/whatsnew13.html#functio ns-with-big-arity