Pseudocode: Generate synthetic VALUE_CONSUMER for both property and class delegates

This commit is contained in:
Alexey Sedunov
2014-07-21 17:08:06 +04:00
parent d07deeb5fb
commit 2d3ac9109b
7 changed files with 67 additions and 41 deletions
@@ -1,6 +1,6 @@
== Delegate ==
class Delegate {
fun get(_this: Any, p: PropertyMetadata): Int = 0
fun get(_this: Nothing?, p: PropertyMetadata): Int = 0
}
---------------------
L0:
@@ -13,12 +13,12 @@ sink:
<SINK> PREV:[<ERROR>, <END>]
=====================
== get ==
fun get(_this: Any, p: PropertyMetadata): Int = 0
fun get(_this: Nothing?, p: PropertyMetadata): Int = 0
---------------------
L0:
1 <START>
v(_this: Any)
magic[FAKE_INITIALIZER](_this: Any) -> <v0>
v(_this: Nothing?)
magic[FAKE_INITIALIZER](_this: Nothing?) -> <v0>
w(_this|<v0>)
v(p: PropertyMetadata)
magic[FAKE_INITIALIZER](p: PropertyMetadata) -> <v1>
@@ -55,10 +55,11 @@ L0:
1 <START>
v(val b by a)
r(a) -> <v0>
magic[VALUE_CONSUMER](val b by a|<v0>) -> <v1>
L1:
<END> NEXT:[<SINK>]
<END> NEXT:[<SINK>]
error:
<ERROR> PREV:[]
<ERROR> PREV:[]
sink:
<SINK> PREV:[<ERROR>, <END>]
<SINK> PREV:[<ERROR>, <END>]
=====================
@@ -1,5 +1,5 @@
class Delegate {
fun get(_this: Any, p: PropertyMetadata): Int = 0
fun get(_this: Nothing?, p: PropertyMetadata): Int = 0
}
val a = Delegate()
@@ -1,13 +1,13 @@
== Delegate ==
class Delegate {
fun get(_this: Any, p: PropertyMetadata): Int = 0
fun get(_this: Nothing?, p: PropertyMetadata): Int = 0
}
---------------------
=====================
== get ==
fun get(_this: Any, p: PropertyMetadata): Int = 0
fun get(_this: Nothing?, p: PropertyMetadata): Int = 0
---------------------
<v0>: {<: Any} NEW: magic[FAKE_INITIALIZER](_this: Any) -> <v0>
<v0>: {<: Nothing?} NEW: magic[FAKE_INITIALIZER](_this: Nothing?) -> <v0>
<v1>: {<: PropertyMetadata} NEW: magic[FAKE_INITIALIZER](p: PropertyMetadata) -> <v1>
0 <v2>: Int NEW: r(0) -> <v2>
=====================
@@ -19,5 +19,6 @@ Delegate() <v0>: Delegate NEW: call(Delegate(), <init>) -> <v0>
== b ==
val b by a
---------------------
a <v0>: * NEW: r(a) -> <v0>
<v1>: * NEW: magic[VALUE_CONSUMER](val b by a|<v0>) -> <v1>
a <v0>: Delegate NEW: r(a) -> <v0>
=====================