Skip to main content

Questions tagged [code-generation]

For questions related to the generation of code, especially lower level or intermediary code.

5 votes
1 answer
349 views

How does link-time function inlining work?

I am familiar with traditional linking concepts (static and dynamic linking, relocation, PIE) and with traditional compiler optimizations (such as static expression evaluation, loop unrolling and ...
Borisav Živanović's user avatar
3 votes
1 answer
355 views

X86-64 Assembly for Recursive Functions

A compiler I'm writing generates the following x86-64 assembly (AT&T syntax) for a recursive factorial function. I convert the assembly into an ELF executable using ...
Veera Sivarajan's user avatar
5 votes
1 answer
151 views

Modifying call stack locations for C++ exceptions

Having done my type checker, I'm thinking on targetting C++. How can I efficiently add debugging information to thrown exceptions? Similiar to JavaScript, you can throw anything. ...
Hydroper's user avatar
  • 1,017
7 votes
4 answers
297 views

How can we backpatch differently-sized jump instructions?

Consider a compiler whose target language is some virtual machine bytecode. The jump instructions have to encode the size of their jumps. For example, in JVM bytecode the ...
hugomg's user avatar
  • 1,345