oxinabox / MagneticReadHead.jl

A cassette-based debugger | The Other Debugger
MIT License
50 stars 6 forks source link

New variable tracking method for Much speed #48

Closed oxinabox closed 5 years ago

oxinabox commented 5 years ago

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 the NewVarNode 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 well

Combined 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

The 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

oxinabox commented 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.

oxinabox commented 5 years ago

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.

oxinabox commented 5 years ago

I think I can simplify this massively by using whatever powers the @locals macro.