Add a compiler option to disable inlining
Mudloop opened this issue · 3 comments
Feature suggestion
For debug builds, it would be useful to not have inlining, in order to get more accurate traces.
Currently I have to go and remove the decorators manually when I get an error, to figure out where it occurred.
Shouldn't source maps give you the correct stack trace?
Shouldn't source maps give you the correct stack trace?
Maybe, I'm not sure, I don't always run things in the browser though, I run things from node, and with wasmer.
And when I do run in the browser, I tend to not use the generated glue, I interop directly (for various reasons, let's just say the generated module doesn't fit my particular purpose, even though I learned a lot by glancing it). I don't really know how to incorporate the source maps with my setup, but I'll have a look at that.
Another reason for being able to quickly disable inlining is this : I'm heavily optimizing stuff, for which I need to make release builds. I have a ton of inlined stuff (everything is inlined basically, because size is of no concern), which it kinda slow to build the release version. Disabling inlining would still give me a reference to see if some change is a good optimisation.
For now I guess I can just build through the javascript API and remove all inline calls, should do the trick.
Actually, thinking about this more, automatically disabling inlining could potentially break code, specifically when using memory.data and returning this. Because when not inlined, this will become the same data.
So probably a bad idea to implement this suggestion, unless an “@alwaysinline” type operator is added too, which would probably be confusing. Or if the automatic disabling detects that it would change behavior, but that is most likely more trouble than it’s worth.