- 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
Previously object-type first called (TYPE-OF THING) and then matched it with
exact type names. This fails when we have a more precise type, i.e
(type-of 3) -> (integer 3 3)
(eq 'fixnum '(integer 3 3)) -> nil
=>
(object-type 3) -> T
and that left us with subpar optimizations down the road.
Previously we've tried first to add-static-constnat, although that led to a
situation where we've created static constant even if we had that value in the
core. Right now a static constant is the last thing to try when we attempt to
optimize the object. The order is quite arbitrary - the comment before the
function explains that we could avoid coercion with some additional work.
Both variants have distinct and mutually exclusive (based on the code) usages.
Moreover, when dealing with a function name, always use FDEFINITION location.
This is a speculation, but only basic cases were handled with FDEFINITION
because WT-FDEFINITION could only handle symbols in CL package and otherwise a
slower method was used. WT-FDEFINITION can handle now all valid function names
including (SETF FOO) and function names not contained in core packages.
T and NIL are expected to be wrapped in an intermediate structure representing
the value. This improves the separation between the host and the target language.
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.
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.
ffi:c-inline allowed for the xyntax @object (similar to the previous commit),
although only syntax "@(return x) = xxx" is specified in the documentation.
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).
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.
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.
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.
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.
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.