Making your JITted Code known: Let me count the ways
Hacker News 热议:Making your JITted Code known: Let me count the ways(0 赞,来源 wakelift.de)
一句话概要
AOT Compilers It has been normal and expected for a long long time that any machine code they spit out would come with a bunch of metadata that is meant to be used by different pieces of the target system. There is of course symbol names for functions, which allow
原文开头节选
It has been normal and expected for a long long time that any machine code they spit out would come with a bunch of metadata that is meant to be used by different pieces of the target system.
There is of course symbol names for functions, which allow you to use the instruction pointer to find what the function it’s currently in is called, and where it starts. Plus, when a dynamic library (a DLL , dylib , or so ) is loaded, the symbol names are a part of what allows you to actually call the functions that you want.
There’s the debug data, which can include a wide variety of things. The interesting parts for this post are line number annotations that you can use to take the instruction pointer and not only get the name of the function it belongs to, but also the file name and line number (and more) .
For languages like C++ that have exceptions, there is tables with the necessary information to find out at run time when an exception is thrown, how each of the frames on the stack want to deal with it.
(以上为原文节选,完整内容见下方”原文来源”)
原文来源: Hacker News