Commit graph

8146 commits

Author SHA1 Message Date
Daniel Kochmański
e4fca7e8e7 cmp: separate fun/var ir functions from passes
Also provide better load grouping.
2021-07-01 14:11:33 +02:00
Daniel Kochmański
c8c59167d0 cmp: major cleanup, separate passes
- separate passes

  The separation is not fine-grained but is a good starting point for further
  cleanup. This is a preliminary requirement for multiple backends.

- use uninternet symbol in the package definition

- remove "execute" permission from all files

- remove a few unused functions

- rearrange loaded files

- less verbose compiler

  Don't print "End of pass 1." message. This doesn't provide any valuable
  information to the programmer.
2021-07-01 14:11:33 +02:00
Daniel Kochmański
0aa627e3e7 Merge branch 'finalizer-cycles' into 'develop'
gc: call finalizer for builtin object only when the object is truly unreachable

See merge request embeddable-common-lisp/ecl!252
2021-06-12 20:38:41 +00:00
Marius Gerbershagen
0638932696 run-program: remove redundant finalizer for windows handles
We have already registered a finalizer for the external process object
which calls external-process-wait. This in turn calls si::waitpid
which closes the handle once the process has exited.
2021-06-12 21:26:47 +02:00
Marius Gerbershagen
ddb7bb72e9 gc: call finalizer for builtin object only when the object is truly unreachable
Otherwise it can happen that a user-defined finalizer for some object
A storing a builtin object B registers another finalizer for A making
B reachable again while B has already been finalized.

We can't impose an ordering for user-defined finalizers in general
since these may include cyclic references. Therefore it is the duty of
the user to write the finalizers in a consistent way which is
independent of the order in which the finalizers are called. This
doesn't work for builtin objects since the user can't influence
the finalizers in this case.

We also fix a bug which lead to the removal of the standard finalizer
if a user-defined finalizer was registered and then removed.

Co-authored-by: Daniel Kochmański <daniel@turtleware.eu>
2021-06-12 21:26:47 +02:00
Daniel Kochmański
76f700a86d Merge branch 'develop' into 'develop'
modern macOS does not need libm.dylib, nor has it

See merge request embeddable-common-lisp/ecl!254
2021-06-10 14:06:56 +00:00
Dima Pasechnik
a58106e207 more details added, and examples adjusted 2021-06-10 14:33:08 +01:00
Dima Pasechnik
5e99481bd3 modern macOS does not need libm.dylib, nor has it 2021-06-10 13:41:56 +01:00
Marius Gerbershagen
e5d8336379 Merge branch 'fix-direct-superclasses' into 'develop'
direct-superclasses: the default value of the slot is nil per AMOP

See merge request embeddable-common-lisp/ecl!239
2021-05-15 17:21:02 +00:00
Daniel Kochmański
e881e5fa86 tests: add missing validate-superclass methods to a few MOP tests 2021-05-10 13:36:01 +02:00
Daniel Kochmański
0e5174c040 direct-superclasses: the default value of the slot is nil per AMOP
http://metamodular.com/CLOS-MOP/class-direct-superclasses.html
2021-05-10 13:23:56 +02:00
Daniel Kochmański
086ec59ab8 check-direct-superclasses: handle forward-referenced-class
The forward-referenced-class metaclass has no superclasses.

Moreover:

- check superclasses after they are added (removes one fixme)
- don't map validate-superclass during clos booting
2021-05-10 13:23:56 +02:00
Daniel Kochmański
178e0362e3 Merge branch 'update-ucd' into 'develop'
Update the unicode character database

See merge request embeddable-common-lisp/ecl!250
2021-05-10 10:35:50 +00:00
Marius Gerbershagen
5a4c337bd5 char_ctype.d: use new ucd.h header features instead of hardcoded constants 2021-05-07 21:09:09 +02:00
Marius Gerbershagen
ecd86a2541 unicode: update unicode character database to version 13.0.0 2021-05-07 21:09:09 +02:00
Marius Gerbershagen
8350f07100 contrib/unicode: improve ucd table generating code
Provide some comments on what the code is doing.

Increase size of integers used in encoding pairs of consecutive words
(needed to encode the current ucd).

Introduce additional bidirectional classes.

Provide new ucd.h header with enums for general-category and
bidirectional class.

Add update-ucd.sh script to automate the updating process.
2021-05-07 21:09:08 +02:00
Marius Gerbershagen
8891731406 Merge branch 'develop' into 'develop'
msvc: use :X86-64 feature keyword when make a 64bit build

See merge request embeddable-common-lisp/ecl!248
2021-04-09 15:08:55 +00:00
Marius Gerbershagen
da558a9480 doc: css: use white background for images in dark mode 2021-04-09 16:49:58 +02:00
Marius Gerbershagen
cdeea489cb cmp: fix typo to make constant folding work again 2021-04-01 16:19:14 +02:00
Marius Gerbershagen
9e204464ea clos: replace macros by functions in with-early-accessors
Accessors are fuctions not macros. While using macros is fine in most
cases, we can't use them for example in higher-order functions. The
only reason this worked in the first place is due to our compiler
allowing expressions such as

`(macrolet ((x (...) ...)) (funcall #'x ...))

even though this is invalid.
2021-03-31 21:09:18 +02:00
Marius Gerbershagen
62d1bb1203 cmp: fix evaluation order of sequence compiler macros
Minor improvements to define-compiler-macro* (bail out if we detect
:allow-other-keys arguments, define a named block such that
return-from works as expected).

Major refactor of sequence compiler-macros: use define-compiler-macro*
which handles correct evaluation order, define new macro to handle
common stuff for all sequences compiler-macros (e.g. inline policy
checking, check that test and test-not are not both given). The main
expansion logic in the compiler macros is unchanged although the code
had to be slightly rewritten to accomodate the new macros.

Remove the now superfluous seq-opt-parse-args function.
2021-03-31 21:09:18 +02:00
Marius Gerbershagen
dd5c372ff8 cmp: fix let bindings with initforms which are lists with QUOTE symbol as first element
Example:

(let ((x '(quote ...))) ...)

We really have to quote the value in all cases, si::maybe-quote would
strip away one level of quotation leaving only the equivalent
of (let ((x (quote ...))) ...) which of course is incorrect.
2021-03-31 19:57:01 +02:00
Marius Gerbershagen
23dde9625d cmp: fix compiler macro for make-array
The previous version had several problems: argument evaluation order
was not handled correctly and the compiler-macro produced an error for
valid code like

(let ((etype :element-type))
  (make-array 10 etype 'character))

Introduce a new generally applicable macro define-compiler-macro*
which fixes these issues.
2021-03-29 22:07:06 +02:00
Marius Gerbershagen
d54c110361 cmp: fix bad warnings for type declarations inside locally
Also search lexical environment for variables instead of only the
list of variables being established by the current form (which is nil
anyway in the case of locally; only let or multiple-value-bind
statements create new variables).

The declaration is still ignored, but fixing that would require a much
larger refactor because currently variable types are associated to the
variable itself. Thus the type can only be set for the full scope in
which the variable is active and not locally in some subscope.
2021-03-25 22:06:00 +01:00
Marius Gerbershagen
977e2fab34 cmp: fix inlining of functions with &key and &aux arguments
&aux arguments come after &key ones.

Fixes #633.
2021-03-25 22:06:00 +01:00
Yuguo Zhang
1cd226f867 msvc: use :X86-64 feature keyword when make a 64bit build 2021-03-24 09:39:03 +08:00
Marius Gerbershagen
83ed2e1722 cmp: checked-value: don't omit type checks if we detect a type-error at compile time
We now warn at compile time and create a type assertion which errors
at runtime.
2021-03-21 17:33:06 +01:00
Marius Gerbershagen
1f57d7e20a cmp: add type checks to boole compiler macro 2021-03-21 17:33:06 +01:00
Marius Gerbershagen
9391a2bf67 cmp: fix inline expressions for elt
We can't use aref since aref ignores fill-pointers and ecl_fixnum can
be used only in unsafe code.
2021-03-21 17:33:06 +01:00
Marius Gerbershagen
eedbbc08c2 cmp: add type checks in mapl/maplist/mapcon compiler-macros
We are transforming these functions into (loop :on ...). This simply
stops when the objects which we are looping on is not a list, but we
need to signal a type-error because the mapping functions are
specified to take only lists.
2021-03-21 17:33:06 +01:00
Marius Gerbershagen
e0813bf42e cmp: fix typos 2021-03-21 17:33:06 +01:00
Marius Gerbershagen
59cc1f2df8 cmp: fix compiler macro for nth and nthcdr
We were doing no error checking that we got the right number of
arguments. Also remove the manual creation of forms with a backquote
for better readability.
2021-03-20 20:48:50 +01:00
Marius Gerbershagen
78ec5a2d92 cmp: fix type declarations for package functions
All of these functions take either a list of symbols or a single
symbol (except for shadow which uses string designators or lists
thereof).
2021-03-20 20:26:57 +01:00
Marius Gerbershagen
56a914b261 cmp: give more precise types for constant values
Improves error messages.
2021-03-20 20:01:40 +01:00
Marius Gerbershagen
b1ea49e1a0 cmp: fix evaluation order of multiple-value-setq with symbol-macrolet
If a variable which is set with multiple-value-setq is bound to a
symbol-macro, we need to handle the order of side-effects as in setf.

Previously, we were first evaluating the value generating form
of the multiple-value-setq before setting the places from the
symbol-macro. The correct order is to first evaluate the forms from
the symbol macro giving the places to set, then evaluate the value
generating form from the multiple-value-setq and then set the places
to the generated values.
2021-03-18 21:57:14 +01:00
Marius Gerbershagen
80c53f0e2b cmp: fix (values (values))
This must return nil as a single value while we were returning no
values.
2021-03-18 20:20:35 +01:00
Marius Gerbershagen
36a9c95c80 tree-wide: use new dpp @"" specifier for constant base strings where appropriate 2021-03-12 19:53:33 +01:00
Marius Gerbershagen
aad1edbfa0 Merge branch 'file-stream-improvements' into 'develop'
File stream improvements

Closes #511

See merge request embeddable-common-lisp/ecl!245
2021-03-12 18:44:08 +00:00
Marius Gerbershagen
e466823ac6 cmp: be more strict with symbol-macrolet
The ansi standard specifies that declaring symbols bound with
symbol-macrolet to be special or binding symbols that are defined as
global variables must signal a program-error. Previously, we simply
ignored this issues.

Also fix an issue with cmp-env-search-variables which would wrongly
return variables when searching for symbol macros. This allows us to
remove another check in symbol-macro-declaration-p.
2021-03-11 20:51:17 +01:00
Daniel Kochmański
8428d6a35a Merge branch 'develop' into 'develop'
Fix makefile ordering.

See merge request embeddable-common-lisp/ecl!247
2021-03-10 19:19:21 +00:00
Daniel Kochmański
829208da15 Merge branch 'develop' into 'develop'
msvc: fix Makefile for check target

See merge request embeddable-common-lisp/ecl!246
2021-03-10 19:18:41 +00:00
Yuri D. Lensky
f88a000baf Fix makefile ordering.
Ensure correct rule precedence for header files.
2021-03-09 22:00:26 -08:00
Marius Gerbershagen
a7e1bf6c9f cl_parse_key: correctly handle literal allow-other-keys keyword arguments
When parsing keyword arguments of functions like

(defun f (&key allow-other-keys) allow-other-keys)

(note that `&key allow-other-keys` is not `&allow-other-keys`!), we
were incorrectly handling the case in which this function was called
like

(f :some-unknown-keyword x :allow-other-keys non-nil-value)

In this case, the spec (CLHS 3.4.1.4) says that the function has to
ignore the unknown keyword and return the non-nil-value, while we were
signaling an "unknown keyword" error.
2021-03-07 19:21:35 +01:00
Marius Gerbershagen
3ec1ed2ce0 interpreter: simplify handling of :allow-other-keys parsing a bit
Get rid of the unnecessary mask (which wouldn't have worked correctly
anyway if somebody passed more than 32 :allow-other-keys arguments).
2021-03-07 19:20:04 +01:00
Yuguo Zhang
7bee8a4172 msvc: fix Makefile for check target 2021-03-05 16:36:38 +08:00
Marius Gerbershagen
69e9e1d46c cmp: fix inlining of functions with mutually dependent keyword arguments
If we inline a function which contains keyword arguments whose default
value depends on the presence of other keyword arguments as for
example in

(funcall (lambda (&key (a nil a-p) (b a-p)) ...))

where `b` depends on the presence of `a`, we need to set the
key-flag `a-p` immediately after scanning for the keyword and not at
the end after we have finished scanning all keywords as we did previously.
2021-03-04 20:19:36 +01:00
Marius Gerbershagen
e5f6606ba7 cmp: fix type propagation for atan function 2021-03-04 19:54:20 +01:00
Marius Gerbershagen
788b9b4cd0 clos: FUNCTION-KEYWORDS must be a generic function 2021-03-03 22:14:28 +01:00
Marius Gerbershagen
6f3f52d4f0 destructuring-bind: signal program-error instead of an ordinary error
Make the ansi-test suite happy.
2021-03-03 22:14:28 +01:00
Marius Gerbershagen
e74f2935f4 doc: fix typo 2021-02-27 19:21:57 +01:00