Commit graph

14 commits

Author SHA1 Message Date
Douglas Katzman c2df85fe12 Delete useless test
This test was trying to assert that no slow TYPEP call existed. Since positive
assertions are generally better than negative ones, it instead asserted that
exactly one LAYOUT existed, which would be expected for %INSTANCE-TYPEP.
And it used to be meaningful because:
* MUTEX stored its owner as a THREAD instance, not a raw word, therefore
* MUTEX and THREAD were mutually referential types.
The compiler could not efficiently deal with a forward-referenced types in
whichever defstruct appeared first in the defining file.  So either it couldn't
optimize TYPEP in (SETF OWNER) or (SETF THREAD-INTERRUPTIONS-LOCK) depending
on which defstruct appeared first.  That defect was eventually rectified.

However, now the test is just bad, as neither of the above points hold.
2026-04-29 22:27:04 -04:00
Douglas Katzman 4c8f524b50 Return names, not functions, from ctu:find-named-callees 2024-05-11 20:31:15 -04:00
Charles Zhang dd0f579028 Delete metaspace.
The feature was checked-in without being completed and it's already
bitrotted. Wrapper is folded back into layout name-wise for the most
part now because that's how it's been effectively functioning. There
are still probably more cleanups to be done, related to this, but this
takes care of most of the dead code and unnecessary layers of
alternate names/indirection.
2023-05-21 17:35:43 +02:00
Douglas Katzman 683d614b4b Prefer find-named-callees over find-code-constants
And I did not observe the fixme to be true either.
2022-10-03 15:36:03 -04:00
Douglas Katzman 55dff01bcc Fix a package qualifier- FIND-FDEFN is external in SB-INT 2021-12-05 00:53:09 -05:00
Douglas Katzman fc695edb7a Metaspace part 1: layouts split into pieces if #+metaspace
The rationale and mechanics of this change have been adequately hashed
out on sbcl-devel, so nothing further to add here other than that a few
renamings of local variables from LAYOUT to WRAPPER may be worthwhile
depending on how other maintainers feel about the current state.

There are no user-observable differences in the normal configuration.
2021-04-11 21:30:41 -04:00
Douglas Katzman 202436ef82 Fix failing tests 2020-12-09 13:49:47 -05:00
Douglas Katzman 45aa86c6ab Mark test as known fail 2020-11-23 09:39:34 -05:00
Douglas Katzman fdd4ccf01b Reimplement TYPEP on structure-object descendants
Compare layouts by a stable ID instead of the address.

As can be seen from the "perf stat" results accompanying the design notes
in the doc directory, the time for self-build on x86-64 decreases somewhere
between 3% to 8% depending on the build phase.
Since this change is not specific to the compiler, but just type-checking
in general, the results suggest that users may similarly see anything in
that range of speedup for code making heavy use of defstructs.
Code compiled in 0 safety will see less speedup, because there are no type
assertions, while there may be type-based dispatch that is improved.

Additionally, core files tend to be slightly smaller due to having
fewer code header constants that reference layouts, and correspondingly
there are fewer boxed words to examine in GC.
2020-11-16 09:10:40 -05:00
Douglas Katzman b934f44cfe Implement structure EQUALP as type-specific machine code
Same idea as already existed, but instead of treating EQUALP-TESTS
as a domain-specific language driving the comparator loop,
actually compile it, unless policy of the destruct has SPACE = 3.

Pristine core size increase by about .7% which I think is worth it.
At any rate, I want people to get this by default, not opt in.
2020-05-31 22:32:17 -04:00
Charles Zhang d24767e3b6 Remove defstruct tlf queuing.
Also explicitly block compile the two files it was used for.

Block compilation accomplishes the same thing and handles more cases,
as top level ir1 converted lambdas can be delayed arbitrarily in a
file, unlike forms. All the type tests that should be open-coded,
are, (the build would warn otherwise), but the cross-typep ambiguity
stuff needs to be disabled during cross compile, since there is no way
to know a priori whether a forward referenced type will get resolved
later.
2020-04-19 19:50:48 -07:00
Douglas Katzman 22ad16feca Remove 'early-thread' and teach genesis a new trick
* Enable genesis to create any target plain-old-defstruct (which was
  neither SB-XC:DEFSTRUCT nor DEF!STRUCT) whose %DEFSTRUCT was not yet
  observed in a cold fasl but which is known by having compiled it.

* Put all thread structure definitions into 'thread.lisp'

* Replace DEF!STRUCT MUTEX with regular DEFSTRUCT

* Replace DEF!STRUCT AVLNODE with SB-XC:DEFSTRUCT
  (because we need the SBCL-style metadata in first genesis)

* Remove read-time-eval of make-mutex, because the host lisp
  should never create "our" MUTEX instances as host objects.

Essentially the problem this change had to solve was loss of almost all
compile-time effects of cross-compiling because genesis runs in its own
freshly started lisp. If :sb-after-xc-core is set, we have to die when
saving a core from the host, at least in SBCL.
(Maybe a simpler fix was to execute second genesis *before* dying?)
2020-01-14 12:05:25 -05:00
Douglas Katzman 2830baa5ce Undo a minor kludge
The compiler can usually process mutually referential defstructs
efficiently now (as of revision 5aec1ee8fa).
2020-01-07 22:26:32 -05:00
Douglas Katzman 1246d5212f Fix parallel-exec and improve purity of pure tests
Change PURE-RUNNER to randomize the package if and only if the filename
does not contain "impure". This makes it feasible again to use on all files
regardless of the pure/impure dichotomy.

In pure tests, disallow certain defining macros which instate persistent
environment changes which can't be undone by DELETE-PACKAGE.

Rename the backq tests to '.pure' since they are side-effect free.
2019-03-22 21:01:52 -04:00
Renamed from tests/defstruct.pure-cload.lisp (Browse further)