racket/pkgs/racket-test/tests/generic
Matthew Flatt 0c38da0ee2 change intermediate representation for the bytecode optimizer
Correct the second-biggest design flaw in the bytecode optimizer:
instead of using a de Bruijn-like representation of variable
references in the optimizer pass, use variable objects.

This change is intended to address limitations on programs like the
one in

 http://bugs.racket-lang.org/query/?cmd=view&pr=15244

where the optimizer could not perform a straightforward-seeming
transformation due to the constraints of its representation.

Besides handling the bug-report example better, there are other minor
optimization improvements as a side effect of refactoring the code. To
simplify the optimizer's implementation (e.g., eliminate code that I
didn't want to convert) and also preserve success for optimizer tests,
the optimizer ended up getting a little better at flattening and
eliminating `let` forms and `begin`--`let` combinations.

Overall, the optimizer tests in "optimize.rktl" pass, which helps
ensure that no optimizations were lost. I had to modify just a few
tests:

 * The test at line 2139 didn't actually check against reordering as
   intended, but was instead checking that the bug-report limitation
   was intact (and now it's not).

 * The tests around 3095 got extra `p` references, because the
   optimizer is now able to eliminate an unused `let` around the
   second case, but it still doesn't discover the unusedness of `p` in
   the first case soon enough to eliminate the `let`. The extra
   references prevent eliminating the `let` in both case, since that's
   not the point of the tests.

Thanks to Gustavo for taking a close look at the changes.

 LocalWords:  pkgs rkt
2016-02-16 21:05:15 -07:00
..
alist.rkt
base-interfaces.rkt change intermediate representation for the bytecode optimizer 2016-02-16 21:05:15 -07:00
benchmark.rkt
contract.rkt racket/generics: fix generated <gen>/c 2015-07-20 06:39:18 -06:00
custom-hash.rkt
custom-write.rkt
defaults.rkt
empty-interface.rkt
equal+hash.rkt change intermediate representation for the bytecode optimizer 2016-02-16 21:05:15 -07:00
errors.rkt Move unstable/macro-testing to syntax/macro-testing. 2015-08-05 13:11:54 -05:00
fallbacks.rkt
from-docs.rkt
from-unstable.rkt
impersonate.rkt add property support to chaperone-generic, etc. 2015-02-19 09:56:50 -07:00
info.rkt
iterator.rkt
marked.rkt
methods.rkt
poly-contracts.rkt
pr13737.rkt
stream.rkt
struct-form.rkt
syntax-errors.rkt switch to set-of-scopes expander 2015-07-16 14:20:00 -06:00
tests.rkt add property support to chaperone-generic, etc. 2015-02-19 09:56:50 -07:00
top-level.rkt