1 2method Main.getHandleForStatic(java.lang.Class, java.lang.String, java.lang.invoke.MethodType):java.lang.invoke.MethodHandle 3{ 4............................. begin block 1 ............................. 5 0| invoke-static {}, java.lang.invoke.MethodHandles.publicLookup():java.lang.invoke.MethodHandles$Lookup 6.............................. end block 1 .............................. 7............................. begin block 2 ............................. 8 3| move-result-object v0 9 4| invoke-virtual {v0,v2,v3,v4}, java.lang.invoke.MethodHandles$Lookup.findStatic(java.lang.Class, java.lang.String, java.lang.invoke.MethodType):java.lang.invoke.MethodHandle 10.............................. end block 2 .............................. 11............................. begin block 3 ............................. 12 7| move-result-object v1 13 8| return-object v1 14.............................. end block 3 .............................. 15} 16 17method Main.getHandleForVirtual(java.lang.Class, java.lang.String, java.lang.invoke.MethodType):java.lang.invoke.MethodHandle 18{ 19............................. begin block 1 ............................. 20 0| invoke-static {}, java.lang.invoke.MethodHandles.publicLookup():java.lang.invoke.MethodHandles$Lookup 21.............................. end block 1 .............................. 22............................. begin block 2 ............................. 23 3| move-result-object v0 24 4| invoke-virtual {v0,v2,v3,v4}, java.lang.invoke.MethodHandles$Lookup.findVirtual(java.lang.Class, java.lang.String, java.lang.invoke.MethodType):java.lang.invoke.MethodHandle 25.............................. end block 2 .............................. 26............................. begin block 3 ............................. 27 7| move-result-object v1 28 8| return-object v1 29.............................. end block 3 .............................. 30} 31 32method Main.getLongCompareToHandle():java.lang.invoke.MethodHandle 33{ 34............................. begin block 1 ............................. 35 0| new-instance v0, java.lang.Long 36.............................. end block 1 .............................. 37............................. begin block 2 ............................. 38 2| const-wide v1:v2, #+0 (0x0000000000000000 | 0.00000) 39 7| invoke-direct {v0,v1,v2}, java.lang.Long.<init>(long):void 40.............................. end block 2 .............................. 41............................. begin block 3 ............................. 42 10| invoke-virtual {v0}, java.lang.Object.getClass():java.lang.Class 43.............................. end block 3 .............................. 44............................. begin block 4 ............................. 45 13| move-result-object v0 46 14| sget-object v1, java.lang.Integer.TYPE 47.............................. end block 4 .............................. 48............................. begin block 5 ............................. 49 16| invoke-static {v1,v0}, java.lang.invoke.MethodType.methodType(java.lang.Class, java.lang.Class):java.lang.invoke.MethodType 50.............................. end block 5 .............................. 51............................. begin block 6 ............................. 52 19| move-result-object v2 53 20| const-string v3, "compareTo" 54.............................. end block 6 .............................. 55............................. begin block 7 ............................. 56 22| invoke-static {v0,v3,v2}, Main.getHandleForVirtual(java.lang.Class, java.lang.String, java.lang.invoke.MethodType):java.lang.invoke.MethodHandle 57.............................. end block 7 .............................. 58............................. begin block 8 ............................. 59 25| move-result-object v0 60 26| return-object v0 61.............................. end block 8 .............................. 62} 63 64method Main.getStringConcatHandle():java.lang.invoke.MethodHandle 65{ 66............................. begin block 1 ............................. 67 0| const-string v0, "concat" 68.............................. end block 1 .............................. 69............................. begin block 2 ............................. 70 2| invoke-virtual {v0}, java.lang.Object.getClass():java.lang.Class 71.............................. end block 2 .............................. 72............................. begin block 3 ............................. 73 5| move-result-object v1 74 6| invoke-static {v1,v1}, java.lang.invoke.MethodType.methodType(java.lang.Class, java.lang.Class):java.lang.invoke.MethodType 75.............................. end block 3 .............................. 76............................. begin block 4 ............................. 77 9| move-result-object v2 78 10| invoke-static {v1,v0,v2}, Main.getHandleForVirtual(java.lang.Class, java.lang.String, java.lang.invoke.MethodType):java.lang.invoke.MethodHandle 79.............................. end block 4 .............................. 80............................. begin block 5 ............................. 81 13| move-result-object v0 82 14| return-object v0 83.............................. end block 5 .............................. 84} 85 86method Main.getStringValueOfLongHandle():java.lang.invoke.MethodHandle 87{ 88............................. begin block 1 ............................. 89 0| sget-object v0, java.lang.Long.TYPE 90.............................. end block 1 .............................. 91............................. begin block 2 ............................. 92 2| const-string v1, "valueOf" 93.............................. end block 2 .............................. 94............................. begin block 3 ............................. 95 4| invoke-virtual {v1}, java.lang.Object.getClass():java.lang.Class 96.............................. end block 3 .............................. 97............................. begin block 4 ............................. 98 7| move-result-object v2 99 8| invoke-static {v2,v0}, java.lang.invoke.MethodType.methodType(java.lang.Class, java.lang.Class):java.lang.invoke.MethodType 100.............................. end block 4 .............................. 101............................. begin block 5 ............................. 102 11| move-result-object v3 103 12| invoke-static {v2,v1,v3}, Main.getHandleForStatic(java.lang.Class, java.lang.String, java.lang.invoke.MethodType):java.lang.invoke.MethodHandle 104.............................. end block 5 .............................. 105............................. begin block 6 ............................. 106 15| move-result-object v0 107 16| return-object v0 108.............................. end block 6 .............................. 109} 110 111method Main.getStringValueOfObjectHandle():java.lang.invoke.MethodHandle 112{ 113............................. begin block 1 ............................. 114 0| new-instance v0, java.lang.Object 115.............................. end block 1 .............................. 116............................. begin block 2 ............................. 117 2| invoke-direct {v0}, java.lang.Object.<init>():void 118.............................. end block 2 .............................. 119............................. begin block 3 ............................. 120 5| invoke-virtual {v0}, java.lang.Object.getClass():java.lang.Class 121.............................. end block 3 .............................. 122............................. begin block 4 ............................. 123 8| move-result-object v0 124 9| const-string v1, "valueOf" 125.............................. end block 4 .............................. 126............................. begin block 5 ............................. 127 11| invoke-virtual {v1}, java.lang.Object.getClass():java.lang.Class 128.............................. end block 5 .............................. 129............................. begin block 6 ............................. 130 14| move-result-object v2 131 15| invoke-static {v2,v0}, java.lang.invoke.MethodType.methodType(java.lang.Class, java.lang.Class):java.lang.invoke.MethodType 132.............................. end block 6 .............................. 133............................. begin block 7 ............................. 134 18| move-result-object v3 135 19| invoke-static {v2,v1,v3}, Main.getHandleForStatic(java.lang.Class, java.lang.String, java.lang.invoke.MethodType):java.lang.invoke.MethodHandle 136.............................. end block 7 .............................. 137............................. begin block 8 ............................. 138 22| move-result-object v0 139 23| return-object v0 140.............................. end block 8 .............................. 141} 142 143method Main.main(java.lang.String[]):void 144{ 145............................. begin block 1 ............................. 146 0| invoke-static {}, Main.getStringConcatHandle():java.lang.invoke.MethodHandle 147.............................. end block 1 .............................. 148............................. begin block 2 ............................. 149 3| move-result-object v0 150 4| const-string v1, "[String1]" 151.............................. end block 2 .............................. 152............................. begin block 3 ............................. 153 6| const-string v2, "+[String2]" 154.............................. end block 3 .............................. 155............................. begin block 4 ............................. 156 8| invoke-polymorphic {v0,v1,v2}, java.lang.invoke.MethodHandle.invokeExact(java.lang.Object[]):java.lang.Object, (java.lang.String, java.lang.String):java.lang.String 157.............................. end block 4 .............................. 158............................. begin block 5 ............................. 159 12| move-result-object v3 160 13| sget-object v4, java.lang.System.out 161.............................. end block 5 .............................. 162............................. begin block 6 ............................. 163 15| invoke-virtual {v4,v3}, java.io.PrintStream.println(java.lang.String):void 164.............................. end block 6 .............................. 165............................. begin block 7 ............................. 166 18| invoke-static {}, Main.getStringValueOfObjectHandle():java.lang.invoke.MethodHandle 167.............................. end block 7 .............................. 168............................. begin block 8 ............................. 169 21| move-result-object v0 170 22| const-string v1, "[String1]" 171.............................. end block 8 .............................. 172............................. begin block 9 ............................. 173 24| invoke-polymorphic {v0,v1}, java.lang.invoke.MethodHandle.invokeExact(java.lang.Object[]):java.lang.Object, (java.lang.Object):java.lang.String 174.............................. end block 9 .............................. 175............................. begin block 10 ............................. 176 28| move-result-object v3 177 29| sget-object v4, java.lang.System.out 178.............................. end block 10 .............................. 179............................. begin block 11 ............................. 180 31| invoke-virtual {v4,v3}, java.io.PrintStream.println(java.lang.String):void 181.............................. end block 11 .............................. 182............................. begin block 12 ............................. 183 34| invoke-static {}, Main.getStringConcatHandle():java.lang.invoke.MethodHandle 184.............................. end block 12 .............................. 185............................. begin block 13 ............................. 186 37| move-result-object v0 187 38| const-string v1, "[String1]" 188.............................. end block 13 .............................. 189............................. begin block 14 ............................. 190 40| const-string v2, "+[String2]" 191.............................. end block 14 .............................. 192............................. begin block 15 ............................. 193 42| invoke-polymorphic {v0,v1,v2}, java.lang.invoke.MethodHandle.invoke(java.lang.Object[]):java.lang.Object, (java.lang.Object, java.lang.Object):java.lang.String 194.............................. end block 15 .............................. 195............................. begin block 16 ............................. 196 46| move-result-object v3 197 47| sget-object v4, java.lang.System.out 198.............................. end block 16 .............................. 199............................. begin block 17 ............................. 200 49| invoke-virtual {v4,v3}, java.io.PrintStream.println(java.lang.String):void 201.............................. end block 17 .............................. 202............................. begin block 18 ............................. 203 52| invoke-static {}, Main.getStringValueOfLongHandle():java.lang.invoke.MethodHandle 204.............................. end block 18 .............................. 205............................. begin block 19 ............................. 206 55| move-result-object v0 207 56| const-wide v1:v2, #+42 (0x000000000000002a | 2.07508e-322) 208 61| invoke-polymorphic {v0,v1,v2}, java.lang.invoke.MethodHandle.invokeExact(java.lang.Object[]):java.lang.Object, (long):java.lang.String 209.............................. end block 19 .............................. 210............................. begin block 20 ............................. 211 65| move-result-object v3 212 66| sget-object v4, java.lang.System.out 213.............................. end block 20 .............................. 214............................. begin block 21 ............................. 215 68| invoke-virtual {v4,v3}, java.io.PrintStream.println(java.lang.String):void 216.............................. end block 21 .............................. 217............................. begin block 22 ............................. 218 71| const v1, #+40 (0x00000028 | 5.60519e-44) 219 74| invoke-polymorphic {v0,v1}, java.lang.invoke.MethodHandle.invoke(java.lang.Object[]):java.lang.Object, (int):java.lang.String 220.............................. end block 22 .............................. 221............................. begin block 23 ............................. 222 78| move-result-object v3 223 79| sget-object v4, java.lang.System.out 224.............................. end block 23 .............................. 225............................. begin block 24 ............................. 226 81| invoke-virtual {v4,v3}, java.io.PrintStream.println(java.lang.String):void 227.............................. end block 24 .............................. 228............................. begin block 25 ............................. 229 84| new-instance v1, java.lang.Long 230.............................. end block 25 .............................. 231............................. begin block 26 ............................. 232 86| const-wide v2:v3, #+43 (0x000000000000002b | 2.12448e-322) 233 91| invoke-direct {v1,v2,v3}, java.lang.Long.<init>(long):void 234.............................. end block 26 .............................. 235............................. begin block 27 ............................. 236 94| invoke-polymorphic {v0,v1}, java.lang.invoke.MethodHandle.invoke(java.lang.Object[]):java.lang.Object, (java.lang.Long):java.lang.String 237.............................. end block 27 .............................. 238............................. begin block 28 ............................. 239 98| move-result-object v3 240 99| sget-object v4, java.lang.System.out 241.............................. end block 28 .............................. 242............................. begin block 29 ............................. 243 101| invoke-virtual {v4,v3}, java.io.PrintStream.println(java.lang.String):void 244.............................. end block 29 .............................. 245............................. begin block 30 ............................. 246 104| new-instance v1, java.lang.Integer 247.............................. end block 30 .............................. 248............................. begin block 31 ............................. 249 106| const v2, #+44 (0x0000002c | 6.16571e-44) 250 109| invoke-direct {v1,v2}, java.lang.Integer.<init>(int):void 251.............................. end block 31 .............................. 252............................. begin block 32 ............................. 253 112| invoke-polymorphic {v0,v1}, java.lang.invoke.MethodHandle.invoke(java.lang.Object[]):java.lang.Object, (java.lang.Integer):java.lang.String 254.............................. end block 32 .............................. 255............................. begin block 33 ............................. 256 116| move-result-object v3 257 117| sget-object v4, java.lang.System.out 258.............................. end block 33 .............................. 259............................. begin block 34 ............................. 260 119| invoke-virtual {v4,v3}, java.io.PrintStream.println(java.lang.String):void 261.............................. end block 34 .............................. 262............................. begin block 35 ............................. 263 122| invoke-static {}, Main.getLongCompareToHandle():java.lang.invoke.MethodHandle 264.............................. end block 35 .............................. 265............................. begin block 36 ............................. 266 125| move-result-object v0 267 126| new-instance v1, java.lang.Long 268.............................. end block 36 .............................. 269............................. begin block 37 ............................. 270 128| const-wide v2:v3, #+43 (0x000000000000002b | 2.12448e-322) 271 133| invoke-direct {v1,v2,v3}, java.lang.Long.<init>(long):void 272.............................. end block 37 .............................. 273............................. begin block 38 ............................. 274 136| invoke-polymorphic {v0,v1,v1}, java.lang.invoke.MethodHandle.invoke(java.lang.Object[]):java.lang.Object, (java.lang.Long, java.lang.Long):int 275.............................. end block 38 .............................. 276............................. begin block 39 ............................. 277 140| move-result v3 278 141| sget-object v4, java.lang.System.out 279.............................. end block 39 .............................. 280............................. begin block 40 ............................. 281 143| invoke-virtual {v4,v3}, java.io.PrintStream.println(int):void 282.............................. end block 40 .............................. 283............................. begin block 41 ............................. 284 146| const-wide v2:v3, #+44 (0x000000000000002c | 2.17389e-322) 285 151| invoke-polymorphic {v0,v1,v2,v3}, java.lang.invoke.MethodHandle.invoke(java.lang.Object[]):java.lang.Object, (java.lang.Long, long):int 286.............................. end block 41 .............................. 287............................. begin block 42 ............................. 288 155| move-result v3 289 156| sget-object v4, java.lang.System.out 290.............................. end block 42 .............................. 291............................. begin block 43 ............................. 292 158| invoke-virtual {v4,v3}, java.io.PrintStream.println(int):void 293.............................. end block 43 .............................. 294............................. begin block 44 ............................. 295 161| invoke-polymorphic/range {v7..v12}, java.lang.invoke.MethodHandle.invoke(java.lang.Object[]):java.lang.Object, (java.lang.Long, long):int 296.............................. end block 44 .............................. 297............................. begin block 45 ............................. 298 165| invoke-polymorphic/range {v3..v43}, java.lang.invoke.MethodHandle.invoke(java.lang.Object[]):java.lang.Object, (java.lang.Long, long):int 299.............................. end block 45 .............................. 300............................. begin block 46 ............................. 301 169| return-void 302.............................. end block 46 .............................. 303} 304