slavapestov/factor — pull request #1247 by bjourne (2014-12-11 13:41:09+00:00)
Title: Non det compiler (#1227 fix)

Here is a pr to fix the #1227 bug and also improve the compiler in some ways.

When I look around for bugs, meanwhite I like to clean up and refactor stuff and also write docs. The pr contains "many things" so maybe I should have split it up, but it's so hard to juggle commits around. :)

First I changed many words which have a stack effect like `( cfg -- cfg' )` to `( cfg -- )`. I think the former stack effect is wrong because the words mutate the cfg passed in and they don't return a new one, like the stack effect implies. And with the stack effect on most words being `( cfg -- )` it becomes much easier to combine them.

Also removed `compiler.cfg.stacks.uninitialized` because it is completely replaced by `compiler.cfg.stacks.vacant`. And added some docs.

The real fix is in `basis/compiler/cfg/dominance/dominance.factor` in `compute-dom-children`. It uses `assoc-each` to iterate a map so the order is non-deterministic. The fix is just to sort it so you are guaranteed one order: `[ [ number>> ] sort-with ] assoc-map`