解剖Kotlin バイトコードを読み解く (original) (raw)

dόΠτίʔυΛಡΈղ͘d
%SPJE,BJHJ
3PP...")

w 5PTIJIJSP:BHJ !TZTZBHJ

w DPPLQB...")

")

")

͚ͲɺͰ΋·͊ผʹ+BWBΛ࢖͍ͬͯ
ͯΫϦςΟΧϧʹࠔ...")

ײͯ͡΄͍͜͠ͱ
")

+BWBʹ͢Δͱ
͜Μͳײ͡ͳͷ͔
")

؆୯ศར͡ΌΜ
")

΍ͬͯΈΔ͔ʙ
")

؆୯ʹղઆ͢Δ
w ͦͷݴޠػೳΛ࢖ͬͨίʔυΛσ...")

")

")

")

")

w ؔ਺ܕͱϥϜμࣜ
w ֦ுؔ਺
w ϓϩύςΟ
ΞδΣϯμલฤ
")

w OVMMڐ༰ܕ
w ֦ுؔ਺
ΞδΣϯμޙฤ
")

")

OVMMڐ༰ܕͱ͸Կ͔
str.length
ίϯύ...")

ݥͳݺͼग़͠Λબ୒͢Δ
OVMMڐ༰ܕͱ͸Կ͔
...")

ͲͷΑ͏ʹ࣮ݱ͞Ε͍ͯΔ͔ʁ
")

nonNull.length
")

nullable?.length
")

")

if(nullable == null) {
Intrin...")

= text.length
")

")

ͲͷΑ͏ʹ࣮ݱ͞Ε͍ͯΔ͔ʁ
")

")

")

calc(1, 2, { a, b -> a + b + seed...")
a + b + seed }) final byte seed = 10; calc(1, 2, (Function2)(new Function2(2) { public final int invoke(int a, int b) { return a + b + seed; } })); Ϋϩʔδϟͷ৔߹͸ແ໊ΫϥεΛੜ੒͢Δ

calc(1, 2, { a, b -> seed++; a + ...")
seed++; a + b }) final IntRef seed = new IntRef(); seed.element = 10; calc(1, 2, (Function2)(new Function2(2) { public final int invoke(int a, int b) { int var3 = seed.element++; return a + b; } })); Ωϟϓνϟͨ͠ม਺Λมߋ͢Δ৔߹͸ 3FGΫϥε͕࢖ΘΕΔ

")

ͨؔ਺Λݺͼग़ͤΔΑ͏ʹͳΔ
֦ுؔ਺ͱ͸Կ͔
33...")

੹຿Λ௥Ճͨ͠ΓͰ͖Δ
֦ுؔ਺ͱ͸Կ͔
contex...")

੹຿Λ௥Ճͨ͠ΓͰ͖Δ
֦ுؔ਺ͱ͸Կ͔
contex...")

ͲͷΑ͏ʹ࣮ݱ͞Ε͍ͯΔ͔ʁ
")

= getSystemServi...")

")

context....")

")

ͲͷΑ͏ʹ࣮ݱ͞Ε͍ͯΔ͔ʁ
")

")

@NotNull
private String n...")
int getId() { return this.id; } @NotNull public final String getName() { return this.name; } public final void setName(@NotNull String var1) Intrinsics.checkParameterIsNotNull(var1, “<set-?>"); this.name = var1; } class Product(val id: Int, var name: String)

@NotNull
private String n...")
int getId() { return this.id; } @NotNull public final String getName() { return this.name; } public final void setName(@NotNull String var1) Intrinsics.checkParameterIsNotNull(var1, “<set-?>"); this.name = var1; } class Product(val id: Int, var name: String) QSJWBUFͳϑΟʔϧυ͕એݴ͞ΕΔ

@NotNull
private String n...")
int getId() { return this.id; } @NotNull public final String getName() { return this.name; } public final void setName(@NotNull String var1) Intrinsics.checkParameterIsNotNull(var1, “<set-?>"); this.name = var1; } class Product(val id: Int, var name: String) QSJWBUFͳϑΟʔϧυ͕એݴ͞ΕΔ WBMͷ৔߹HFUUFSͷΈੜ੒͞ΕΔ

@NotNull
private String n...")
int getId() { return this.id; } @NotNull public final String getName() { return this.name; } public final void setName(@NotNull String var1) Intrinsics.checkParameterIsNotNull(var1, “<set-?>"); this.name = var1; } class Product(val id: Int, var name: String) QSJWBUFͳϑΟʔϧυ͕એݴ͞ΕΔ WBMͷ৔߹HFUUFSͷΈੜ੒͞ΕΔ WBSͷ৔߹HFUUFSTFUUFS͕ੜ੒͞ΕΔ

product.name = "meat"
")

")

")

")

εΩοϓͨ͠Γྫ֎Λεϩʔ͢
Δ͚ͩͷγϯϓϧͳߏ଄͚ͩͲ
...")

!/PO/VMMΛ׆༻
ͨ͠ΓOVMMνΣοΫΛద੾ʹ࣮
૷͢Ε͹͍͍ͩ...")

view.alpha = ...")

")

౓͠ͳ͖Ό͍͚ͳ͍݁͠ہ੩త
ؔ਺ͷݺͼग़͠Λஔ͖׵͑Δͩ
͚ͩ...")

Λద੾ʹӡ༻͢Ε͹͍͍͚ͩͰ
͸ʁʁ
")

")

͜ͷ*OUFOUύ...")

*OUFOUࣗ਎ʹ...")

*OUFOUࣗ਎ʹ...")

͔Μ͕͑ΒΕΔ੹຿Λɺ࣮ࡍʹର৅ͷΫ
ϥεʹ࣋ͨͤ...")

")

͔֬Ίͯ͘Εʂ
")

")