diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2025-06-19 00:50:48 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2025-06-19 00:50:48 -0700 |
commit | fdbe06cd26523f3ccc7670146a696a88e8c7fb87 (patch) | |
tree | ccf1ca0494a235f9cf394fa139c0ed3ee9bc49eb | |
parent | 7f2c07785dc9d9183e1576ab8a40bc190395a5b3 (diff) | |
download | txr-fdbe06cd26523f3ccc7670146a696a88e8c7fb87.tar.gz txr-fdbe06cd26523f3ccc7670146a696a88e8c7fb87.tar.bz2 txr-fdbe06cd26523f3ccc7670146a696a88e8c7fb87.zip |
compiler/load: tlo version number increment,
The new tail call optimization relies on a fix to the
VM's block instruction. This means that .tlo files in which
TCO has been applied might not run correctly with
TXR 300 or older. For that reason, we bump up the version
number.
* parser.c (read_file_common): Accept version 8.0 files,
while continuing to allow 6 and 7 regardless of minor number.
We get picky about minor number so that in the future we
can use a a minor number increment for backward compatible
changes like this. We would only like to go to version 9 if
the VM changes in such a way that we cannot load 8 any more.
If we can still load 8.0, we would like to go to 8.1.
* stdlib/compiler.tl (%tlo-ver%): Change to 8.0.
* txr.1: Documented.
-rw-r--r-- | parser.c | 8 | ||||
-rw-r--r-- | stdlib/compiler.tl | 2 | ||||
-rw-r--r-- | txr.1 | 3 |
3 files changed, 11 insertions, 2 deletions
@@ -863,10 +863,16 @@ static val read_file_common(val self, val stream, val error_stream, val compiled if (compiled && first) { val major = car(form); - if (neq(major, num_fast(6)) && neq(major, num_fast(7))) + val minor = cadr(form); + + if (lt(major, num_fast(6)) || gt(major, num_fast(8)) || + (major == num_fast(8) && minor != zero)) + { uw_throwf(error_s, lit("cannot load ~s: version number mismatch"), stream, nao); + } + big_endian = caddr(form); first = nil; version_form = form; diff --git a/stdlib/compiler.tl b/stdlib/compiler.tl index 6a5e189f..fc0e9140 100644 --- a/stdlib/compiler.tl +++ b/stdlib/compiler.tl @@ -2566,7 +2566,7 @@ (defvarl %big-endian% (equal (ffi-put 1 (ffi uint32)) #b'00000001')) -(defvarl %tlo-ver% ^(7 0 ,%big-endian%)) +(defvarl %tlo-ver% ^(8 0 ,%big-endian%)) (defvarl %package-manip% '(make-package delete-package use-package unuse-package @@ -95099,6 +95099,9 @@ Version 261 introduces JSON syntax. Compiled code which contains embedded JSON literals is not loadable by \*(TX 260 and older. +Version 301 produces version 8.0 files and loads version 8.0 +files, as well as version 6 and 7 files regardless of minor number. + .SS* Recommendations for Unused Variable Diagnostics By default, the |