dropbox/pyston — pull request #173 by tjhance (2014-09-21 03:40:33+00:00)
Title: refactor the rewriter to do multiple passes

Now you don't have to call `setDoneUsing` or `setDoneGuarding` manually. Instead, the first pass through the rewriter just collects a bunch of "actions" to do (e.g., `call`, `getAttr`, `addGuard`). The when you call `commit` it figures out where all the uses are so it knows exactly where the last use is, and it knows exactly where the last guard is.

It seems to be a little slower than the past rewriter, but I *think* it's generating slightly faster assembly so it's a win on the whole. Not sure how to best measure but I think it's an improvement.

The big win though is that `objmodel.cpp` is *much* cleaner now that it isn't littered with `setDoneUsing`, `setDoneGuarding`, `std::move`, and so on.