Commit graph

8471 commits

Author SHA1 Message Date
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
Marius Gerbershagen
4db4d00c20 add workaround for broken bdwgc version 8.2.4 2023-08-13 21:37:34 +02:00
Marius Gerbershagen
0e05a7f360 unixsys.d: replace incorrect use of ecl_alloc_atomic with ecl_alloc
We are allocating pointers to other pointers which are managed by the
gc so we have to let the gc scan the allocated memory to prevent
objects from being reclaimed by the gc too early.
2023-08-07 19:13:26 +02:00
Marius Gerbershagen
ca82642112 Merge branch 'ecl-man-synchronize' into 'develop'
ECL man page clarification

See merge request embeddable-common-lisp/ecl!295
2023-08-06 08:46:39 +00:00
Marius Gerbershagen
389e89d4d7 tests: add missing #+unicode in run-program-encoding 2023-08-03 15:21:08 +02:00
Marius Gerbershagen
d7330ae762 cmp: fix inline expansion of princ
Has to return the object to be printed.
2023-08-03 15:13:30 +02:00
Marius Gerbershagen
7761d0b27a cmp: fix coercion between lisp types and representation types
Signal an error if there is no function that coerces some C variable
c_object to a lisp object instead of emitting invalid C code like
`ECL_NIL(c_object)`.

Moreover, fix the table of representation types:

:object needs no coercion which is correctly implemented by using an
empty string for the function name.

:void should not use `nil` as the lisp type since nil is a subtype of
fixnum which lead to us previously choosing "ecl_fixnum" as the
coercion function in unsafe code. By using `t` as the lisp type we
avoid this.
2023-08-03 15:09:37 +02:00
Dmitry Solomennikov
aa2a4a1f97 ECL man page clarification
This changes clarify ECL man page, synchronize it with current command
line parameter list and cleanup manual page source format.

Signed-off-by: Dmitry Solomennikov <dmitrys99@mail.ru>
2023-08-03 12:24:50 +03:00
Marius Gerbershagen
c33f40a3db load.d: add missing #include directive 2023-08-02 17:36:51 +02:00
Marius Gerbershagen
1341b79eca alloc_2.d: fix gc configuration for precise gc
The local variables o and c were lost during the refactor in
bd723748d7, re-add them. Also,
the initialization in init_type_info() got moved to the wrong place in
the same refactor, this needs to be called later on.

The function GC_init_explicit_typing is internal to bdwgc and called
automatically in GC_make_descriptor. Therefore, we don't need to call
it during GC initialization.
2023-08-02 17:27:16 +02:00
Marius Gerbershagen
0092cbb695 contrib: cl-simd: remove unnecessary quotes 2023-08-01 17:34:41 +02:00
Marius Gerbershagen
337606a07c tests: be more precise with signed vs. unsigned char
We give values between 0 and 255, so the character arrays have to be
unsigned but we are interpreting them as ordinary char arrays
later (which may be signed), so we have to put in an explicit cast.
2023-08-01 16:38:26 +02:00
Daniel Kochmański
5e1494361e evalmacros: fix the macroexpansion of multiple-value-bind
While it does not affect ecl code (because ECL treats it as a special form),
some code walkers may get confused. Fixes #709.
2023-07-30 14:51:01 +02:00
Marius Gerbershagen
d475192a7c load: improve error messages if file is not found or a directory 2023-07-15 20:24:55 +02:00
Marius Gerbershagen
ded1d1ee07 si:coerce-to-file-pathname: make sure that device component is not empty if necessary
Needed to so that the device component of pathnames returned by
truename is not empty on Windows.
2023-07-15 18:31:49 +02:00
Marius Gerbershagen
8a86cabc7d ecl_miscompilation_error: fix declaration
Add ECL_API and move to external.h so that things also work on MSVC.
2023-07-15 14:21:11 +02:00
Marius Gerbershagen
850ffa54d0 open: don't call close on invalid file descriptor 2023-07-15 13:50:23 +02:00
Marius Gerbershagen
a989966961 Merge branch 'fso-metaclass' into 'develop'
clos: change metaclass of funcallable-standard-object to funcallable-standard-class

See merge request embeddable-common-lisp/ecl!294
2023-07-13 17:26:10 +00:00
Marius Gerbershagen
064f1426ba clos: change metaclass of funcallable-standard-object to funcallable-standard-class
This makes more sense in general and is in accord with other
implementations.
2023-07-13 18:38:20 +02:00
Daniel Kochmański
3be5baa4a0 Merge branch 'load-system-in-asdf-with-dep-example' into 'develop'
Update asdf_with_dependence example readme

See merge request embeddable-common-lisp/ecl!293
2023-07-09 18:04:35 +00:00
Nick Faro
cd0d59e028 Update asdf_with_dependence example readme 2023-07-09 18:04:35 +00:00
Marius Gerbershagen
f400d2ae5e document the return values for all thread synchronization functions 2023-07-08 15:38:48 +02:00
Marius Gerbershagen
889f93fc08 mp:get-wait: fix return value
Should be `t` according to the documentation while we were returning
the lock itself.
2023-07-08 15:22:39 +02:00
Marius Gerbershagen
0885862e40 cmp: improve handling of potential miscompilations
Abort with a useful error message instead of trying to continue on.
2023-07-01 16:45:21 +02:00
Daniel Kochmański
29fb6009e4 cmp: disassemble: fix a regression
The function disassemble will end up in the backend too eventually, although for
now it is defined in cmpmain. Recently we've moved backend-specific variables to
the code generation pass, but disassemble still relies on that environment.
2023-06-27 09:18:02 +02:00
Marius Gerbershagen
99317ee401 cmp: fix inline expansion of (copy-readtable nil) 2023-06-25 16:08:41 +02:00
Marius Gerbershagen
48f42d8cb0 cmp: minor changes to optimizations for car/cdr
si:cons-car/cdr implement car and cdr on conses without type checks.

Replace those macros by functions and fix the previously ignored
inline definitions. This allows using si:cons-car/cdr in the
interpreter while keeping the code generated the native compiler the
same.

In the future we should probably improve the type inferencer to handle
these optimizations automatically and get rid of si:cons-car/cdr
alltogether.
2023-06-25 15:53:40 +02:00
Marius Gerbershagen
33aca4a57b cmp: don't output invalid C code if dead code elimination fails 2023-06-24 19:07:10 +02:00