[erlang-questions] Why can't HiPE inline functions across modules?

Mikael Pettersson <>
Wed Nov 19 10:25:45 CET 2008

Tony Arcieri writes:
 > I've read that HiPE can't inline functions across modules.  Is this merely
 > an implementation issue of HiPE, or is there some intractable problem I'm
 > missing?
 > People typically bring up code change as the reason, however I don't see why
 > HiPE couldn't walk the graph of modules for which inlining has been
 > performed during a code change and deoptimize them all back to their
 > original state, then start all inlining for these modules over from scratch
 > again.
 > Is there an intracticble problem I'm missing

For better or worse, HiPE is not structured as a typical Java JIT,
but more as a traditional ahead-of-time compiler (though it can be
invoked at runtime in a running system). One of its current limitations
is that it does not retain the native code's original Erlang/BEAM code
at runtime, and that makes runtime recompilation of native code impossible.

This can be overcome by adding that metadata and code to process it
at various runtime events, but that would require a substantial
investment of money and manpower, both of which are in short supply now.

More information about the erlang-questions mailing list