Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: codegen
Commits on Aug 12, 2011
  1. Clean up codgen debug output

  2. Removed unused emit_ x64 instructions

    These were originally copied from LuaJIT.
  3. Use cost model for spilling regsiter in allocator

    The cost to spill is a combination of the reference number
    plus an extra bit for those values that flow to phi nodes.
    Due to the organization of the IR, constants will have a
    smaller cost than values defined outside the loop, which
    will have a smaller cost than values defined inside the
    loop. The extra phi-factor tries to ensure that values in
    phi nodes will get a register.
  4. Run asm codegen when finshed recording trace

    Previously we were running the codegen right before
    executing the trace. This was causing the extra IR
    instructions not to be emitted to the correct buffer (they
    were going to J->cur != F). We should be running the
    codegen at this point anyway.
  5. Added some debugging statements

  6. Added code to restore snapshot on trace exit

    The snapshot restoration appears to be working correct, but
    the example does not produce the correct answer
  7. Change sps_scale to just scale the spill slot

    The previous version was also subtracting SPS_FIRST so that
    we could use all the spill slots. The problem is that the
    spill area is zero indexed (i.e. spills[0] is the first
    spill), but SPS_FIRST cannot be zero because a zero means
    no spill slot is allocated. As a result we simply don't use
    the first spill slot. This makes it easy to index into
    spills[ir->s] without having to worry about re-adjusting the
  8. Fix FREF to index from base[0] instead of base[-1]

    The base pointer points to base[-1] during exection of a
    trace. The fref appears to be indexed off of base[0], so we
    need to scale it properly in the codegen.
  9. Added some debug output

  10. Added codegen for LOOP instruction

    We now correctly generate the backwards branch for a loop.
    Correct codgen for resolving phi node mismatches.
    Correct codgen for fixing phi nodes spilled outside loop
    Phi nodes that are spilled only outside a loop need to have
    IR_RENAMEs emitted for them.  We need to do this because if
    the LHS was spilled outside of the loop the snapshot
    restoration will attempt to load it from the spill slot.
    This spill slot will be out of date as the value changes in
    the loop.  We emit a rename to ensure that snapshots will
    restore the value from the register inside the loop.
  11. Added codegen for PHI instructions

    We still need to do the codegen for the LOOP instruction to
    actually generate the proper code, but we have the
    allocation for the RHS of PHI instructions working.
  12. Do not generate a position independent interp exe

    Using a position independent executable was causing the
    address for stg_IND_info to jump around because the OS X
    10.7 randomizes the starting address of the executable.
    These varations were causing needless mental overhead to
    my debugging efforts in the code generator.
  13. Updated gitignore

  14. Rearrange the code a bit

  15. Change asmEnter to pass the heap pointer

    Instead of passing the base pointer as an argument we pass
    the heap pointer. The base pointer is read directly out of
    the Thread struct. For now, the heap pointer is faked with a
    bit of malloced memory.
  16. Reorganzie the code a bit

  17. Change spill slots to start at 1

    Spill slot 0 means no spill.
  18. Formatting

Commits on Aug 4, 2011
Commits on Aug 3, 2011
  1. Set the IRT_GUARD bit for comparison opcodes

    We need the guard bit set so that we can generate the
    proper code for exiting the trace in the asm code generator.
Commits on Aug 2, 2011
  1. Added basic register allocation code

    The code can handle picking regs for a destination operation
    and generating spills/rematerializations. We tested the
    basic register allocation by generating code for the SLOAD
    IR instruction.
Commits on Aug 1, 2011
  1. Fix typo

  2. Do not save xmm regs in asmExit

    We currently do not support floating point operations, so
    there is no need to save the xmm regs.
Something went wrong with that request. Please try again.