oxinabox / MagneticReadHead.jl

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

Hack: just ban ever reading variables that are NewvarNode #68

Closed oxinabox closed 5 years ago

oxinabox commented 5 years ago

This does technically solve #56 (cc @KristofferC) but at significant decrease in functionality. The issue has always been about when you are allowed to call Expr(:isdefined, slot) on a slot that has been touched by NewVarnode.

This PR says the answer is "Never" Previously we said: not until it is either assigned, or uses in a :call.

I do not love this.

If this actually is the best we can do, then the code needs some cleanup. Which will at least likely decrease the compile time a bit. (though I wouldn't say it would be by much Maybe 5-50% tops).

Tested with:

julia> using TimerOutputs, MagneticReadHead;

julia> @run TimerOutputs.print_header(stdout, 0.5, 0.1, 3, 3, 7, false, true, 11, true, "oio")
 -----------------------------------------------
oxinabox commented 5 years ago

Note: if we are doing this we don't need to bother with isdefined since I think the only way to get something not defined is to create it with a NewvarNode.

So we could at least remove this check for everything other than them? Edit: No that can't be right. Some parts of the code are before the first assignement.