src/share/vm/opto/machnode.hpp

changeset 2350
2f644f85485d
parent 2314
f95d63e2154a
child 3037
3d42f82cd811
     1.1 --- a/src/share/vm/opto/machnode.hpp	Thu Dec 02 17:21:12 2010 -0800
     1.2 +++ b/src/share/vm/opto/machnode.hpp	Fri Dec 03 01:34:31 2010 -0800
     1.3 @@ -231,9 +231,6 @@
     1.4    // Return number of relocatable values contained in this instruction
     1.5    virtual int   reloc() const { return 0; }
     1.6  
     1.7 -  // Return number of words used for double constants in this instruction
     1.8 -  virtual int   const_size() const { return 0; }
     1.9 -
    1.10    // Hash and compare over operands.  Used to do GVN on machine Nodes.
    1.11    virtual uint  hash() const;
    1.12    virtual uint  cmp( const Node &n ) const;
    1.13 @@ -348,6 +345,65 @@
    1.14  #endif
    1.15  };
    1.16  
    1.17 +//------------------------------MachConstantBaseNode--------------------------
    1.18 +// Machine node that represents the base address of the constant table.
    1.19 +class MachConstantBaseNode : public MachIdealNode {
    1.20 +public:
    1.21 +  static const RegMask& _out_RegMask;  // We need the out_RegMask statically in MachConstantNode::in_RegMask().
    1.22 +
    1.23 +public:
    1.24 +  MachConstantBaseNode() : MachIdealNode() {
    1.25 +    init_class_id(Class_MachConstantBase);
    1.26 +  }
    1.27 +  virtual const class Type* bottom_type() const { return TypeRawPtr::NOTNULL; }
    1.28 +  virtual uint ideal_reg() const { return Op_RegP; }
    1.29 +  virtual uint oper_input_base() const { return 1; }
    1.30 +
    1.31 +  virtual void emit(CodeBuffer& cbuf, PhaseRegAlloc* ra_) const;
    1.32 +  virtual uint size(PhaseRegAlloc* ra_) const;
    1.33 +  virtual bool pinned() const { return UseRDPCForConstantTableBase; }
    1.34 +
    1.35 +  static const RegMask& static_out_RegMask() { return _out_RegMask; }
    1.36 +  virtual const RegMask& out_RegMask() const { return static_out_RegMask(); }
    1.37 +
    1.38 +#ifndef PRODUCT
    1.39 +  virtual const char* Name() const { return "MachConstantBaseNode"; }
    1.40 +  virtual void format(PhaseRegAlloc*, outputStream* st) const;
    1.41 +#endif
    1.42 +};
    1.43 +
    1.44 +//------------------------------MachConstantNode-------------------------------
    1.45 +// Machine node that holds a constant which is stored in the constant table.
    1.46 +class MachConstantNode : public MachNode {
    1.47 +protected:
    1.48 +  Compile::Constant _constant;  // This node's constant.
    1.49 +
    1.50 +public:
    1.51 +  MachConstantNode() : MachNode() {
    1.52 +    init_class_id(Class_MachConstant);
    1.53 +  }
    1.54 +
    1.55 +  virtual void eval_constant(Compile* C) {
    1.56 +#ifdef ASSERT
    1.57 +    tty->print("missing MachConstantNode eval_constant function: ");
    1.58 +    dump();
    1.59 +#endif
    1.60 +    ShouldNotCallThis();
    1.61 +  }
    1.62 +
    1.63 +  virtual const RegMask &in_RegMask(uint idx) const {
    1.64 +    if (idx == mach_constant_base_node_input())
    1.65 +      return MachConstantBaseNode::static_out_RegMask();
    1.66 +    return MachNode::in_RegMask(idx);
    1.67 +  }
    1.68 +
    1.69 +  // Input edge of MachConstantBaseNode.
    1.70 +  uint mach_constant_base_node_input() const { return req() - 1; }
    1.71 +
    1.72 +  int  constant_offset();
    1.73 +  int  constant_offset() const { return ((MachConstantNode*) this)->constant_offset(); }
    1.74 +};
    1.75 +
    1.76  //------------------------------MachUEPNode-----------------------------------
    1.77  // Machine Unvalidated Entry Point Node
    1.78  class MachUEPNode : public MachIdealNode {

mercurial