Skip to content

dfmc-optimization: Warn when inline-only inlining fails #838

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 14 commits into
base: master
Choose a base branch
from

Conversation

housel
Copy link
Member

@housel housel commented Nov 30, 2014

This is provided in case somebody wants to play with it, but it should probably not be merged until we have solutions for the many additional warnings this adds to the build.

@waywardmonkeys
Copy link
Member

If the implementation of inline-only were better, it would inline in more cases than it does now and probably reduce the number of warnings. :)

@housel housel marked this pull request as draft September 29, 2020 19:20
@housel housel force-pushed the warn-inline-only branch from aa0b8b1 to 279db5e Compare July 3, 2025 23:30
housel added 13 commits July 8, 2025 21:31
* sources/dfmc/optimization/check.dylan
  (check-optimized-reference on <&function>,
   check-optimized-reference on <&cache-header-engine-node>): Emit a
   warning when an IEP has to be constructed for a function declared
   as inline-only.
* sources/dfmc/optimization/check.dylan
  (<calling-raw-value-function-out-of-line>): New program-error
   condition class.
  (check-optimized-reference on <&function>,
   check-optimized-reference on <&cache-header-engine-node>):
   Signal a program-error when a reference is found to a function with
   a signature containing raw types.
  (raw-value-function?): New utility function to check a function's
   signature for raw types.
* sources/dylan/float.dylan
  (decode-single-float, encode-single-float,
   decode-double-float, encode-double-float): Change these functions
   from inline-only to inline, because there is no reason not to have a
   graceful fallback when inlining fails.
These changes fix warnings due to inlining failures of inline-only
support functions.

* sources/dfmc/modeling/primitive-macros.dylan
  (&primitive-override-definer): Ensure that arguments declared
   <raw-machine-word> are mapped to <&raw-machine-word> in the override
   function so that the inserted extract-mw-operand-* calls can be inlined.

* sources/dfmc/modeling/machine-word-primitives-support.dylan
  (make-raw-literal-with-overflow): Change from inline-only to inline
   because an adequate type bound is not always available for
   generic-arithmetic calls.
* sources/corba/orb/protocols/corba/typecode.dylan
  (CORBA/TCKind/as-symbol, CORBA/TCKind/as-integer): Remove
   the inline-only requirement as unnecessary.
* sources/network/unix-sockets/sockets-interfaces.dylan
  (accept, bind, close, connect, getpeername, getsockname, listen,
   setsockopt, shutdown, socket): Remove inline-only restriction.

* sources/network/unix-sockets/sockets-extras.dylan
  (unix-recv-buffer, unix-send-buffer, unix-recv-buffer-from,
   unix-send-buffer-to): Remove inline-only restriction.

* sources/network/unix-sockets/linux-address-data.dylan
  (ntohl, ntohs, htonl, htons): Remove inline-only restriction.

* sources/network/unix-sockets/bsd-address-data.dylan
  (ntohl, ntohs, htonl, htons): Remove inline-only restriction.
These changes fix inlining failure warnings for inline-only functions.

* sources/io/streams/typed-stream.dylan
  (typed-tsm, typed-fsm): Move to new top level definitions and add
   parameter type declarations.
  (<typed-stream>): Move out initializers for to-sequence-mapper
   and from-sequence-mapper.
* sources/corba/scepter/console/parse-arguments.dylan
  (canonicalize-arguments): Add a type declaration to ensure inlining.
* documentation/source/release-notes/2025.2.rst: Add note about new
  checks in the compiler.
* documentation/source/library-reference/language-extensions/inlining.rst:
  Add explanation for the compiler's warning when it fails to follow
  the inline-only adjective.
* sources/system/settings/win32-settings.dylan
  (*settings-default-class*): Declare as <byte-string>.
  (initialize-settings): Add type declarations so that the
   RegCreateKeyEx call can be inlined.
* sources/network/winsock2/first.dylan
  (import-wchar, export-wchar): Change from inline-only to inline
   to resolve inlining failure warnings.

* sources/network/winsock2/winsock2.dylan
  (%-WSAFDIsSet, tv-sec-value, tv-usec-value,
   sin-family-value, sin-port-value, sin-addr-value, accept,
   bind, closesocket, connect, htonl, htons, listen, ntohl, ntohs,
   setsockopt, socket): Change from inline-only to inline to resolve
   inlining failure warnings.

* sources/network/winsock2/hand.dylan
  (win32-recv-buffer-from, win32-send-buffer-to): Change from
   inline-only to inline to resolve inlining failure warnings.
* sources/duim/win32/wgadgets.dylan
  (<win32-collection-gadget-mixin>): Inherit from <collection-gadget>
   so that gadget-selection-mode, gadget-items, gadget-items-setter,
   gadget-selection, and gadget-selection-setter can be sealed.
@housel housel force-pushed the warn-inline-only branch from 5905727 to 3828cf1 Compare July 9, 2025 04:34
* sources/ole/ole-automation/dispatch.dylan (apply-to-dispparams): Add
  type declarations so that an implicit call to integer-as-raw can be
  properly inlined.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants