Closed oxinabox closed 5 years ago
@Keno it would be great if you could take a glance over this.
This is the code I was asking you about with Expr(:isdefined
last weekend.
All the remaining old tests are now passing.
though I had to move a function declaration out of a @testset
for some reason.
So there might be something fishy with closures or something still that is not tested for.
Also integration tests need to be added as all the variable capture tests had to be removed.
Also I seem to have lost compatiblity with julia 1.0 It gets errors when optimising the code after it has been instrumented.
I think I can simplify this massively by using whatever powers the @locals
macro.
There is no need to track the value of variables. As the variables themselves already do that. What we do need to do though: is find out what variables are defined at any point in time.
Expr(:isdefined, slot)
can do that for us, but we are not allowed to call that before theNewVarNode
is created. If we know that then we can build the variable name map, after we have decided if we are stopping or not. This means moving that decision to be part of the pass as wellCombined with #47 this starts to become much more performant. I want to get #47 in first (the current code in this branch just comments that check out)
The core of the idea is in this PR, and it doesn't outright crash (though I've not tried actually hitting any breakpoint yet)
Todo
pass.jl
describing the overall stratergyThe main thing we lose by doing this is that #25 becomes much harder, and the outlined stratergy in that issue can not be done anymore