[racket-dev] how to disable intra-module constant inlining?

From: Danny Yoo (dyoo at cs.wpi.edu)
Date: Wed Jan 18 18:21:04 EST 2012

> So Whalesong is actually breaking on a few of my test case examples
> because 5.2.1 does some aggressive inlining.  Specifically, it's doing
> intra-module constant optimizations.  Whalesong depends on the late
> binding of module bindings in some special places (specifically, the
> FFI), so I need a way of turning that constant inlining off.  I tried
> using (compile-enforce-module-constants #f), but that didn't seem to
> do the trick.


Followup: ok, whew.  I can workaround it for the specific case where
things are breaking by artificially injecting set!s in the affected
modules.  (https://github.com/dyoo/whalesong/commit/6b8bcdaf767efe2294a7dd8d9a5580c5a64c20ff)


I'd still love to know how to disable the intra-module constant
inlining, that is, if there's a parameter that controls inlining
similar to compile-context-preservation-enabled.  Sam suggested that
whatever 'raco make --disable-inline' does might do the trick, but
that option appears to only affect function calls inlining; what I'm
running into is constant inlining.


Posted on the dev mailing list.