< prev index next >

src/hotspot/share/opto/optoreg.hpp

Print this page




  34 //------------------------------OptoReg----------------------------------------
  35 // We eventually need Registers for the Real World.  Registers are essentially
  36 // non-SSA names.  A Register is represented as a number.  Non-regular values
  37 // (e.g., Control, Memory, I/O) use the Special register.  The actual machine
  38 // registers (as described in the ADL file for a machine) start at zero.
  39 // Stack-slots (spill locations) start at the nest Chunk past the last machine
  40 // register.
  41 //
  42 // Note that stack spill-slots are treated as a very large register set.
  43 // They have all the correct properties for a Register: not aliased (unique
  44 // named).  There is some simple mapping from a stack-slot register number
  45 // to the actual location on the stack; this mapping depends on the calling
  46 // conventions and is described in the ADL.
  47 //
  48 // Note that Name is not enum. C++ standard defines that the range of enum
  49 // is the range of smallest bit-field that can represent all enumerators
  50 // declared in the enum. The result of assigning a value to enum is undefined
  51 // if the value is outside the enumeration's valid range. OptoReg::Name is
  52 // typedef'ed as int, because it needs to be able to represent spill-slots.
  53 //
  54 class OptoReg VALUE_OBJ_CLASS_SPEC {
  55 
  56  friend class C2Compiler;
  57  public:
  58   typedef int Name;
  59   enum {
  60     // Chunk 0
  61     Physical = AdlcVMDeps::Physical, // Start of physical regs
  62     // A few oddballs at the edge of the world
  63     Special = -2,               // All special (not allocated) values
  64     Bad = -1                    // Not a register
  65   };
  66 
  67  private:
  68 
  69  static const VMReg opto2vm[REG_COUNT];
  70  static Name vm2opto[ConcreteRegisterImpl::number_of_registers];
  71 
  72  public:
  73 
  74   // Stack pointer register




  34 //------------------------------OptoReg----------------------------------------
  35 // We eventually need Registers for the Real World.  Registers are essentially
  36 // non-SSA names.  A Register is represented as a number.  Non-regular values
  37 // (e.g., Control, Memory, I/O) use the Special register.  The actual machine
  38 // registers (as described in the ADL file for a machine) start at zero.
  39 // Stack-slots (spill locations) start at the nest Chunk past the last machine
  40 // register.
  41 //
  42 // Note that stack spill-slots are treated as a very large register set.
  43 // They have all the correct properties for a Register: not aliased (unique
  44 // named).  There is some simple mapping from a stack-slot register number
  45 // to the actual location on the stack; this mapping depends on the calling
  46 // conventions and is described in the ADL.
  47 //
  48 // Note that Name is not enum. C++ standard defines that the range of enum
  49 // is the range of smallest bit-field that can represent all enumerators
  50 // declared in the enum. The result of assigning a value to enum is undefined
  51 // if the value is outside the enumeration's valid range. OptoReg::Name is
  52 // typedef'ed as int, because it needs to be able to represent spill-slots.
  53 //
  54 class OptoReg {
  55 
  56  friend class C2Compiler;
  57  public:
  58   typedef int Name;
  59   enum {
  60     // Chunk 0
  61     Physical = AdlcVMDeps::Physical, // Start of physical regs
  62     // A few oddballs at the edge of the world
  63     Special = -2,               // All special (not allocated) values
  64     Bad = -1                    // Not a register
  65   };
  66 
  67  private:
  68 
  69  static const VMReg opto2vm[REG_COUNT];
  70  static Name vm2opto[ConcreteRegisterImpl::number_of_registers];
  71 
  72  public:
  73 
  74   // Stack pointer register


< prev index next >