Commit graph

8597 commits

Author SHA1 Message Date
Daniel Kochmański
ef4ab04eda cmp: implement foreign data locations
Instead of directly opencoding them in t3-defcallback we take a more organized
approach where we work with locations. This is part of larger refactor.
2023-11-25 18:50:13 +01:00
Daniel Kochmański
ef36cf53e0 cmp: abstract away STACK emitter with a macro
We also get rid of (STACK <int>) exit in favor of an explicit frame. This was
used only by UNWIND-PROTECT for no apparent reason.
2023-11-25 18:50:13 +01:00
Daniel Kochmański
f72726a032 cmp: abstract away FRAME emitter with a macro 2023-11-25 18:50:13 +01:00
Daniel Kochmański
11aa544292 cmp: rewrite c2progn for readibility 2023-11-25 18:50:13 +01:00
Daniel Kochmański
521e815158 cmp: rewrite c2tagbody-body for readibility 2023-11-25 18:50:13 +01:00
Daniel Kochmański
938a757220 cmp: merge operators with-exit-label and with-optional-exit-label
Their core difference was that the latter coudl reuse the destination. We make
the exit argument explicit and optional in with-exit-label.
2023-11-25 18:50:13 +01:00
Daniel Kochmański
62c68c5bbc cmp: factor out emit-entry-fun from ctop-write 2023-11-25 18:50:13 +01:00
Daniel Kochmański
abd109c982 cmp: further rewrite the exit manager for clearity
This commit makes the exit type explicit and removes a need to test the result
of UNWIND-COND.
2023-11-25 18:50:13 +01:00
Daniel Kochmański
c03d856556 cmp: rewrite the exit manager for clearity
This commit rewrites UNWIND-EXIT to explicitly handle conditional jumps. We
remove misleading SET-JUMP-{TRUE,FALSE} and implement them locally.
2023-11-25 18:50:11 +01:00
Daniel Kochmański
f0634e3301 cmp: remove invalid optimization from unwind-exit
The optimization assumed, that we don't need to unwind stacks when there are no
bds nor stack frame changes. That leads to a corrupted IHS environment among
other things.
2023-11-25 18:48:59 +01:00
Daniel Kochmański
38e45ad026 cmp: exit manager has now two main ops UNWIND-EXIT and UNWIND-JUMP
unwind-exit assigns the destination and jumps to the target
unwind-jump ignores the destination and jumps to the target
2023-11-25 18:48:59 +01:00
Daniel Kochmański
4d412cc6f9 cmp: LABEL captures the current *UNWIND-PROTECT* as LABEL-DENV
Thanks to this change we may get rid of explicit TAG-UNWIND-PROTECT slot in
favor of relying on the tag label. Also rename TAG-LABEL to TAG-JUMP to
emphasize similarity to BLK-EXIT.
2023-11-25 18:48:59 +01:00
Daniel Kochmański
2f997ab990 cmp: refactor the exit manager to compute unwind-exit delta 2023-11-25 18:48:59 +01:00
Daniel Kochmański
94148e0e34 cmp: rename the location tag VALUES to VALUEZ
This tag is distinct from the Common Lisp operator so we use a distinct name to
avoid possible confusion.
2023-11-25 18:48:59 +01:00
Daniel Kochmański
55863c3f28 cmp: rename the location tag RETURN to LEAVE
This tag is distinct from the Common Lisp operator so we use a distinct name to
avoid possible confusion.
2023-11-25 18:48:59 +01:00
Daniel Kochmański
b8528d0d1c cmp: exit manager: remove the dead code for typed return locations
We never bind *EXIT* to returns other than 'RETURN.
2023-11-25 18:48:59 +01:00
Daniel Kochmański
2e941b417c cmp: small cleanup of internal errors in the exit manager 2023-11-25 18:48:59 +01:00
Daniel Kochmański
c879cb16c0 cmp: make LABEL an instance (not a cons) 2023-11-25 18:48:59 +01:00
Daniel Kochmański
77f0810d22 cmp: c2catch uses GENSYM instead of incrementing *last-label*
The assigned "code" is only part of the comment, so it is clearly not the label.
2023-11-25 18:48:59 +01:00
Daniel Kochmański
97411d9e32 cmp: unwind-exit: remove unused optional argument
We move jump-p flag to aux variables.
2023-11-25 18:48:59 +01:00
Daniel Kochmański
255e229519 cmp: factor out wt-install-function from c2fset 2023-11-25 18:48:59 +01:00
Daniel Kochmański
cebb13f979 cmp: don't allow for t2expr arguments not being c1forms. 2023-11-25 18:48:59 +01:00
Daniel Kochmański
51da30dd61 cmp: move build-debug-lexical-env to cmppass2-var 2023-11-25 18:48:59 +01:00
Daniel Kochmański
0041e7d8da cmp: use correctly with-exit-label
Previusly we've duplicated some code with regard to this macro, most notably
we've bound *exit* separately to label instead of passing it as a first arg.
2023-11-25 18:48:59 +01:00
Daniel Kochmański
7541d813ea cmp: improve code locality in cmppass2-var 2023-11-25 18:48:59 +01:00
Daniel Kochmański
cd936a36f4 cmp: update *destinations* description and remove dead code 2023-11-25 18:48:59 +01:00
Daniel Kochmański
af3d3a00c8 cmp: with-compiler-env: handle COMPILER-INTERNAL-ERROR first
We've handled COMPILER-ERROR before COMPILER-INTERNAL-ERROR, but the latter is
a subclass of the former, so it was never triggered.
2023-11-25 18:48:59 +01:00
Daniel Kochmański
3f2f935411 cmp: minor changes to emit-functions 2023-11-25 18:48:59 +01:00
Daniel Kochmański
e54b944e7a cmp: don't refer to module functions as local-funs
It is a historical baggage from before FSET. Functions stored in *local-funs*
are both local and global, so sipmly rename it to *functions*.
2023-11-25 18:48:56 +01:00
Daniel Kochmański
746f853b70 cmp: remove unused mechanism for "sharing" function bodies 2023-11-23 08:02:38 +01:00
Daniel Kochmański
b7ad56faff cmp: cleanup: remove a misleading comment for VAR-LOC
In the past VAR-LOC in the first pass could have a value 'CLB to indicate, that
it can't be allocated on the C stack. But somewhere along the way the structure
gained a separate slot REF-CLB that indicates that and VAR-LOC in the 1st pass
is /always/ OBJECT.

Update comments to reflect that fact and remove no-op assignments.
2023-11-23 08:02:38 +01:00
Daniel Kochmański
b9301789d0 cmp: add a new utility cl:emptyp for collections 2023-11-23 08:02:38 +01:00
Daniel Kochmański
e536bc56ab cmp: cxx: don't waste space when printing comments
We make the line length 80ch and print comment immedietely after "/* ".
2023-11-23 08:02:38 +01:00
Daniel Kochmański
6722d4b9da cmp: cxx: move the cxx code generator to cmppass2-top 2023-11-23 08:02:38 +01:00
Daniel Kochmański
e287445b98 cmp: exit manager: remove obsolete tags and fix typos
- remove tags number and jump (unknown purpose)
- update the comment to include RETURN-{LONG-FLOAT,C?FLOAT}
- fix typos where RETURN-CSFLOAT was repeated thrice
2023-11-23 08:02:38 +01:00
Daniel Kochmański
ec2a74b300 cmp: remove obsolete specialized c1form named CL:RPLACD
This c1form is not created nor handled in the compiler anymore.
2023-11-23 08:02:38 +01:00
Daniel Kochmański
b228ae7867 cmp: cleanup: c2mvb: don't create unused local variable 2023-11-23 08:02:38 +01:00
Daniel Kochmański
3f95f88573 cmp: rename C?VAR to C?VARIABLE 2023-11-23 08:02:38 +01:00
Daniel Kochmański
44f33cb251 cmp: cleanup of predicates loc-with-*-p
We first explicitly test for an ATOM and after that we use CASE.
2023-11-23 08:02:38 +01:00
Daniel Kochmański
fa9a985b08 cmp: cosmetic changes 2023-11-23 08:02:38 +01:00
Daniel Kochmański
be68897012 cmp: defpackage uses strings instead of uninterned symbols 2023-11-23 08:02:38 +01:00
Daniel Kochmański
5bf5ec4f80 bytecmp: fix outdated comments 2023-11-23 08:02:38 +01:00
Daniel Kochmański
5aa1a52db2 bytecmp: remove unused defines 2023-11-23 08:02:38 +01:00
Daniel Kochmański
ceddb1559b core: add a macro ecl_frs_pop_n 2023-11-23 08:02:38 +01:00
Daniel Kochmański
17f1c5b356 Merge branch 'stream-line-length' into 'develop'
Add gray:stream-line-length

See merge request embeddable-common-lisp/ecl!309
2023-11-22 21:03:29 +00:00
Daniel Kochmański
01322dc986 Update gray-streams.txi (fix typo) 2023-11-22 20:05:27 +00:00
Daniel Kochmański
f62622802c core: argument checking in si:get-limit and si:set-limit
Previously we've falled through all cases and if none matched, we've used the
heap. That said our documentation clearly states, that the type for the heap is
EXT:HEAP-SIZE.
2023-11-22 13:45:23 +01:00
Tarn W. Burton
e0aa99c610
Update docs for gray-streams changes 2023-11-20 15:21:35 -05:00
Tarn W. Burton
0abaa78feb
Add gray:stream-line-length 2023-11-20 15:21:35 -05:00
Marius Gerbershagen
ac89091af1 Merge branch 'cmpc-separation' into 'develop'
Compiler pass separation

See merge request embeddable-common-lisp/ecl!292
2023-11-20 19:28:58 +00:00