The Racket repository
![]() 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 |
||
---|---|---|
pkgs | ||
racket | ||
.gitattributes | ||
.gitignore | ||
.mailmap | ||
.travis.yml | ||
appveyor.yml | ||
INSTALL.txt | ||
Makefile | ||
README.txt |
This is the source code for the main Racket distribution. See "INSTALL.txt" for information on building Racket. License ------- Racket Copyright (c) 2010-2016 PLT Design Inc. Racket is distributed under the GNU Lesser General Public License (LGPL). This implies that you may link Racket into proprietary applications, provided you follow the rules stated in the LGPL. You can also modify Racket; if you distribute a modified version, you must distribute it under the terms of the LGPL, which in particular states that you must release the source code for the modified software. See racket/src/COPYING_LESSER.txt for more information.