Commit graph

8526 commits

Author SHA1 Message Date
Daniel Kochmański
ba3afa81f3 cmp: constants: get rid of an edge case where we return a list 2023-11-17 11:21:21 +01:00
Daniel Kochmański
5427ba657b cmp: don't resolve floats and complex floats in the first pass
We remove *-VALUE location in favor of VV instances.
2023-11-17 11:21:21 +01:00
Daniel Kochmański
d2cda52d26 cmp: don't resolve characters in the first pass
We remove CHARACTER-VALUE location in favor of VV instances that does not have a
location.
2023-11-17 11:21:21 +01:00
Daniel Kochmański
3282f17b11 cmp: don't resolve fixnums in the first pass
We remove FIXNUM-VALUE location in favor of VV instances that does not have a
location.
2023-11-17 11:21:21 +01:00
Daniel Kochmański
0ee8c94894 cmp: handle-compiler-error: respect *compiler-break-enable* flag 2023-11-17 11:21:21 +01:00
Daniel Kochmański
2414e829cc tests: cmp: add regression tests for this branch 2023-11-17 11:21:21 +01:00
Daniel Kochmański
ad4002e578 Merge branch 'fix-typo' into 'develop'
Fix generic definition of stream-file-length

See merge request embeddable-common-lisp/ecl!308
2023-11-16 17:28:43 +00:00
Tarn W. Burton
dda901a394
Fix generic definition of stream-file-length 2023-11-16 12:26:40 -05:00
Daniel Kochmański
9c7c62ed7f Merge branch 'gray-file-length' into 'develop'
Add gray:stream-file-length

See merge request embeddable-common-lisp/ecl!307
2023-11-16 16:00:33 +00:00
Daniel Kochmański
2fb0e7d42c Merge branch 'gray-streams-module' into 'develop'
Add gray-streams module to avoid use of redefine-cl-functions

See merge request embeddable-common-lisp/ecl!306
2023-11-16 13:34:25 +00:00
Tarn W. Burton
edd88aac45
Add gray-streams module to avoid use of redefine-cl-functions 2023-11-15 12:30:08 -05:00
Tarn W. Burton
b9a7d06635
Add gray:stream-file-length 2023-11-12 16:14:34 -05:00
Daniel Kochmański
2eb24b09d7 Merge branch 'various-compiler-improvements' into develop 2023-10-30 12:02:50 +01:00
Marius Gerbershagen
3f03a0c686 cmp: fix caching of type specifiers
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.
2023-10-30 12:01:21 +01:00
Marius Gerbershagen
b65b7d3825 cmp: expand compiler macros for callsites in the same source file as the compiler macro definition 2023-10-30 12:01:21 +01:00
Marius Gerbershagen
1bbae5a0bc cmp: fix incorrect type proclamations 2023-10-30 12:01:20 +01:00
Marius Gerbershagen
58c5782fe7 cmp: also perform type propagation in disassemble 2023-10-30 12:01:20 +01:00
Marius Gerbershagen
8ef84d3a9b cmp: improve error message for wrong number of arguments
Mention the function name if available. Also refactor the code a bit.
2023-10-30 12:01:18 +01:00
Marius Gerbershagen
d437bd0779 speed up looking up and setting values of dynamic variables
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.
2023-10-30 12:01:18 +01:00
Marius Gerbershagen
52e62805dd remove ECL_SAFE option
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.
2023-10-30 12:01:18 +01:00
Daniel Kochmański
27b7c9f8d8 Merge branch 'develop' into 'develop'
Don't enable GC fork() support on Windows

See merge request embeddable-common-lisp/ecl!305
2023-10-23 05:27:34 +00:00
Mark Shroyer
fcaab573cc Don't enable GC fork() support on Windows
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.
2023-10-22 20:22:09 -07:00
Marius Gerbershagen
f3362ddec7 Merge branch 'cmpc-cleanup' into 'develop'
cmp: various cleanups and fixes

See merge request embeddable-common-lisp/ecl!302
2023-09-30 14:41:20 +00:00
Daniel Kochmański
e49eafac22 cmpc: get rid of another undocumented feature from FFI:C-INLINE
ffi:c-inline allowed for the xyntax @object (similar to the previous commit),
although only syntax "@(return x) = xxx" is specified in the documentation.
2023-09-25 14:35:14 +02:00
Daniel Kochmański
f195f7d574 cmpc: get rid of an undocumented and unused code path for FFI:CLINES
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).
2023-09-25 14:35:14 +02:00
Daniel Kochmański
5a8f6780b8 cmpc: sysfun: add default inline definitions for printer functions
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.
2023-09-25 14:35:14 +02:00
Daniel Kochmański
6d60cf294a cmpc: move the c-inliner fully to the cmpc backend module 2023-09-25 14:35:14 +02:00
Daniel Kochmański
49668f8dda cmpc: %def-inline: remove an option :inline-or-warn 2023-09-25 14:35:14 +02:00
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