c839f3c3d0
Each closure instance carries its own set of static variables. Multiple generators created using the same closure instance should share their static variables. This was not the case and static variables in closure generators behaved like normal local variables. Let's fix it by referencing closure and using its static locals. Pointer to the closure is located in the local following original input arguments. These are shifted by one, as Continuation occupies local 0. This also frees 8 bytes from c_Continuation (or 16 if you count 16-byte alignment).
29 linhas
201 B
Plaintext
29 linhas
201 B
Plaintext
|
|
generator closure
|
|
int(0)
|
|
int(0)
|
|
int(1)
|
|
int(1)
|
|
int(2)
|
|
int(2)
|
|
int(3)
|
|
int(3)
|
|
int(0)
|
|
int(0)
|
|
int(1)
|
|
int(1)
|
|
int(2)
|
|
int(2)
|
|
int(3)
|
|
int(3)
|
|
|
|
plain closure:
|
|
012
|
|
012
|
|
|
|
plain generator:
|
|
int(0)
|
|
int(1)
|
|
int(2)
|
|
int(3)
|