IonMonkey/Code Generation

From MozillaWiki
< IonMonkey
Revision as of 10:15, 21 October 2016 by H4writer (talk | contribs) (Created page with "Code generation takes the annotated LIR graph and creates machine code out of it. Afterwards the code gets linked. =Overview= ==Generating machine code== An annotated LIR co...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Code generation takes the annotated LIR graph and creates machine code out of it. Afterwards the code gets linked.

Overview

Generating machine code

An annotated LIR contains all information to create machine code out of it. For each LIR we call the shared or architecture specific "visitXXX" function. In those functions we create a vector containing the machine code. This happens using an abstraction layer, the MacroAssembler. The MacroAssembler contains helper functions that are named based upon corresponding assembler functions.

Linking

The linking step is the final step in generating the jit code. Here we are again on the main thread. We check if type information has changed in between and save the constraints upon which this jit code is valid. Pointers get hardcoded into the buffer and that buffer is made executable. This results in an IonScript we can now execute.