We cannot compare with (equal) here because subtype relations can
differ for member and eql types even if the type specifiers are the
same under equal.
Introduce ecl_cmp_symbol_value and ecl_cmp_setq which do the minimal
amount of work needed to implement symbol-value and setq for dynamic
variables which we have checked to be non-null and of type symbol in
the compiler.
Also introduce a type check in ecl_symbol_value to be consistent with
ecl_setq which also checks the type. These two functions are mainly
used for the embedding interface now, so for that reason it is also
useful to have a type check in there.
This is inconsistently implemented in that only very few places
actually check for proper lists. Moreover, it slows down code that
uses those functions a lot.
A previous commit unconditionally configures Boehm GC to support fork.
This breaks the Windows MSVC build, producing an error dialog with the
message "Fatal error in GC: fork() handling unsupported".
This commit restricts the call to GC_set_handle_fork to non-Windows
hosts.
ffi:c-inline allowed for the xyntax @object (similar to the previous commit),
although only syntax "@(return x) = xxx" is specified in the documentation.
We've supported syntax for clines that allowed inlining Lisp objects when they
were prepended with @, for example (ffi:clines "#include @my-variable"); that
said I have not seen a single use of this syntax and it compilcated the logic
(the read object needed to land in the data segment during the second pass).
This resolves a todo in cmpc-opt-printer.lsp:
;;; TODO move mundane inliners to the sysfun database.
We leave only the optimizer for CL:PRINC that is not mundane.
The default C inliner for CL:PRINC is also defined in the sysfun database.
This inlining qualifier was commented to be applied only in the safe code, but
in the code it was applied all the same as :always (as a second choice after the
unsafe optimizer). Moreover there was only single sysfun that specified it.
RPLACA and RPLACD macros were the only clients of SIMPLE-OPTIMIZER-FUNCTION and
said optimizer took more code than explicitly writing twice the expansion as the
compiler macro.
The old AST node for CL:FUNCTION accounted for a possibility that a lambda is
passed, although c1function (the only function that produces this node),
discarded that possibility in favor expanding lambda to explicit FLET.
Previously we've passed a fixnum 0 that meant the empty loc. Even earlier
probably NIL was used for that purpose. That have lead to an accidental
complexity where fixnums could not be stored in the value vector.
This expansion did not account for the object not being a number. In that case
REALPART errored in the compiled code. Example:
(typep *package* '(complex float))
This is b ecause we use this flag to decide whether the rwlock is implemented
from posix or whether we use our own structure. That influences the size and
offsets in cl_core. Without this commit using
(defun known-signals ()
(ffi:c-inline nil nil :object "cl_core.known_signals"
:one-liner t :side-effects nil))
While HAVE_POSIX_RWLOCK was true during the build returns garbage. The same
applies to other members after the processes group.
While there is less we can doc compared FCALL, we still can infer the function
type and propagate it. Both AST nodes FCALL and MCALL accept now the same set of
arguments and MCALL has a new type propagator.
We do the type propagation in the appropriate pass and in order. We also ensure
that all arguments have the type propagated and (when applicable) narrowed.
This yields simpler AST that is easier to reason about. One of the benefits is
that we propagate argument types for FCALL disregarding of whether it is a
short or long call.
These operators were a hack that reached to the code generation from the AST
transformation pass encoding things that were clearly targetting the c language.
Recent commits remove uses of this operator and it is no longer needed.
We should start with high-level ast and then we lower it depending on the
backend. Having a Common Lisp backend should be a good test. WITH-STACK does
not belong to the AST and this is the first commit that removes its usage.
This commit implements MULTIPLE-VALUES-PROG1 by means of adding a new AST type
instead of transforming to a call of WITH-STACK.