Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Friends

nanojit::Assembler Class Reference

Information about the activation record for the method is built up as we generate machine code. More...

#include <Assembler.h>

Collaboration diagram for nanojit::Assembler:

List of all members.

Public Member Functions

 Assembler (CodeAlloc &codeAlloc, Allocator &dataAlloc, Allocator &alloc, AvmCore *core, LogControl *logc, const Config &config)
void compile (Fragment *frag, Allocator &alloc, bool optimize verbose_only(, LInsPrinter *))
void endAssembly (Fragment *frag)
void assemble (Fragment *frag, LirFilter *reader)
void beginAssembly (Fragment *frag)
void setNoiseGenerator (Noise *noise)
void releaseRegisters ()
void patch (GuardRecord *lr)
void patch (SideExit *exit)
AssmError error ()
void setError (AssmError e)
void cleanupAfterError ()
void clearNInsPtrs ()
void reset ()
 debug_only (void pageValidate();) debug_only(void resourceConsistencyCheck()
NInsgenEpilogue ()
uint32_t arReserve (LIns *ins)
void arFree (LIns *ins)
void arReset ()
Register registerAlloc (LIns *ins, RegisterMask allow, RegisterMask prefer)
Register registerAllocTmp (RegisterMask allow)
void registerResetAll ()
void evictAllActiveRegs ()
void evictSomeActiveRegs (RegisterMask regs)
void evictScratchRegsExcept (RegisterMask ignore)
void intersectRegisterState (RegAlloc &saved)
void unionRegisterState (RegAlloc &saved)
void assignSaved (RegAlloc &saved, RegisterMask skip)
LInsfindVictim (RegisterMask allow)
Register getBaseReg (LIns *ins, int &d, RegisterMask allow)
void getBaseReg2 (RegisterMask allowValue, LIns *value, Register &rv, RegisterMask allowBase, LIns *base, Register &rb, int &d)
int findMemFor (LIns *ins)
Register findRegFor (LIns *ins, RegisterMask allow)
void findRegFor2 (RegisterMask allowa, LIns *ia, Register &ra, RegisterMask allowb, LIns *ib, Register &rb)
Register findSpecificRegFor (LIns *ins, Register r)
Register findSpecificRegForUnallocated (LIns *ins, Register r)
Register deprecated_prepResultReg (LIns *ins, RegisterMask allow)
Register prepareResultReg (LIns *ins, RegisterMask allow)
void deprecated_freeRsrcOf (LIns *ins)
void freeResourcesOf (LIns *ins)
void evictIfActive (Register r)
void evict (LIns *vic)
RegisterMask hint (LIns *ins)
void getBaseIndexScale (LIns *addp, LIns **base, LIns **index, int *scale)
void codeAlloc (NIns *&start, NIns *&end, NIns *&eip verbose_only(, size_t &nBytes), size_t byteLimit=0)
bool deprecated_isKnownReg (Register r)
void swapCodeChunks ()
 verbose_only (void asm_inc_m32(uint32_t *);) void asm_mmq(Register rd
void asm_jmp (LIns *ins, InsList &pending_lives)
void asm_jcc (LIns *ins, InsList &pending_lives)
void asm_jov (LIns *ins, InsList &pending_lives)
void asm_x (LIns *ins)
void asm_xcc (LIns *ins)
NInsasm_exit (LIns *guard)
NInsasm_leave_trace (LIns *guard)
void asm_store32 (LOpcode op, LIns *val, int d, LIns *base)
void asm_store64 (LOpcode op, LIns *val, int d, LIns *base)
void asm_restore (LIns *, Register)
bool asm_maybe_spill (LIns *ins, bool pop)
void asm_spill (Register rr, int d, bool quad)
void asm_load64 (LIns *ins)
void asm_ret (LIns *ins)
void asm_immd (LIns *ins)
void asm_condd (LIns *ins)
void asm_cond (LIns *ins)
void asm_arith (LIns *ins)
void asm_neg_not (LIns *ins)
void asm_load32 (LIns *ins)
void asm_cmov (LIns *ins)
void asm_param (LIns *ins)
void asm_immi (LIns *ins)
void asm_fneg (LIns *ins)
void asm_fop (LIns *ins)
void asm_i2d (LIns *ins)
void asm_ui2d (LIns *ins)
void asm_d2i (LIns *ins)
void asm_nongp_copy (Register r, Register s)
void asm_call (LIns *)
Register asm_binop_rhs_reg (LIns *ins)
NInsasm_branch (bool branchOnFalse, LIns *cond, NIns *targ)
NInsasm_branch_ov (LOpcode op, NIns *targ)
void asm_switch (LIns *ins, NIns *target)
void asm_jtbl (LIns *ins, NIns **table)
void asm_insert_random_nop ()
void emitJumpTable (SwitchInfo *si, NIns *target)
void assignSavedRegs ()
void reserveSavedRegs ()
void assignParamRegs ()
void handleLoopCarriedExprs (InsList &pending_lives)
void nInit (AvmCore *)
void nBeginAssembly ()
Register nRegisterAllocFromSet (RegisterMask set)
void nRegisterResetAll (RegAlloc &a)
void nPatchBranch (NIns *branch, NIns *location)
void nFragExit (LIns *guard)
RegisterMask nHint (LIns *ins)

Static Public Member Functions

static bool canRemat (LIns *)

Public Attributes

RegAllocMap _branchStateMap
NInsMap _patches
LabelStateMap _labels
bool _inExit
bool vpad2 [3]
AssmError _err
AR _activation
RegAlloc _allocator
int dd
int Register rs
int Register int ds

Static Public Attributes

static RegisterMask nHints [LIR_sentinel+1]
static const RegisterMask PREFER_SPECIAL = 0xffffffff
static const Register savedRegs [NumSavedRegs+1]


class VerboseBlockReader

Detailed Description

Information about the activation record for the method is built up as we generate machine code.

As part of the prologue, we issue a stack adjustment instruction and then later patch the adjustment value. Temporary values can be placed into the AR as method calls are issued. Also LIR_allocp instructions will consume space.

Constructor & Destructor Documentation

nanojit::Assembler::Assembler ( CodeAlloc codeAlloc,
Allocator dataAlloc,
Allocator alloc,
AvmCore *  core,
LogControl *  logc,
const Config &  config 

Member Function Documentation

void nanojit::Assembler::arFree ( LIns ins  ) 
uint32_t nanojit::Assembler::arReserve ( LIns ins  ) 
void nanojit::Assembler::arReset (  ) 
void nanojit::Assembler::asm_arith ( LIns ins  ) 
Register nanojit::Assembler::asm_binop_rhs_reg ( LIns ins  ) 
NIns* nanojit::Assembler::asm_branch ( bool  branchOnFalse,
LIns cond,
NIns targ 
NIns* nanojit::Assembler::asm_branch_ov ( LOpcode  op,
NIns targ 
void nanojit::Assembler::asm_call ( LIns  ) 
void nanojit::Assembler::asm_cmov ( LIns ins  ) 
void nanojit::Assembler::asm_cond ( LIns ins  ) 
void nanojit::Assembler::asm_condd ( LIns ins  ) 
void nanojit::Assembler::asm_d2i ( LIns ins  ) 
NIns* nanojit::Assembler::asm_exit ( LIns guard  ) 
void nanojit::Assembler::asm_fneg ( LIns ins  ) 
void nanojit::Assembler::asm_fop ( LIns ins  ) 
void nanojit::Assembler::asm_i2d ( LIns ins  ) 
void nanojit::Assembler::asm_immd ( LIns ins  ) 
void nanojit::Assembler::asm_immi ( LIns ins  ) 
void nanojit::Assembler::asm_insert_random_nop (  ) 
void nanojit::Assembler::asm_jcc ( LIns ins,
InsList pending_lives 
void nanojit::Assembler::asm_jmp ( LIns ins,
InsList pending_lives 
void nanojit::Assembler::asm_jov ( LIns ins,
InsList pending_lives 
void nanojit::Assembler::asm_jtbl ( LIns ins,
NIns **  table 
NIns* nanojit::Assembler::asm_leave_trace ( LIns guard  ) 
void nanojit::Assembler::asm_load32 ( LIns ins  ) 
void nanojit::Assembler::asm_load64 ( LIns ins  ) 
bool nanojit::Assembler::asm_maybe_spill ( LIns ins,
bool  pop 
void nanojit::Assembler::asm_neg_not ( LIns ins  ) 
void nanojit::Assembler::asm_nongp_copy ( Register  r,
Register  s 
void nanojit::Assembler::asm_param ( LIns ins  ) 
void nanojit::Assembler::asm_restore ( LIns ,
void nanojit::Assembler::asm_ret ( LIns ins  ) 
void nanojit::Assembler::asm_spill ( Register  rr,
int  d,
bool  quad 
void nanojit::Assembler::asm_store32 ( LOpcode  op,
LIns val,
int  d,
LIns base 
void nanojit::Assembler::asm_store64 ( LOpcode  op,
LIns val,
int  d,
LIns base 
void nanojit::Assembler::asm_switch ( LIns ins,
NIns target 
void nanojit::Assembler::asm_ui2d ( LIns ins  ) 
void nanojit::Assembler::asm_x ( LIns ins  ) 
void nanojit::Assembler::asm_xcc ( LIns ins  ) 
void nanojit::Assembler::assemble ( Fragment frag,
LirFilter reader 
void nanojit::Assembler::assignParamRegs (  ) 
void nanojit::Assembler::assignSaved ( RegAlloc saved,
RegisterMask  skip 
void nanojit::Assembler::assignSavedRegs (  ) 
void nanojit::Assembler::beginAssembly ( Fragment frag  ) 
static bool nanojit::Assembler::canRemat ( LIns  )  [static]
void nanojit::Assembler::cleanupAfterError (  ) 
void nanojit::Assembler::clearNInsPtrs (  ) 
void nanojit::Assembler::codeAlloc ( NIns *&  start,
NIns *&  end,
NIns *&eip   verbose_only, size_t &nBytes,
size_t  byteLimit = 0 
void nanojit::Assembler::compile ( Fragment frag,
Allocator alloc,
bool optimize   verbose_only, LInsPrinter * 
nanojit::Assembler::debug_only ( void pageValidate();   ) 
void nanojit::Assembler::deprecated_freeRsrcOf ( LIns ins  ) 
bool nanojit::Assembler::deprecated_isKnownReg ( Register  r  )  [inline]
Register nanojit::Assembler::deprecated_prepResultReg ( LIns ins,
RegisterMask  allow 
void nanojit::Assembler::emitJumpTable ( SwitchInfo si,
NIns target 
void nanojit::Assembler::endAssembly ( Fragment frag  ) 
AssmError nanojit::Assembler::error (  )  [inline]
void nanojit::Assembler::evict ( LIns vic  ) 
void nanojit::Assembler::evictAllActiveRegs (  )  [inline]
void nanojit::Assembler::evictIfActive ( Register  r  ) 
void nanojit::Assembler::evictScratchRegsExcept ( RegisterMask  ignore  ) 
void nanojit::Assembler::evictSomeActiveRegs ( RegisterMask  regs  ) 
int nanojit::Assembler::findMemFor ( LIns ins  ) 
Register nanojit::Assembler::findRegFor ( LIns ins,
RegisterMask  allow 
void nanojit::Assembler::findRegFor2 ( RegisterMask  allowa,
LIns ia,
Register ra,
RegisterMask  allowb,
LIns ib,
Register rb 
Register nanojit::Assembler::findSpecificRegFor ( LIns ins,
Register  r 
Register nanojit::Assembler::findSpecificRegForUnallocated ( LIns ins,
Register  r 
LIns* nanojit::Assembler::findVictim ( RegisterMask  allow  ) 
void nanojit::Assembler::freeResourcesOf ( LIns ins  ) 
NIns* nanojit::Assembler::genEpilogue (  ) 
void nanojit::Assembler::getBaseIndexScale ( LIns addp,
LIns **  base,
LIns **  index,
int *  scale 
Register nanojit::Assembler::getBaseReg ( LIns ins,
int &  d,
RegisterMask  allow 
void nanojit::Assembler::getBaseReg2 ( RegisterMask  allowValue,
LIns value,
Register rv,
RegisterMask  allowBase,
LIns base,
Register rb,
int &  d 
void nanojit::Assembler::handleLoopCarriedExprs ( InsList pending_lives  ) 
RegisterMask nanojit::Assembler::hint ( LIns ins  ) 
void nanojit::Assembler::intersectRegisterState ( RegAlloc saved  ) 
void nanojit::Assembler::nBeginAssembly (  ) 
void nanojit::Assembler::nFragExit ( LIns guard  ) 
RegisterMask nanojit::Assembler::nHint ( LIns ins  ) 
void nanojit::Assembler::nInit ( AvmCore *   ) 
void nanojit::Assembler::nPatchBranch ( NIns branch,
NIns location 
Register nanojit::Assembler::nRegisterAllocFromSet ( RegisterMask  set  ) 
void nanojit::Assembler::nRegisterResetAll ( RegAlloc a  ) 
void nanojit::Assembler::patch ( SideExit exit  ) 
void nanojit::Assembler::patch ( GuardRecord lr  ) 
Register nanojit::Assembler::prepareResultReg ( LIns ins,
RegisterMask  allow 
Register nanojit::Assembler::registerAlloc ( LIns ins,
RegisterMask  allow,
RegisterMask  prefer 
Register nanojit::Assembler::registerAllocTmp ( RegisterMask  allow  ) 
void nanojit::Assembler::registerResetAll (  ) 
void nanojit::Assembler::releaseRegisters (  ) 
void nanojit::Assembler::reserveSavedRegs (  ) 
void nanojit::Assembler::reset (  ) 
void nanojit::Assembler::setError ( AssmError  e  )  [inline]
void nanojit::Assembler::setNoiseGenerator ( Noise noise  )  [inline]
void nanojit::Assembler::swapCodeChunks (  ) 
void nanojit::Assembler::unionRegisterState ( RegAlloc saved  ) 
nanojit::Assembler::verbose_only ( void asm_inc_m32(uint32_t *);   ) 

Friends And Related Function Documentation

friend class VerboseBlockReader [friend]

Member Data Documentation

RegisterMask nanojit::Assembler::nHints[LIR_sentinel+1] [static]
const RegisterMask nanojit::Assembler::PREFER_SPECIAL = 0xffffffff [static]
const Register nanojit::Assembler::savedRegs[NumSavedRegs+1] [static]

The documentation for this class was generated from the following file: