| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
| |
* genman.txr: add CSS rules targeting <dl class="items">,
which are now supported in man2html.
|
|
|
|
|
|
| |
* txr.1: Under the summary of place-mutating operations,
rewrite the description of push which falsely claims that the
pushed item is returned.
|
|
|
|
|
|
| |
* share/txr/stdlib/compiler.tl (compiler (pop-closure-spy,
pop-access-spy)): The stack underflow checkt must be done by
checking top, not the incoming spy argument.
|
|
|
|
| |
* txr.1: Fix about :reflect wrongly referring to :wrap.
|
|
|
|
| |
* txr.1: indent-foff misspelled as intent-foff.
|
|
|
|
|
| |
* txr.1: Fix grammar, punctuation, formatting, and
cases of misspellings landing on dictionary words.
|
|
|
|
|
| |
* eval.c (do_expand): argument of fun is not in "operator
position"; fixed wording.
|
|
|
|
|
| |
* txr.1: Fix two occurrences of \*(TL being separated from a
period by a space in the ARGUMENTS AND OPTIONS section.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* share/txr/stdlib/compiler.tl (%param-info%): New global
variable.
(compiler comp-fun-form): Use get-param-info function to get
param-info object.
(get-param-info): Retrieve object from cache, using the
function as the key. If not found, create the entry.
(compiler-emit-warning): Use get-param-info.
* share/txr/stdlib/param.tl (struct param-info): Remove symbol
slot, replacing it with the function.
(param-info :postinit): No need to do symbol-function lookup;
the function is given.
|
|
|
|
|
| |
* share/txr/stdlib/compiler.tl (reduce-lisp, reduce-constant):
Propagate source location to rewritten forms.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch eliminates parentheses from the error messages,
as well as a leading ./ being added to relative paths.
The word "warning: " is moved into the error message, so that
it does not appear before the location.
Example, when doing (compile-file "path/to/foo.tl").
Before patch:
warning: (./path/to/foo.tl:37): unbound function foo
After:
path/to/foo.tl:37: warning: unbound function foo
Now when I compile out of Vim, it nicely jumps to errors in
Lisp code.
* eval.c (eval_exception): Drop parentheses from error
location, add colon.
(eval_warn): Prepend "warning: " to format string.
(eval_defr_warn): Drop parentheses from location, and
prepend "warning: " to format string.
* parser.c (repl-warning): Drop "warning:" prefix.
* share/txr/stdlib/compiler.tl (open-compile-streams): Do not
do parent substitution for relative paths if the parent path
is the empty string "", to avoid inserting ./ onto relative
paths in that case.
* share/txr/stdlib/error.tl (sys:loc): Drop parentheses and
space from location.
(compile-error) Separate location with colon and space.
(compile-warning, compile-defr-warning): Likewise and add
"warning: " prefix.
* unwind.c (uw_rthrow): Drop "warning: " prefix.
(uw_warningf): Add "warning: " prefix.
(uw_dump_deferred_warnings): Drop "warning: " prefix.
|
|
|
|
|
|
|
|
|
| |
* share/txr/stdlib/compiler.tl (expand-quasi-args): Here,
expand-quasi-mods is being called with the wrong number of
arguments. This was likely intended to be a recursive call to
expand-quasi-args. Let's convert it to that. Removing this
case also works, but it is nicer not to generate the
sys:fmt-simple call.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We implement rudimentary compile-time checking beween function
calls and function definitions.
* share/txr/stdlib/compiler.tl (dstruct frag): We add one more
optional BOA parameter, corresponding to a new slot.
This is used when compiling a lambda. A lambda fragment is
annotated with the parameter parser object which gives
information about its arguments.
(struct fbinding): New slot, pars. When processing a sys:fbind
or sys:lbind form, we decorate the lexical function bindings
with the parameter object pulled from the lambda fragment
that is compiled for each function binding.
(*unchecked-calls*): New special variable. This is used for
checking, at the end of the compilation unit, the arguments of
calls to functions that were not defined at the time of the
call.
(compiler comp-fbind): When processing the lambda expressions,
propagate the parameter object from the compiled lambda
fragment to the function binding.
(compiler comp-fun-form): On entry, look up the function being
called and if it is lexical or has a global definition, check
the arguments. If it has no definition, push information into
the *unchecked-calls* list to do the check later, if possible.
Also, there is a behavior change here now: optimizations are
now applied here only to functions that don't have a lexical
binding. Thus if the application lexically redefines a
standard function, and calls it, we won't try to optimize it.
(param-check): New function.
* share/txr/stdlib/param.tl (param-info): New struct. This
presents information about a global function in a similar way
to param-parser, using some of the same fields. With this
object we can check the call to a lexical function or global
function in a uniform way, using the same code.
|
|
|
|
|
|
|
|
|
|
|
| |
* share/txr/stdlib/compiler.tl (compiler comp-apply-call): The
conditions for constant-folding a call expressions are too
weak. The first argument could be a quoted symbol, which is a
constant expression, and so we end up wrongly evaluating
an expression like (call 'print '3) at compile time.
We can constant-fold if the first expression evaluates to a
symbol, which names a constant-foldable function, or else
if it evaluates to something which is not a bindable symbol.
|
|
|
|
|
|
|
|
|
|
| |
* RELNOTES: Updated.
* configure, txr.1: Bumped version and date.
* share/txr/stdlib/ver.tl: Bumped.
* txr.vim, tl.vim: Regenerated.
|
|
|
|
|
| |
* txr.1: Relationship between make-similiar-hash and copy-hash
is expressed more accurately.
|
|
|
|
|
| |
* lib.c (funcall, funcall1, funcall2, funcall3, funcall4):
Remove unnecessary braces.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
ifq tN t0 label0 ifq tN t0 label1
... ...
label0: --> ...
if tN label2
label1: label1:
... ...
* share/txr/stdlib/optimize.tl (basic-blocks
thread-jumps-block): Implement case. There are there are 56
"hits" for this in the standard library.
|
|
|
|
|
|
|
|
|
|
| |
I have experimented with several approaches, and found that
this one has an immeasurably small effect on performance,
below the noise floor.
* vm.c (vm_jmp): Call sig_check_fast whenever there is a
backwards branch.
(vm_execute): Check for signals once, on entry.
|
|
|
|
| |
* METALICENSE: yeras typo teported by P. A. Patience.
|
|
|
|
|
|
|
|
|
| |
* tests/014/socket-basic.tl (%iters%): New variable.
2000 on MacOS, 5000 elsewhere.
(client, server): Use %iters% instead of hard-coded 5000.
(test): Rename to sock-test, since it clashes with the test
macro coming from common.tl, which we neeed to for the
os-symbol function.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The MacOS sed doesn't accept semicolon termination for
commands involving defining labels or branching to labels.
This is not a new issue, but it is revealed on newer MacOS
because the sed now complains about unused labels.
In the sed command ':x; /whatever/ { ...; tx }', everything
after the initial : is interpreted as a label.
* Makefile (DEPGEN): Split the sed command's syntax up into
logical lines using multiple -e commands, applying some
formatting with indentation to try to keep it readable.
It looks like multiple -e options just glue together to
make a program, as if they were lines of code; one -e
can define a label referenced by another, and even the
closing brace can be treated as a separate command.
|
|
|
|
|
| |
* configure: Don't try to use -nopie in Darwin environments.
With newer clang on the M1, it generates nuisance warnings.
|
|
|
|
|
|
|
|
|
|
| |
* configure (lit_align): Also don't calculate lit_align as 2
on Darwin/arm64; that is a hack needed on 32 bit x86 Mac OS.
* jmp.S: Define DEFUN for Arm64 on Darwin. We have to use %%
as the statement separator; semicolons are comments.
Use the same __aarch64__ code for __arm64__. We just need
some Apple specific tidbits before and after.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Thanks to a recent discussion in the GNU Make mailing list
about some issue related to grouped patterns, I hit upon the
realization that the rule y.tab.h y.tab.c: parser.y has
a common stem, y, which can be exploited to write a pattern
rule. This is only active in maintainer mode; in user mode,
the y.tab.h and y.tab.c are separately produced from .shipped
files.
* Makefile (y.tab.h): Eliminate rule which detects a removed
y.tab.h.
(y.tab.c): Delete rule, replacing with new rule.
(%.tab.c %.tab.h): New pattern rule, which groups the targets
together.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The float type promotes to double when passed as
a variadic argument.
This patch adds internal FFI types which models that
promotion. It uses double for its C type, while still
performing the range checks for float.
Also, the types be-float and le-float are rejected from
being variadic arguments.
* share/txr/stdlib/ffi.tl (analyze-argtypes): Rewrite
function, adding validation and substitution for the
variadic part of the argument type list. Map float type to
double, and reject be-float and le-float.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
| |
* ffi.c (ffi_ushort_get): Add the missing align_sw_get macro
that checks for and handles misalignment.
Commit e539fbc2af3bd4a5bd4ca3d9b567862005509aa1 made on
2017-06-05 added these macros and fixes to numerous functions.
The commit message claims that ffi_ushort_get was among the
functions fixed, but no change was made to the function.
|
|
|
|
| |
* ffi.c (ffi_uchar_put): Fix for C90 compat and consistency.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When a jmp instruction is replaced by the end instruction
that it jumps to, or possibly by a two-instruction sequence
ending in end, there can be more opportunities to optimize.
For instance, the second reduction in a sequence like this:
mov t3, t5 mov t3, t5
jmp label --> end t3 --> end t5
...
label:
end t3
* share/txr/stdlib/optimize.tl (basic-blocks peephole-block):
If the end-propagation is done, we change the linkage of the
current block to indicate that it has no next blocks. We
add it to the rescan list and set the recalc flag so the
liveness information is updated.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If a function has nothing but parameters that are not captured
in lexical closures, they can be converted registers. The
function then doesn't need a variable frame for its
parameters. This is similar to the eliminate-frame
optimization, and borrows the same code and logic.
* share/txr/stdlib/compiler.tl (compiler eliminate-frame): We
no longer assume that the code coming in starts with a frame
instruction we can eliminate using (cdr code) and an end
insruction we can eliminate with a trailing pattern.
This is because when this function is used for a lambda, this
is not the case; a lambda's variable frame is implicit,
created by the VM for any lambda with a nonzero frame size,
rather than by a frame instruction.
(compiler comp-let): In the call to eliminate-frame, we now
trim away the first and last instruction, to get rid of
the (frame ...) and (end ...).
(compiler comp-lambda-impl): Install a closure spy against the
variable frame to detect which variables are captured in
closures, similarly to in comp-let. Under the right
conditions, pass the code through eliminate-frame to turn
the variables into registers. The close instruction has to be
rewritten, because the frame size is now zero, and the number
of t registers has changed.
|
|
|
|
|
|
|
| |
* sysif.c (poll_wrap): Use seq_iter for efficience when
poll_list is a vector or other generalized sequence.
* txr.1: Change wording to say that poll-list is a sequence.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We have the situation that there are effectively two kinds of
spies: let constructs plant spies only in order to learn about
what variables are being captured, whereas lambdas plant spies
in order to intercept variable accesses (and to inform the
spies that are interested in what is captured). Let us split
these up into two separate types, with different methods,
in different stacks.
* share/txr/stdlib/compiler.tl (struct var-spy): Renamed to
closure-spy.
(var-spy accessed, var-spy assigned): Methods removed: the
closure-spy type has only the captured method.
(struct capture-var-spy): Renamed to accesss-spy.
(capture-var-spy var-spies): Renamed to access-spy
closure-spies.
(capture-var-spy captured): Method removed; the access spy is
doesn't receive captured calls.
(struct compiler): Slot var-spies removed, replaced with
closure-spies and access-spies.
(with-var-spy): Macro removed.
(with-spy): New function.
(with-closure-spy, with-access-spy): New macros.
(compiler push-var-spy, compiler pop-var-spy): Methods
removed.
(compiler push-closure-spy, compiler pop-closure-spy,
compiler push-access-spy, compiler pop-access-spy): New
methods.
(compiler comp-var, compiler comp-setq, compiler
comp-lisp1-setq, compiler comp-lisp1-value): Walk new
access-spies list rather than var-spies to report about
accesses and assignments.
(compiler comp-let): Use with-closure-spy macro rather than
with var-spy. The spy object is now a closure-spy type,
and the variable is cspy rather than vspy.
(compiler comp-lambda-impl): Use with-access-spy instead of
with-var-spy. The spy object is now of type access-spy.
It refers to the current me.closure-spies from the compiler.
|
|
|
|
|
|
|
|
|
| |
I'm giving up and just using a recursive make invocation
for the "retest" target.
* Makefile (retest): Depend on nothing. Remove the tst
directory and invoke make tests recursively.
(tests.clean): Target removed.
|
|
|
|
|
|
|
|
|
|
|
| |
The var-spy structure is only being used for detecting
captured variables, not assigned or accessed variables.
So the information about accessed and assigned is being
wastefully accumulated, never used.
* share/txr/stdlib/compiler.tl (struct var-spy): Remove slots
acc-vars and set-vars.
(var-spy accessed, var-spy assigned): Methods become no-ops.
|
|
|
|
|
|
|
| |
* share/txr/stdlib/optimize.tl (basic-blocks elim-dead-code):
Ironically, we have a dead variable named unreachable in
this function. Let's remove it and the build form which
calculates it.
|
|
|
|
|
| |
* txr.1: Fix wrong word; clarify what is first form and second
form.
|
|
|
|
|
|
|
|
| |
* txr.1: structural pattern matching intro is divided into
sections, rearranged and reworded, with additional detail,
especially in regard to variables. Also, "a the" typo fixed in
list pattern notation section. Pattern matching is now taken
out of beta; the paragraph about the beta status is removed.
|
|
|
|
|
|
|
|
|
| |
* txr.1: Add a missing section defining meta-symbols,
meta-numbers and meta-expressions, which explains the sys:var
and sys:expr shorthand. Also documented are corner cases
involving deceptive floating-point syntax.
Everywhere in the document, we normalize "meta-variable"
as "meta-symbol".
|
|
|
|
|
|
|
| |
* lib.c (cat_str): Traverse sequences of strings efficiently
using seq_iter framework.
* txr.1: Document.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* arith.c (toint): Use self instead of repeating function name
in diagnostic.
* ftw.c (ftw_wrap): Likewise.
* glib.c (glow_wrap): Likewise.
* rand.c (make_random_state, random): Likewise.
* lib.c (nreverse, reverse, remove_if, int_str, less, chr_str,
chr_str_set, unintern, rehome_sym, in): Likewise.
(vector, obj_print_impl): Pass self to helper function instead
of repeating identical literal.
|
|
|
|
| |
* txr.1: Rewrote Macros section intro paragraphs.
|
|
|
|
|
| |
* txr.1: The description of command-get-buf mistakenly refers
to command-get.
|
|
|
|
|
|
| |
* lib.c (cat_str_measure): Use the self parameter in
diagnostics rather than cat-str, so errors are reported
against the correct function.
|
|
|
|
|
|
|
|
|
|
| |
* RELNOTES: Updated.
* configure, txr.1: Bumped version and date.
* share/txr/stdlib/ver.tl: Bumped.
* txr.vim, tl.vim: Regenerated.
|
|
|
|
|
|
| |
* share/txr/stdlib/optimize.tl (basic-blocks peephole-blocks):
Extend dead reg mov pattern to also handle the getlx, getv,
getf and getfb instructions.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When the result of a function call is not used, the call can
be eliminated if the function has no effects.
Effect-free functions are superset of constant-foldable
functions. Not all effect-free functions are const-foldable
because in some cases, creating an object at run-time is a
documented semantics which cannot be constant-folded. For
instance (list 1) cannot be constant folded, because it may be
relied upon to generate a fresh object each time it is called.
However, bringing a new list to life is not an effect. If
the value is not used, we can safely eliminate it.
The same reasoning applies to (gensym "abc"). It must generate
a unique symbol each time, and so cannot be constant-folded.
But call to gensym whose value is not used can be eliminated.
* share/txr/stdlib/compiler.tl (%effect-free-funs%): List of
side-effect-free functions registered in eval.c.
(%effect-free%): Hash of effect-free functions, incorporating
%const-foldable% also.
* share/txr/stdlib/optimize.tl (basic-blocks peephole-block):
Refer to %effect-free% rather than %const-foldable%.
|
|
|
|
|
| |
* share/txr/stdlib/compiler.tl (%const-foldable-funs%): Add
rest, nilf, tf, join, join-with, empty.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In this patch, we optimize away closures that are not used.
Unused closures that have been hoisted to the top level are
not affected. We look for close instructions which produce
a dead treg, and rewrite these to jmp instructions to the same
label. When this happend, we set a flag for a dead code
elimination pass to be done again, to actually remove the now
unreachable closure code.
* share/txr/stdlib/optimize.tl (struct basic-blocks): New
slot, reelim, indicating that dead code elimination is to be
done again after peephole since the control flow graph has
changed.
(basic-blocks peephole-block): New pattern for eliminating a
dead register, targeting the close instruction.
(basic-blocks peephole): After peephole, check whether the
reelim flag has been set and do elim-dead-code again.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The main idea in this patch is to identify calls functions
whose values are not used and which have no side effects. For
this purpose, we borrow the same set of functions that we
use as targets for constant folding: those in the compiler's
%const-foldable% hash.
A call is dead if it is a gcall or gapply instruction which
calls one of these functions, and the destination register is
dead.
To maximize the opportunities for this elimination, whenever
we eliminate such an instruction, we mark the block for
re-scanning, and we re-calculate the liveness info for that
block and then globally.
* share/txr/stdlib/compiler.tl (struct compiler): New slots,
datavec and symvec.
(compiler get-datavec): Cache the calculated datavec in the
new datavec slot.
(compiler get-symvec): Cache the calculated symvec in the
new symvec slot.
(compiler optimize): Pass the symvec to the basic-blocks BOA
constructor; it is now needed for identifying functions
that are referenced by symvec index number in the gcall and
gapply instructions.
* share/txr/stdlib/optimize.tl (struct basic-blocks): New
symvec slot, added to the the BOA parameter list also.
New slot recalc, indicating re-calculation of liveness is
needed.
(basic-blocks cut-block): Use pushnew to put bl onto the
rescan list, to prevent duplicates. Also push the new block
onto the rescan list.
(basic-blocks local-liveness): This method can now be called
again to re-calculate local liveness, so we must reset the
live slot to nil.
(basic-blocks calc-liveness): Take an optional list of blocks
to scan for local liveness, defaulting to all of them.
(basic-blocks peephole-block): Factor out some register
liveness tests to local functions. Add a pattern targetting
gcall and gapply instructions, testing for a dead register
from a call to a %const-foldable% function. Use pushnew
everywhere to add to the rescan list. Set the recalc flag when
the liveness-based reductions are applied.
(basic-blocks peephole): If there are blocks to be scanned
again, then if the recalc flag is set, recalculate local
liveness for all the blocks to be re-scanned and re-do global
liveness.
|
|
|
|
|
| |
* lib.c (sort): Return the copied and sorted object object,
not the original.
|