Commit graph

8498 commits

Author SHA1 Message Date
Daniel Kochmański
2d0ffd53b2 cmpc: remove the safety-level qualifier :SAFE from the inliner
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.
2023-09-25 14:35:14 +02:00
Daniel Kochmański
e32b5d5e1f cmp: cmpopt-cons: remove expand-simple-optimizer (rplaca, rplacd)
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.
2023-09-25 14:35:14 +02:00
Daniel Kochmański
c9ced2504d cmp: simplify the ast node CL:FUNCTION
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.
2023-09-25 14:35:14 +02:00
Daniel Kochmański
8e3f1f0a36 cmp: add a kludge for C1CONSTANT-VALUE using *OPTIMIZABLE-CONSTANTS*
This commit will be reverted soon, so it is not squashed onto the AST node
separation for variables and locations.
2023-09-25 14:35:14 +02:00
Daniel Kochmański
816c08340b cmp: have separate AST nodes for variables and locations
That will aid moving inline optimizations to the backend.
2023-09-25 13:13:27 +02:00
Daniel Kochmański
faebc7b266 cmp: enforce valid shape of si:function-block-name delcaration
Also fix a declaration in clos::make-raw-lambda function.
2023-09-25 13:13:27 +02:00
Daniel Kochmański
33df93da14 cmp: supply an explicit value for the empty location
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.
2023-09-25 13:13:27 +02:00
Daniel Kochmański
592a2cca17 cmp: expand-typep: fix broken (complex type) expansion
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))
2023-09-25 13:13:27 +02:00
Daniel Kochmański
4ec4187427 si_need_to_make_load_form_p: t_sse_pack does not need a constructor 2023-09-25 13:13:27 +02:00
Daniel Kochmański
02d6bdb0d3 tests: add a regression test for a bug encountered in this branch 2023-09-25 13:13:27 +02:00
Daniel Kochmański
d1fdd797a8 Merge branch 'gc-handle-fork' into 'develop'
Enable handle fork by GC

Closes #718

See merge request embeddable-common-lisp/ecl!303
2023-09-25 05:06:56 +00:00
Kirill A. Korinsky
fa9221ae6b Enable handle fork by GC 2023-09-25 05:06:55 +00:00
Marius Gerbershagen
c402748333 Merge branch 'environ_legacy' into 'develop'
Fix access to environ on Darwin

See merge request embeddable-common-lisp/ecl!301
2023-09-20 18:27:37 +00:00
Kirill A. Korinsky
76ef3e8e8a Fix access to environ on Darwin 2023-09-20 18:27:37 +00:00
Daniel Kochmański
78a22c21a3 cosmetic: fix indent 2023-09-19 22:41:42 +02:00
Daniel Kochmański
59ace31763 build: move HAVE_POSIX_RWLOCK to exported config
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.
2023-09-19 11:49:20 +02:00
Daniel Kochmański
595ca981f8 cosmetic: reindent file unixint.d 2023-09-19 09:44:53 +02:00
Daniel Kochmański
c3841dbb97 main: fix ECL_OPT_SIGNAL_HANDLING_THREAD to be adequate
unixint ignores the flag that enables the signal handling thread when it can't
create one.
2023-09-19 09:32:40 +02:00
Marius Gerbershagen
26981129d7 Merge branch 'cmpc-remove-with-stack' into 'develop'
Remove the special operator WITH-STACK and refactor function call AST nodes

See merge request embeddable-common-lisp/ecl!299
2023-09-18 17:34:05 +00:00
Daniel Kochmański
7ea81cf0cd tests: replace an idiom (compile nil '(lambda ..)) -> (cmplambda ..)
This makes code easier to read because of less nesting.
2023-09-15 10:21:06 +02:00
Daniel Kochmański
26efdffb8d tests: add a regression test for compiled multiple-value-call 2023-09-15 10:19:21 +02:00
Daniel Kochmański
338613fe07 cmp: add a comment describing fcall and mcall purpose 2023-09-15 09:35:43 +02:00
Daniel Kochmański
2a631151fd cmp: mcall: implement the type propagation, make similar to fcall
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.
2023-09-15 09:35:40 +02:00
Daniel Kochmański
d014360836 cmp: cosmetic: cmppass1-call: add a predicate lambda-form-p 2023-09-11 18:11:58 +02:00
Daniel Kochmański
9f2da346bb cmp: fcall: more through type propagation
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.
2023-09-11 18:11:58 +02:00
Daniel Kochmański
6e68703c38 cmp: c1call: remove the test for c-arguments-limit
We don't need this special clause anymore because FCALL caters to this edge case
that is specific to the C backend.
2023-09-11 18:11:58 +02:00
Daniel Kochmański
da985b945b cmp: merge AST nodes CALL-LOCAL and CALL-GLOBAL into FCALL
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.
2023-09-11 18:11:58 +02:00
Daniel Kochmański
29a37c339e cmp: merge AST nodes CL:FUNCALL and FCALL into the latter
The limit imposed on the number of arguments in the call is resolved in the
second pass. We get rid of the AST node CL:FUNCALL.
2023-09-11 18:11:58 +02:00
Daniel Kochmański
526663e069 cmpc: introduce a new loc CALL-STACK and simplify C2FCALL, C2MCALL 2023-09-11 18:11:58 +02:00
Daniel Kochmański
5e5db8be30 cmp: remove the special operator with-stack and company
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.
2023-09-11 18:11:55 +02:00
Daniel Kochmański
78d1add899 cmp: cmppass1-call: don't use with-stack for multiple value calls
WITH-STACK depends on FFI:C-INLINE so it can't be present in the first pass for
standard operators. As a bonus disassembled result is less obfuscated.
2023-09-11 16:54:21 +02:00
Daniel Kochmański
fb95debd48 cmp: cmppass1-call: don't use with-stack for unoptimized long calls
WITH-STACK depends on FFI:C-INLINE so it can't be present in the first pass for
standard operators. As a bonus disassembled result is less obfuscated.
2023-09-11 16:54:21 +02:00
Daniel Kochmański
a35b89866a cmp: cmppass1-call: refactor first pass operators funcall and apply 2023-09-11 16:54:21 +02:00
Daniel Kochmański
18e1a69ba7 cmp: add a new c1form mv-prog1
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.
2023-09-11 16:54:21 +02:00
Daniel Kochmański
167a935eee cmp: move type propagators for arrays to a separate file
cmpprop is used to propagate types among forms while cmpprop-array contains
propagators for arrays.
2023-09-11 16:54:21 +02:00
Daniel Kochmański
0a739fa5ac cmp: cosmetic changes in cmparray 2023-09-11 16:54:21 +02:00
Daniel Kochmański
9aedc0b5a7 core: symbols: always initialize cname
si:mangle-name assumes that symbol->symbol.cname is always initialized to nil or
a string denoting the name of the symbol, although the function make_symbol did
not initialize it, so the slot contained the value NULL (aka OBJNULL).

This value was returned as a second value that is not printable and should not
be available directly in Lisp environment. That lead to the segmentation fault
when results of

(si:mangle-name 'unknown-symbol)

were printed, because the second value was NULL.
2023-09-11 16:54:21 +02:00
Daniel Kochmański
63d9f41f19 predlib: define clos constants used by 'predlib' in 'symbols_table'
predlib.lsp is loaded before the clos module, but constants used by predlib were
defined in the latter. That worked because the C compiler inlines constants that
are fixnums, although it is a bit shaky to rely on particular optimizations.

To avoid this dependency we hardcode relevant constants in symbols_list.h and
later we assert in the clos module ethat their values are correct.
2023-09-11 16:54:21 +02:00
Daniel Kochmański
f27663bea6 contrib: ecl-cdb: fix invalid type declarations
There is no type :uint32-t nor unsigned-integer.
2023-09-11 16:54:21 +02:00
Marius Gerbershagen
cd14663e7e directory: fix a bug leading to missing matches in some cases
If a directory component followed :wild-inferior for paths
like **/some-dir/some-file, we were not finding all possible matches.
This came about because if we did not match in dir_recursive, we were
returning nil instead of the list of previously found matches.

Fixes #712.
2023-09-10 20:57:52 +02:00
Daniel Kochmański
337f022acc Merge branch 'master' into develop 2023-09-08 18:57:08 +02:00
Daniel Kochmański
be57e1b387 Merge branch 'develop' 2023-09-08 18:55:48 +02:00
Daniel Kochmański
873dc71709 toplevel: bump the year of the latest copyright 2023-09-03 15:41:18 +02:00
Marius Gerbershagen
9dcc26cdf2 changelog: add announcement for upcoming release 2023-09-03 15:32:42 +02:00
Daniel Kochmański
dba348902f changelog: add announcement placeholder and a new release node 2023-09-03 13:49:23 +02:00
Daniel Kochmański
0af7368857 release: update changelog and version number before the release
Fixes #706.
2023-09-03 13:46:23 +02:00
Marius Gerbershagen
76a0ff7fbd Merge remote-tracking branch 'ecl-main-repo/bdwgc-workaround' into develop 2023-09-02 15:22:47 +02:00
Marius Gerbershagen
6239d88810 Merge branch 'macos-followup' into 'develop'
`TARGET_OS_IPHONE` is always defined, but may have value `0`

See merge request embeddable-common-lisp/ecl!296
2023-08-26 12:17:55 +00:00
Kirill A. Korinsky
5eda224bdc
TARGET_OS_IPHONE is always defined, but may have value 0 2023-08-22 14:29:57 +02:00
Marius Gerbershagen
0b5ea3868d tests: move interrupt tests to stress test suite
These tests are not guaranteed to succeed but are still useful
to check for regressions for those configurations for which
thread synchronization primitives are interrupt safe.
2023-08-13 22:26:53 +02:00