LIR compiler

From MozillaWiki
Jump to: navigation, search

A project to write a Nanojit-based tool that reads a file containing Nanojit LIR instructions and spits out the binary code to a file so it can be disassembled or executed.

Contacts: paritosh1010 and Jason Orendorff (jorendorff at mozilla dot com)

Goal 0

Write, compile and link a small C++ program with the Nanojit library.

Goal 1

Get a program to successfully feed this input to a nanojit::LirWriter.

   start
   two = int 2
   twoPlusTwo = add two, two
   ret twoPlusTwo

It's probably not too early to start using e.g. flex and Lemon (tools for creating parsers).

Open issues

  • Need stub code (or docs) for pieces of Nanojit that are provided by the application, like MMgc and VerboseWriter::formatGuard.
  • jorendorff doesn't understand guards well enough. Need to figure out what side exits should actually do.
  • If this tool is to be used cross-platform for testing, it would really help to be able to say x = ld p[6 * sizeof intptr_t]
  • Many opcodes are not well understood, e.g. ji and xi.